mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
346 lines
9.1 KiB
Go
346 lines
9.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"
|
|
"time"
|
|
)
|
|
|
|
// checks if the PrincipalList type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PrincipalList{}
|
|
|
|
// PrincipalList struct for PrincipalList
|
|
type PrincipalList struct {
|
|
// AttemptedAt is when the last attempt happened, successful or not.
|
|
AttemptedAt *time.Time `json:"attempted_at,omitempty"`
|
|
// Designations is how many entries the last successful load carried.
|
|
Designations *int64 `json:"designations,omitempty"`
|
|
// Digest is the digest of the payload that produced Designations.
|
|
Digest *string `json:"digest,omitempty"`
|
|
// Err is why the last attempt failed, empty if it succeeded.
|
|
Error *string `json:"error,omitempty"`
|
|
// LoadedAt is when that load happened. Zero means this list has never loaded, which is not the same as a publisher who designates nobody.
|
|
LoadedAt *time.Time `json:"loaded_at,omitempty"`
|
|
// Source is the publisher.
|
|
Source *string `json:"source,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PrincipalList PrincipalList
|
|
|
|
// NewPrincipalList instantiates a new PrincipalList 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 NewPrincipalList() *PrincipalList {
|
|
this := PrincipalList{}
|
|
return &this
|
|
}
|
|
|
|
// NewPrincipalListWithDefaults instantiates a new PrincipalList 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 NewPrincipalListWithDefaults() *PrincipalList {
|
|
this := PrincipalList{}
|
|
return &this
|
|
}
|
|
|
|
// GetAttemptedAt returns the AttemptedAt field value if set, zero value otherwise.
|
|
func (o *PrincipalList) GetAttemptedAt() time.Time {
|
|
if o == nil || IsNil(o.AttemptedAt) {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
return *o.AttemptedAt
|
|
}
|
|
|
|
// GetAttemptedAtOk returns a tuple with the AttemptedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalList) GetAttemptedAtOk() (*time.Time, bool) {
|
|
if o == nil || IsNil(o.AttemptedAt) {
|
|
return nil, false
|
|
}
|
|
return o.AttemptedAt, true
|
|
}
|
|
|
|
// HasAttemptedAt returns a boolean if a field has been set.
|
|
func (o *PrincipalList) HasAttemptedAt() bool {
|
|
if o != nil && !IsNil(o.AttemptedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAttemptedAt gets a reference to the given time.Time and assigns it to the AttemptedAt field.
|
|
func (o *PrincipalList) SetAttemptedAt(v time.Time) {
|
|
o.AttemptedAt = &v
|
|
}
|
|
|
|
// GetDesignations returns the Designations field value if set, zero value otherwise.
|
|
func (o *PrincipalList) GetDesignations() int64 {
|
|
if o == nil || IsNil(o.Designations) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Designations
|
|
}
|
|
|
|
// GetDesignationsOk returns a tuple with the Designations field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalList) GetDesignationsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Designations) {
|
|
return nil, false
|
|
}
|
|
return o.Designations, true
|
|
}
|
|
|
|
// HasDesignations returns a boolean if a field has been set.
|
|
func (o *PrincipalList) HasDesignations() bool {
|
|
if o != nil && !IsNil(o.Designations) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDesignations gets a reference to the given int64 and assigns it to the Designations field.
|
|
func (o *PrincipalList) SetDesignations(v int64) {
|
|
o.Designations = &v
|
|
}
|
|
|
|
// GetDigest returns the Digest field value if set, zero value otherwise.
|
|
func (o *PrincipalList) GetDigest() string {
|
|
if o == nil || IsNil(o.Digest) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Digest
|
|
}
|
|
|
|
// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalList) GetDigestOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Digest) {
|
|
return nil, false
|
|
}
|
|
return o.Digest, true
|
|
}
|
|
|
|
// HasDigest returns a boolean if a field has been set.
|
|
func (o *PrincipalList) HasDigest() bool {
|
|
if o != nil && !IsNil(o.Digest) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDigest gets a reference to the given string and assigns it to the Digest field.
|
|
func (o *PrincipalList) SetDigest(v string) {
|
|
o.Digest = &v
|
|
}
|
|
|
|
// GetError returns the Error field value if set, zero value otherwise.
|
|
func (o *PrincipalList) GetError() string {
|
|
if o == nil || IsNil(o.Error) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Error
|
|
}
|
|
|
|
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalList) GetErrorOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Error) {
|
|
return nil, false
|
|
}
|
|
return o.Error, true
|
|
}
|
|
|
|
// HasError returns a boolean if a field has been set.
|
|
func (o *PrincipalList) HasError() bool {
|
|
if o != nil && !IsNil(o.Error) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetError gets a reference to the given string and assigns it to the Error field.
|
|
func (o *PrincipalList) SetError(v string) {
|
|
o.Error = &v
|
|
}
|
|
|
|
// GetLoadedAt returns the LoadedAt field value if set, zero value otherwise.
|
|
func (o *PrincipalList) GetLoadedAt() time.Time {
|
|
if o == nil || IsNil(o.LoadedAt) {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
return *o.LoadedAt
|
|
}
|
|
|
|
// GetLoadedAtOk returns a tuple with the LoadedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalList) GetLoadedAtOk() (*time.Time, bool) {
|
|
if o == nil || IsNil(o.LoadedAt) {
|
|
return nil, false
|
|
}
|
|
return o.LoadedAt, true
|
|
}
|
|
|
|
// HasLoadedAt returns a boolean if a field has been set.
|
|
func (o *PrincipalList) HasLoadedAt() bool {
|
|
if o != nil && !IsNil(o.LoadedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLoadedAt gets a reference to the given time.Time and assigns it to the LoadedAt field.
|
|
func (o *PrincipalList) SetLoadedAt(v time.Time) {
|
|
o.LoadedAt = &v
|
|
}
|
|
|
|
// GetSource returns the Source field value if set, zero value otherwise.
|
|
func (o *PrincipalList) GetSource() string {
|
|
if o == nil || IsNil(o.Source) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Source
|
|
}
|
|
|
|
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PrincipalList) GetSourceOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Source) {
|
|
return nil, false
|
|
}
|
|
return o.Source, true
|
|
}
|
|
|
|
// HasSource returns a boolean if a field has been set.
|
|
func (o *PrincipalList) HasSource() bool {
|
|
if o != nil && !IsNil(o.Source) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSource gets a reference to the given string and assigns it to the Source field.
|
|
func (o *PrincipalList) SetSource(v string) {
|
|
o.Source = &v
|
|
}
|
|
|
|
func (o PrincipalList) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PrincipalList) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.AttemptedAt) {
|
|
toSerialize["attempted_at"] = o.AttemptedAt
|
|
}
|
|
if !IsNil(o.Designations) {
|
|
toSerialize["designations"] = o.Designations
|
|
}
|
|
if !IsNil(o.Digest) {
|
|
toSerialize["digest"] = o.Digest
|
|
}
|
|
if !IsNil(o.Error) {
|
|
toSerialize["error"] = o.Error
|
|
}
|
|
if !IsNil(o.LoadedAt) {
|
|
toSerialize["loaded_at"] = o.LoadedAt
|
|
}
|
|
if !IsNil(o.Source) {
|
|
toSerialize["source"] = o.Source
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PrincipalList) UnmarshalJSON(data []byte) (err error) {
|
|
varPrincipalList := _PrincipalList{}
|
|
|
|
err = json.Unmarshal(data, &varPrincipalList)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PrincipalList(varPrincipalList)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "attempted_at")
|
|
delete(additionalProperties, "designations")
|
|
delete(additionalProperties, "digest")
|
|
delete(additionalProperties, "error")
|
|
delete(additionalProperties, "loaded_at")
|
|
delete(additionalProperties, "source")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePrincipalList struct {
|
|
value *PrincipalList
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePrincipalList) Get() *PrincipalList {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePrincipalList) Set(val *PrincipalList) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePrincipalList) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePrincipalList) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePrincipalList(val *PrincipalList) *NullablePrincipalList {
|
|
return &NullablePrincipalList{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePrincipalList) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePrincipalList) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|