Files
sdk/model_principal_summary.go

193 lines
5.0 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 PrincipalSummary type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PrincipalSummary{}
// PrincipalSummary struct for PrincipalSummary
type PrincipalSummary struct {
// Missing are the steps it owes, each with the rule that asks for it.
Missing []PrincipalStep `json:"missing,omitempty"`
// Ready is true when it lacks nothing its own facts decide.
Ready *bool `json:"ready,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PrincipalSummary PrincipalSummary
// NewPrincipalSummary instantiates a new PrincipalSummary 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 NewPrincipalSummary() *PrincipalSummary {
this := PrincipalSummary{}
return &this
}
// NewPrincipalSummaryWithDefaults instantiates a new PrincipalSummary 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 NewPrincipalSummaryWithDefaults() *PrincipalSummary {
this := PrincipalSummary{}
return &this
}
// GetMissing returns the Missing field value if set, zero value otherwise.
func (o *PrincipalSummary) GetMissing() []PrincipalStep {
if o == nil || IsNil(o.Missing) {
var ret []PrincipalStep
return ret
}
return o.Missing
}
// GetMissingOk returns a tuple with the Missing field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalSummary) GetMissingOk() ([]PrincipalStep, bool) {
if o == nil || IsNil(o.Missing) {
return nil, false
}
return o.Missing, true
}
// HasMissing returns a boolean if a field has been set.
func (o *PrincipalSummary) HasMissing() bool {
if o != nil && !IsNil(o.Missing) {
return true
}
return false
}
// SetMissing gets a reference to the given []PrincipalStep and assigns it to the Missing field.
func (o *PrincipalSummary) SetMissing(v []PrincipalStep) {
o.Missing = v
}
// GetReady returns the Ready field value if set, zero value otherwise.
func (o *PrincipalSummary) GetReady() bool {
if o == nil || IsNil(o.Ready) {
var ret bool
return ret
}
return *o.Ready
}
// GetReadyOk returns a tuple with the Ready field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PrincipalSummary) GetReadyOk() (*bool, bool) {
if o == nil || IsNil(o.Ready) {
return nil, false
}
return o.Ready, true
}
// HasReady returns a boolean if a field has been set.
func (o *PrincipalSummary) HasReady() bool {
if o != nil && !IsNil(o.Ready) {
return true
}
return false
}
// SetReady gets a reference to the given bool and assigns it to the Ready field.
func (o *PrincipalSummary) SetReady(v bool) {
o.Ready = &v
}
func (o PrincipalSummary) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PrincipalSummary) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Missing) {
toSerialize["missing"] = o.Missing
}
if !IsNil(o.Ready) {
toSerialize["ready"] = o.Ready
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PrincipalSummary) UnmarshalJSON(data []byte) (err error) {
varPrincipalSummary := _PrincipalSummary{}
err = json.Unmarshal(data, &varPrincipalSummary)
if err != nil {
return err
}
*o = PrincipalSummary(varPrincipalSummary)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "missing")
delete(additionalProperties, "ready")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePrincipalSummary struct {
value *PrincipalSummary
isSet bool
}
func (v NullablePrincipalSummary) Get() *PrincipalSummary {
return v.value
}
func (v *NullablePrincipalSummary) Set(val *PrincipalSummary) {
v.value = val
v.isSet = true
}
func (v NullablePrincipalSummary) IsSet() bool {
return v.isSet
}
func (v *NullablePrincipalSummary) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePrincipalSummary(val *PrincipalSummary) *NullablePrincipalSummary {
return &NullablePrincipalSummary{value: val, isSet: true}
}
func (v NullablePrincipalSummary) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePrincipalSummary) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}