mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.2 KiB
Go
231 lines
6.2 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the LinkRevokeResp type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &LinkRevokeResp{}
|
|
|
|
// LinkRevokeResp struct for LinkRevokeResp
|
|
type LinkRevokeResp struct {
|
|
// Links is each revoked row with its new status — retained, not deleted, so usage history and the audit trail survive the log-out.
|
|
Links []LinkLinkView `json:"links,omitempty"`
|
|
// Revoked is how many links this call revoked.
|
|
Revoked *int64 `json:"revoked,omitempty"`
|
|
// SessionsStopped is how many of the caller's own agent sessions stopped. A stop that fails does not fail the revoke, so this may honestly report fewer.
|
|
SessionsStopped *int64 `json:"sessionsStopped,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _LinkRevokeResp LinkRevokeResp
|
|
|
|
// NewLinkRevokeResp instantiates a new LinkRevokeResp object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewLinkRevokeResp() *LinkRevokeResp {
|
|
this := LinkRevokeResp{}
|
|
return &this
|
|
}
|
|
|
|
// NewLinkRevokeRespWithDefaults instantiates a new LinkRevokeResp object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewLinkRevokeRespWithDefaults() *LinkRevokeResp {
|
|
this := LinkRevokeResp{}
|
|
return &this
|
|
}
|
|
|
|
// GetLinks returns the Links field value if set, zero value otherwise.
|
|
func (o *LinkRevokeResp) GetLinks() []LinkLinkView {
|
|
if o == nil || IsNil(o.Links) {
|
|
var ret []LinkLinkView
|
|
return ret
|
|
}
|
|
return o.Links
|
|
}
|
|
|
|
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkRevokeResp) GetLinksOk() ([]LinkLinkView, bool) {
|
|
if o == nil || IsNil(o.Links) {
|
|
return nil, false
|
|
}
|
|
return o.Links, true
|
|
}
|
|
|
|
// HasLinks returns a boolean if a field has been set.
|
|
func (o *LinkRevokeResp) HasLinks() bool {
|
|
if o != nil && !IsNil(o.Links) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLinks gets a reference to the given []LinkLinkView and assigns it to the Links field.
|
|
func (o *LinkRevokeResp) SetLinks(v []LinkLinkView) {
|
|
o.Links = v
|
|
}
|
|
|
|
// GetRevoked returns the Revoked field value if set, zero value otherwise.
|
|
func (o *LinkRevokeResp) GetRevoked() int64 {
|
|
if o == nil || IsNil(o.Revoked) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Revoked
|
|
}
|
|
|
|
// GetRevokedOk returns a tuple with the Revoked field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkRevokeResp) GetRevokedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Revoked) {
|
|
return nil, false
|
|
}
|
|
return o.Revoked, true
|
|
}
|
|
|
|
// HasRevoked returns a boolean if a field has been set.
|
|
func (o *LinkRevokeResp) HasRevoked() bool {
|
|
if o != nil && !IsNil(o.Revoked) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRevoked gets a reference to the given int64 and assigns it to the Revoked field.
|
|
func (o *LinkRevokeResp) SetRevoked(v int64) {
|
|
o.Revoked = &v
|
|
}
|
|
|
|
// GetSessionsStopped returns the SessionsStopped field value if set, zero value otherwise.
|
|
func (o *LinkRevokeResp) GetSessionsStopped() int64 {
|
|
if o == nil || IsNil(o.SessionsStopped) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.SessionsStopped
|
|
}
|
|
|
|
// GetSessionsStoppedOk returns a tuple with the SessionsStopped field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LinkRevokeResp) GetSessionsStoppedOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.SessionsStopped) {
|
|
return nil, false
|
|
}
|
|
return o.SessionsStopped, true
|
|
}
|
|
|
|
// HasSessionsStopped returns a boolean if a field has been set.
|
|
func (o *LinkRevokeResp) HasSessionsStopped() bool {
|
|
if o != nil && !IsNil(o.SessionsStopped) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSessionsStopped gets a reference to the given int64 and assigns it to the SessionsStopped field.
|
|
func (o *LinkRevokeResp) SetSessionsStopped(v int64) {
|
|
o.SessionsStopped = &v
|
|
}
|
|
|
|
func (o LinkRevokeResp) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o LinkRevokeResp) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Links) {
|
|
toSerialize["links"] = o.Links
|
|
}
|
|
if !IsNil(o.Revoked) {
|
|
toSerialize["revoked"] = o.Revoked
|
|
}
|
|
if !IsNil(o.SessionsStopped) {
|
|
toSerialize["sessionsStopped"] = o.SessionsStopped
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *LinkRevokeResp) UnmarshalJSON(data []byte) (err error) {
|
|
varLinkRevokeResp := _LinkRevokeResp{}
|
|
|
|
err = json.Unmarshal(data, &varLinkRevokeResp)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = LinkRevokeResp(varLinkRevokeResp)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "links")
|
|
delete(additionalProperties, "revoked")
|
|
delete(additionalProperties, "sessionsStopped")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableLinkRevokeResp struct {
|
|
value *LinkRevokeResp
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableLinkRevokeResp) Get() *LinkRevokeResp {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableLinkRevokeResp) Set(val *LinkRevokeResp) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableLinkRevokeResp) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableLinkRevokeResp) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableLinkRevokeResp(val *LinkRevokeResp) *NullableLinkRevokeResp {
|
|
return &NullableLinkRevokeResp{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableLinkRevokeResp) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableLinkRevokeResp) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|