Files
sdk/model_share_rotated.go

193 lines
5.1 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 ShareRotated type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ShareRotated{}
// ShareRotated struct for ShareRotated
type ShareRotated struct {
// Ended is how many environments the rotated accounts had enabled. Each is ended with its shares, so a machine that ran a tunnel on an account enables again with the new credential.
Ended *int64 `json:"ended,omitempty"`
// Pending says what this call could not rotate, and is empty when it rotated everything. In a held org an admin rotates their own account first and the org's own after it, so the org's failing to rotate is said here rather than keeping them from their own; calling again tries it again.
Pending *string `json:"pending,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ShareRotated ShareRotated
// NewShareRotated instantiates a new ShareRotated 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 NewShareRotated() *ShareRotated {
this := ShareRotated{}
return &this
}
// NewShareRotatedWithDefaults instantiates a new ShareRotated 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 NewShareRotatedWithDefaults() *ShareRotated {
this := ShareRotated{}
return &this
}
// GetEnded returns the Ended field value if set, zero value otherwise.
func (o *ShareRotated) GetEnded() int64 {
if o == nil || IsNil(o.Ended) {
var ret int64
return ret
}
return *o.Ended
}
// GetEndedOk returns a tuple with the Ended field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShareRotated) GetEndedOk() (*int64, bool) {
if o == nil || IsNil(o.Ended) {
return nil, false
}
return o.Ended, true
}
// HasEnded returns a boolean if a field has been set.
func (o *ShareRotated) HasEnded() bool {
if o != nil && !IsNil(o.Ended) {
return true
}
return false
}
// SetEnded gets a reference to the given int64 and assigns it to the Ended field.
func (o *ShareRotated) SetEnded(v int64) {
o.Ended = &v
}
// GetPending returns the Pending field value if set, zero value otherwise.
func (o *ShareRotated) GetPending() string {
if o == nil || IsNil(o.Pending) {
var ret string
return ret
}
return *o.Pending
}
// GetPendingOk returns a tuple with the Pending field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ShareRotated) GetPendingOk() (*string, bool) {
if o == nil || IsNil(o.Pending) {
return nil, false
}
return o.Pending, true
}
// HasPending returns a boolean if a field has been set.
func (o *ShareRotated) HasPending() bool {
if o != nil && !IsNil(o.Pending) {
return true
}
return false
}
// SetPending gets a reference to the given string and assigns it to the Pending field.
func (o *ShareRotated) SetPending(v string) {
o.Pending = &v
}
func (o ShareRotated) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ShareRotated) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Ended) {
toSerialize["ended"] = o.Ended
}
if !IsNil(o.Pending) {
toSerialize["pending"] = o.Pending
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ShareRotated) UnmarshalJSON(data []byte) (err error) {
varShareRotated := _ShareRotated{}
err = json.Unmarshal(data, &varShareRotated)
if err != nil {
return err
}
*o = ShareRotated(varShareRotated)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "ended")
delete(additionalProperties, "pending")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableShareRotated struct {
value *ShareRotated
isSet bool
}
func (v NullableShareRotated) Get() *ShareRotated {
return v.value
}
func (v *NullableShareRotated) Set(val *ShareRotated) {
v.value = val
v.isSet = true
}
func (v NullableShareRotated) IsSet() bool {
return v.isSet
}
func (v *NullableShareRotated) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableShareRotated(val *ShareRotated) *NullableShareRotated {
return &NullableShareRotated{value: val, isSet: true}
}
func (v NullableShareRotated) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableShareRotated) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}