Files
sdk/model_platform_app_view.go

725 lines
19 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 PlatformAppView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformAppView{}
// PlatformAppView struct for PlatformAppView
type PlatformAppView struct {
// service / CR name, e.g. iam
App *string `json:"app,omitempty"`
// always \"hanzo-k8s\"; cross-cluster federation is a follow-up phase
Cluster *string `json:"cluster,omitempty"`
// spec.image.tag — the tag the CR SAYS to run; anything but vX.Y.Z is red drift
DeclaredTag *string `json:"declaredTag,omitempty"`
// declared vs running vs latest as flags, plus their rolled-up severity
Drift *PlatformVerdict `json:"drift,omitempty"`
// status.endpoints the operator published for this service; empty until it reconciles
Endpoints []string `json:"endpoints,omitempty"`
// main|test|dev
Env *string `json:"env,omitempty"`
// green|yellow|red|\"\" (unknown)
Health *string `json:"health,omitempty"`
// <org>/<app>/<env>, e.g. hanzoai/iam/main
Id *string `json:"id,omitempty"`
// newest released tag; \"\" until the GH release reader lands, so \"stale\" cannot fire yet
LatestTag *string `json:"latestTag,omitempty"`
// namespace the row was scanned from: a platform one (hanzo, hanzo-testnet, …) or a tenant-<org>
Namespace *string `json:"namespace,omitempty"`
// image namespace, e.g. hanzoai
Org *string `json:"org,omitempty"`
// operator status.phase (Running/…)
Phase *string `json:"phase,omitempty"`
// spec.image.repository verbatim (ghcr.io/hanzoai/iam); Org and Repo are read off it
Registry *string `json:"registry,omitempty"`
// owner/repo, e.g. hanzoai/iam
Repo *string `json:"repo,omitempty"`
// operator spec.role (sql|kv|generic|ingress|…) or \"\" — the one declared class field
Role *string `json:"role,omitempty"`
// the tag the live Deployment actually runs; \"\" when unreadable — unknown, not a guess
RunningTag *string `json:"runningTag,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformAppView PlatformAppView
// NewPlatformAppView instantiates a new PlatformAppView 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 NewPlatformAppView() *PlatformAppView {
this := PlatformAppView{}
return &this
}
// NewPlatformAppViewWithDefaults instantiates a new PlatformAppView 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 NewPlatformAppViewWithDefaults() *PlatformAppView {
this := PlatformAppView{}
return &this
}
// GetApp returns the App field value if set, zero value otherwise.
func (o *PlatformAppView) GetApp() string {
if o == nil || IsNil(o.App) {
var ret string
return ret
}
return *o.App
}
// GetAppOk returns a tuple with the App field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetAppOk() (*string, bool) {
if o == nil || IsNil(o.App) {
return nil, false
}
return o.App, true
}
// HasApp returns a boolean if a field has been set.
func (o *PlatformAppView) HasApp() bool {
if o != nil && !IsNil(o.App) {
return true
}
return false
}
// SetApp gets a reference to the given string and assigns it to the App field.
func (o *PlatformAppView) SetApp(v string) {
o.App = &v
}
// GetCluster returns the Cluster field value if set, zero value otherwise.
func (o *PlatformAppView) GetCluster() string {
if o == nil || IsNil(o.Cluster) {
var ret string
return ret
}
return *o.Cluster
}
// GetClusterOk returns a tuple with the Cluster field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetClusterOk() (*string, bool) {
if o == nil || IsNil(o.Cluster) {
return nil, false
}
return o.Cluster, true
}
// HasCluster returns a boolean if a field has been set.
func (o *PlatformAppView) HasCluster() bool {
if o != nil && !IsNil(o.Cluster) {
return true
}
return false
}
// SetCluster gets a reference to the given string and assigns it to the Cluster field.
func (o *PlatformAppView) SetCluster(v string) {
o.Cluster = &v
}
// GetDeclaredTag returns the DeclaredTag field value if set, zero value otherwise.
func (o *PlatformAppView) GetDeclaredTag() string {
if o == nil || IsNil(o.DeclaredTag) {
var ret string
return ret
}
return *o.DeclaredTag
}
// GetDeclaredTagOk returns a tuple with the DeclaredTag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetDeclaredTagOk() (*string, bool) {
if o == nil || IsNil(o.DeclaredTag) {
return nil, false
}
return o.DeclaredTag, true
}
// HasDeclaredTag returns a boolean if a field has been set.
func (o *PlatformAppView) HasDeclaredTag() bool {
if o != nil && !IsNil(o.DeclaredTag) {
return true
}
return false
}
// SetDeclaredTag gets a reference to the given string and assigns it to the DeclaredTag field.
func (o *PlatformAppView) SetDeclaredTag(v string) {
o.DeclaredTag = &v
}
// GetDrift returns the Drift field value if set, zero value otherwise.
func (o *PlatformAppView) GetDrift() PlatformVerdict {
if o == nil || IsNil(o.Drift) {
var ret PlatformVerdict
return ret
}
return *o.Drift
}
// GetDriftOk returns a tuple with the Drift field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetDriftOk() (*PlatformVerdict, bool) {
if o == nil || IsNil(o.Drift) {
return nil, false
}
return o.Drift, true
}
// HasDrift returns a boolean if a field has been set.
func (o *PlatformAppView) HasDrift() bool {
if o != nil && !IsNil(o.Drift) {
return true
}
return false
}
// SetDrift gets a reference to the given PlatformVerdict and assigns it to the Drift field.
func (o *PlatformAppView) SetDrift(v PlatformVerdict) {
o.Drift = &v
}
// GetEndpoints returns the Endpoints field value if set, zero value otherwise.
func (o *PlatformAppView) GetEndpoints() []string {
if o == nil || IsNil(o.Endpoints) {
var ret []string
return ret
}
return o.Endpoints
}
// GetEndpointsOk returns a tuple with the Endpoints field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetEndpointsOk() ([]string, bool) {
if o == nil || IsNil(o.Endpoints) {
return nil, false
}
return o.Endpoints, true
}
// HasEndpoints returns a boolean if a field has been set.
func (o *PlatformAppView) HasEndpoints() bool {
if o != nil && !IsNil(o.Endpoints) {
return true
}
return false
}
// SetEndpoints gets a reference to the given []string and assigns it to the Endpoints field.
func (o *PlatformAppView) SetEndpoints(v []string) {
o.Endpoints = v
}
// GetEnv returns the Env field value if set, zero value otherwise.
func (o *PlatformAppView) GetEnv() string {
if o == nil || IsNil(o.Env) {
var ret string
return ret
}
return *o.Env
}
// GetEnvOk returns a tuple with the Env field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetEnvOk() (*string, bool) {
if o == nil || IsNil(o.Env) {
return nil, false
}
return o.Env, true
}
// HasEnv returns a boolean if a field has been set.
func (o *PlatformAppView) HasEnv() bool {
if o != nil && !IsNil(o.Env) {
return true
}
return false
}
// SetEnv gets a reference to the given string and assigns it to the Env field.
func (o *PlatformAppView) SetEnv(v string) {
o.Env = &v
}
// GetHealth returns the Health field value if set, zero value otherwise.
func (o *PlatformAppView) GetHealth() string {
if o == nil || IsNil(o.Health) {
var ret string
return ret
}
return *o.Health
}
// GetHealthOk returns a tuple with the Health field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetHealthOk() (*string, bool) {
if o == nil || IsNil(o.Health) {
return nil, false
}
return o.Health, true
}
// HasHealth returns a boolean if a field has been set.
func (o *PlatformAppView) HasHealth() bool {
if o != nil && !IsNil(o.Health) {
return true
}
return false
}
// SetHealth gets a reference to the given string and assigns it to the Health field.
func (o *PlatformAppView) SetHealth(v string) {
o.Health = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *PlatformAppView) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *PlatformAppView) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *PlatformAppView) SetId(v string) {
o.Id = &v
}
// GetLatestTag returns the LatestTag field value if set, zero value otherwise.
func (o *PlatformAppView) GetLatestTag() string {
if o == nil || IsNil(o.LatestTag) {
var ret string
return ret
}
return *o.LatestTag
}
// GetLatestTagOk returns a tuple with the LatestTag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetLatestTagOk() (*string, bool) {
if o == nil || IsNil(o.LatestTag) {
return nil, false
}
return o.LatestTag, true
}
// HasLatestTag returns a boolean if a field has been set.
func (o *PlatformAppView) HasLatestTag() bool {
if o != nil && !IsNil(o.LatestTag) {
return true
}
return false
}
// SetLatestTag gets a reference to the given string and assigns it to the LatestTag field.
func (o *PlatformAppView) SetLatestTag(v string) {
o.LatestTag = &v
}
// GetNamespace returns the Namespace field value if set, zero value otherwise.
func (o *PlatformAppView) GetNamespace() string {
if o == nil || IsNil(o.Namespace) {
var ret string
return ret
}
return *o.Namespace
}
// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetNamespaceOk() (*string, bool) {
if o == nil || IsNil(o.Namespace) {
return nil, false
}
return o.Namespace, true
}
// HasNamespace returns a boolean if a field has been set.
func (o *PlatformAppView) HasNamespace() bool {
if o != nil && !IsNil(o.Namespace) {
return true
}
return false
}
// SetNamespace gets a reference to the given string and assigns it to the Namespace field.
func (o *PlatformAppView) SetNamespace(v string) {
o.Namespace = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *PlatformAppView) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *PlatformAppView) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *PlatformAppView) SetOrg(v string) {
o.Org = &v
}
// GetPhase returns the Phase field value if set, zero value otherwise.
func (o *PlatformAppView) GetPhase() string {
if o == nil || IsNil(o.Phase) {
var ret string
return ret
}
return *o.Phase
}
// GetPhaseOk returns a tuple with the Phase field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetPhaseOk() (*string, bool) {
if o == nil || IsNil(o.Phase) {
return nil, false
}
return o.Phase, true
}
// HasPhase returns a boolean if a field has been set.
func (o *PlatformAppView) HasPhase() bool {
if o != nil && !IsNil(o.Phase) {
return true
}
return false
}
// SetPhase gets a reference to the given string and assigns it to the Phase field.
func (o *PlatformAppView) SetPhase(v string) {
o.Phase = &v
}
// GetRegistry returns the Registry field value if set, zero value otherwise.
func (o *PlatformAppView) GetRegistry() string {
if o == nil || IsNil(o.Registry) {
var ret string
return ret
}
return *o.Registry
}
// GetRegistryOk returns a tuple with the Registry field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetRegistryOk() (*string, bool) {
if o == nil || IsNil(o.Registry) {
return nil, false
}
return o.Registry, true
}
// HasRegistry returns a boolean if a field has been set.
func (o *PlatformAppView) HasRegistry() bool {
if o != nil && !IsNil(o.Registry) {
return true
}
return false
}
// SetRegistry gets a reference to the given string and assigns it to the Registry field.
func (o *PlatformAppView) SetRegistry(v string) {
o.Registry = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *PlatformAppView) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *PlatformAppView) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *PlatformAppView) SetRepo(v string) {
o.Repo = &v
}
// GetRole returns the Role field value if set, zero value otherwise.
func (o *PlatformAppView) GetRole() string {
if o == nil || IsNil(o.Role) {
var ret string
return ret
}
return *o.Role
}
// GetRoleOk returns a tuple with the Role field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetRoleOk() (*string, bool) {
if o == nil || IsNil(o.Role) {
return nil, false
}
return o.Role, true
}
// HasRole returns a boolean if a field has been set.
func (o *PlatformAppView) HasRole() bool {
if o != nil && !IsNil(o.Role) {
return true
}
return false
}
// SetRole gets a reference to the given string and assigns it to the Role field.
func (o *PlatformAppView) SetRole(v string) {
o.Role = &v
}
// GetRunningTag returns the RunningTag field value if set, zero value otherwise.
func (o *PlatformAppView) GetRunningTag() string {
if o == nil || IsNil(o.RunningTag) {
var ret string
return ret
}
return *o.RunningTag
}
// GetRunningTagOk returns a tuple with the RunningTag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformAppView) GetRunningTagOk() (*string, bool) {
if o == nil || IsNil(o.RunningTag) {
return nil, false
}
return o.RunningTag, true
}
// HasRunningTag returns a boolean if a field has been set.
func (o *PlatformAppView) HasRunningTag() bool {
if o != nil && !IsNil(o.RunningTag) {
return true
}
return false
}
// SetRunningTag gets a reference to the given string and assigns it to the RunningTag field.
func (o *PlatformAppView) SetRunningTag(v string) {
o.RunningTag = &v
}
func (o PlatformAppView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformAppView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.App) {
toSerialize["app"] = o.App
}
if !IsNil(o.Cluster) {
toSerialize["cluster"] = o.Cluster
}
if !IsNil(o.DeclaredTag) {
toSerialize["declaredTag"] = o.DeclaredTag
}
if !IsNil(o.Drift) {
toSerialize["drift"] = o.Drift
}
if !IsNil(o.Endpoints) {
toSerialize["endpoints"] = o.Endpoints
}
if !IsNil(o.Env) {
toSerialize["env"] = o.Env
}
if !IsNil(o.Health) {
toSerialize["health"] = o.Health
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.LatestTag) {
toSerialize["latestTag"] = o.LatestTag
}
if !IsNil(o.Namespace) {
toSerialize["namespace"] = o.Namespace
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.Phase) {
toSerialize["phase"] = o.Phase
}
if !IsNil(o.Registry) {
toSerialize["registry"] = o.Registry
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Role) {
toSerialize["role"] = o.Role
}
if !IsNil(o.RunningTag) {
toSerialize["runningTag"] = o.RunningTag
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformAppView) UnmarshalJSON(data []byte) (err error) {
varPlatformAppView := _PlatformAppView{}
err = json.Unmarshal(data, &varPlatformAppView)
if err != nil {
return err
}
*o = PlatformAppView(varPlatformAppView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "app")
delete(additionalProperties, "cluster")
delete(additionalProperties, "declaredTag")
delete(additionalProperties, "drift")
delete(additionalProperties, "endpoints")
delete(additionalProperties, "env")
delete(additionalProperties, "health")
delete(additionalProperties, "id")
delete(additionalProperties, "latestTag")
delete(additionalProperties, "namespace")
delete(additionalProperties, "org")
delete(additionalProperties, "phase")
delete(additionalProperties, "registry")
delete(additionalProperties, "repo")
delete(additionalProperties, "role")
delete(additionalProperties, "runningTag")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformAppView struct {
value *PlatformAppView
isSet bool
}
func (v NullablePlatformAppView) Get() *PlatformAppView {
return v.value
}
func (v *NullablePlatformAppView) Set(val *PlatformAppView) {
v.value = val
v.isSet = true
}
func (v NullablePlatformAppView) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformAppView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformAppView(val *PlatformAppView) *NullablePlatformAppView {
return &NullablePlatformAppView{value: val, isSet: true}
}
func (v NullablePlatformAppView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformAppView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}