Files
sdk/model_project_edge_state.go

383 lines
11 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 ProjectEdgeState type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ProjectEdgeState{}
// ProjectEdgeState struct for ProjectEdgeState
type ProjectEdgeState struct {
// Configured is whether the edge holds credentials to act at all. False means every purge is a no-op.
Configured *bool `json:"configured,omitempty"`
// Error is the blocker, so an operator reads it instead of guessing at it.
Error *string `json:"error,omitempty"`
// Freshness says, in one phrase, how long after a publish a reader sees it. It is the sentence an operator actually wants; the booleans above are how a machine reads the same fact.
Freshness *string `json:"freshness,omitempty"`
// Policy is the Cache-Control this edge serves each class of object with. It is DERIVED from the one canonical function, never a second copy: half the confusion when a publish looks stale is not knowing what the TTLs are, and reading them out of the source is not something an operator should have to do to answer \"how long until this is live\".
Policy map[string]string `json:"policy,omitempty"`
// Provider is the CDN behind this edge, or \"none\". It is the first thing an operator wants and the only vendor name this API returns.
Provider *string `json:"provider,omitempty"`
// Reach is the apexes a publish is invalidated on. A site is served on more than one — the site plane's own and the first-party apex — and a purge that covers one of them looks identical from here to a purge that covers both.
Reach []string `json:"reach,omitempty"`
// Status is \"ok\" when a publish reaches readers immediately, else \"degraded\".
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ProjectEdgeState ProjectEdgeState
// NewProjectEdgeState instantiates a new ProjectEdgeState 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 NewProjectEdgeState() *ProjectEdgeState {
this := ProjectEdgeState{}
return &this
}
// NewProjectEdgeStateWithDefaults instantiates a new ProjectEdgeState 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 NewProjectEdgeStateWithDefaults() *ProjectEdgeState {
this := ProjectEdgeState{}
return &this
}
// GetConfigured returns the Configured field value if set, zero value otherwise.
func (o *ProjectEdgeState) GetConfigured() bool {
if o == nil || IsNil(o.Configured) {
var ret bool
return ret
}
return *o.Configured
}
// GetConfiguredOk returns a tuple with the Configured field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectEdgeState) GetConfiguredOk() (*bool, bool) {
if o == nil || IsNil(o.Configured) {
return nil, false
}
return o.Configured, true
}
// HasConfigured returns a boolean if a field has been set.
func (o *ProjectEdgeState) HasConfigured() bool {
if o != nil && !IsNil(o.Configured) {
return true
}
return false
}
// SetConfigured gets a reference to the given bool and assigns it to the Configured field.
func (o *ProjectEdgeState) SetConfigured(v bool) {
o.Configured = &v
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *ProjectEdgeState) 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 *ProjectEdgeState) 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 *ProjectEdgeState) 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 *ProjectEdgeState) SetError(v string) {
o.Error = &v
}
// GetFreshness returns the Freshness field value if set, zero value otherwise.
func (o *ProjectEdgeState) GetFreshness() string {
if o == nil || IsNil(o.Freshness) {
var ret string
return ret
}
return *o.Freshness
}
// GetFreshnessOk returns a tuple with the Freshness field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectEdgeState) GetFreshnessOk() (*string, bool) {
if o == nil || IsNil(o.Freshness) {
return nil, false
}
return o.Freshness, true
}
// HasFreshness returns a boolean if a field has been set.
func (o *ProjectEdgeState) HasFreshness() bool {
if o != nil && !IsNil(o.Freshness) {
return true
}
return false
}
// SetFreshness gets a reference to the given string and assigns it to the Freshness field.
func (o *ProjectEdgeState) SetFreshness(v string) {
o.Freshness = &v
}
// GetPolicy returns the Policy field value if set, zero value otherwise.
func (o *ProjectEdgeState) GetPolicy() map[string]string {
if o == nil || IsNil(o.Policy) {
var ret map[string]string
return ret
}
return o.Policy
}
// GetPolicyOk returns a tuple with the Policy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectEdgeState) GetPolicyOk() (map[string]string, bool) {
if o == nil || IsNil(o.Policy) {
return map[string]string{}, false
}
return o.Policy, true
}
// HasPolicy returns a boolean if a field has been set.
func (o *ProjectEdgeState) HasPolicy() bool {
if o != nil && !IsNil(o.Policy) {
return true
}
return false
}
// SetPolicy gets a reference to the given map[string]string and assigns it to the Policy field.
func (o *ProjectEdgeState) SetPolicy(v map[string]string) {
o.Policy = v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *ProjectEdgeState) GetProvider() string {
if o == nil || IsNil(o.Provider) {
var ret string
return ret
}
return *o.Provider
}
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectEdgeState) GetProviderOk() (*string, bool) {
if o == nil || IsNil(o.Provider) {
return nil, false
}
return o.Provider, true
}
// HasProvider returns a boolean if a field has been set.
func (o *ProjectEdgeState) HasProvider() bool {
if o != nil && !IsNil(o.Provider) {
return true
}
return false
}
// SetProvider gets a reference to the given string and assigns it to the Provider field.
func (o *ProjectEdgeState) SetProvider(v string) {
o.Provider = &v
}
// GetReach returns the Reach field value if set, zero value otherwise.
func (o *ProjectEdgeState) GetReach() []string {
if o == nil || IsNil(o.Reach) {
var ret []string
return ret
}
return o.Reach
}
// GetReachOk returns a tuple with the Reach field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectEdgeState) GetReachOk() ([]string, bool) {
if o == nil || IsNil(o.Reach) {
return nil, false
}
return o.Reach, true
}
// HasReach returns a boolean if a field has been set.
func (o *ProjectEdgeState) HasReach() bool {
if o != nil && !IsNil(o.Reach) {
return true
}
return false
}
// SetReach gets a reference to the given []string and assigns it to the Reach field.
func (o *ProjectEdgeState) SetReach(v []string) {
o.Reach = v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ProjectEdgeState) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectEdgeState) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *ProjectEdgeState) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *ProjectEdgeState) SetStatus(v string) {
o.Status = &v
}
func (o ProjectEdgeState) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ProjectEdgeState) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Configured) {
toSerialize["configured"] = o.Configured
}
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
if !IsNil(o.Freshness) {
toSerialize["freshness"] = o.Freshness
}
if !IsNil(o.Policy) {
toSerialize["policy"] = o.Policy
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Reach) {
toSerialize["reach"] = o.Reach
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ProjectEdgeState) UnmarshalJSON(data []byte) (err error) {
varProjectEdgeState := _ProjectEdgeState{}
err = json.Unmarshal(data, &varProjectEdgeState)
if err != nil {
return err
}
*o = ProjectEdgeState(varProjectEdgeState)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "configured")
delete(additionalProperties, "error")
delete(additionalProperties, "freshness")
delete(additionalProperties, "policy")
delete(additionalProperties, "provider")
delete(additionalProperties, "reach")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableProjectEdgeState struct {
value *ProjectEdgeState
isSet bool
}
func (v NullableProjectEdgeState) Get() *ProjectEdgeState {
return v.value
}
func (v *NullableProjectEdgeState) Set(val *ProjectEdgeState) {
v.value = val
v.isSet = true
}
func (v NullableProjectEdgeState) IsSet() bool {
return v.isSet
}
func (v *NullableProjectEdgeState) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableProjectEdgeState(val *ProjectEdgeState) *NullableProjectEdgeState {
return &NullableProjectEdgeState{value: val, isSet: true}
}
func (v NullableProjectEdgeState) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableProjectEdgeState) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}