mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
535 lines
15 KiB
Go
535 lines
15 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 PlatformProjectView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformProjectView{}
|
|
|
|
// PlatformProjectView struct for PlatformProjectView
|
|
type PlatformProjectView struct {
|
|
// Apps is how many declarations name the project.
|
|
Apps *int64 `json:"apps,omitempty"`
|
|
// CD says why the reconciliation columns are missing, when they are.
|
|
CdUnavailable *PlatformUnreadable `json:"cdUnavailable,omitempty"`
|
|
// Cluster says why the running columns are missing, when they are.
|
|
ClusterUnavailable *PlatformUnreadable `json:"clusterUnavailable,omitempty"`
|
|
// Drift counts its apps by drift severity.
|
|
Drift *PlatformDriftTally `json:"drift,omitempty"`
|
|
// Health counts its apps by CD's health verdict.
|
|
Health *PlatformHealthTally `json:"health,omitempty"`
|
|
// Members are the project's apps, sorted by namespace then name.
|
|
Members []PlatformProjectApp `json:"members,omitempty"`
|
|
// Name is the project, as the values files spell it in `partOf`.
|
|
Name *string `json:"name,omitempty"`
|
|
// Namespaces are the namespaces its apps deploy into, sorted.
|
|
Namespaces []string `json:"namespaces,omitempty"`
|
|
// Org is the organization that owns the project. Absent for the platform's own projects, whose apps live in the platform's directories.
|
|
Org *string `json:"org,omitempty"`
|
|
// Sync counts its apps by CD's sync verdict.
|
|
Sync *PlatformSyncTally `json:"sync,omitempty"`
|
|
// Unreadable are the values files in the owner's scope that do not parse, any of which may name this project. Absent when every file parsed.
|
|
Unreadable []PlatformUnreadableFile `json:"unreadable,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformProjectView PlatformProjectView
|
|
|
|
// NewPlatformProjectView instantiates a new PlatformProjectView 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 NewPlatformProjectView() *PlatformProjectView {
|
|
this := PlatformProjectView{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformProjectViewWithDefaults instantiates a new PlatformProjectView 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 NewPlatformProjectViewWithDefaults() *PlatformProjectView {
|
|
this := PlatformProjectView{}
|
|
return &this
|
|
}
|
|
|
|
// GetApps returns the Apps field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetApps() int64 {
|
|
if o == nil || IsNil(o.Apps) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Apps
|
|
}
|
|
|
|
// GetAppsOk returns a tuple with the Apps field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectView) GetAppsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Apps) {
|
|
return nil, false
|
|
}
|
|
return o.Apps, true
|
|
}
|
|
|
|
// HasApps returns a boolean if a field has been set.
|
|
func (o *PlatformProjectView) HasApps() bool {
|
|
if o != nil && !IsNil(o.Apps) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetApps gets a reference to the given int64 and assigns it to the Apps field.
|
|
func (o *PlatformProjectView) SetApps(v int64) {
|
|
o.Apps = &v
|
|
}
|
|
|
|
// GetCdUnavailable returns the CdUnavailable field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetCdUnavailable() PlatformUnreadable {
|
|
if o == nil || IsNil(o.CdUnavailable) {
|
|
var ret PlatformUnreadable
|
|
return ret
|
|
}
|
|
return *o.CdUnavailable
|
|
}
|
|
|
|
// GetCdUnavailableOk returns a tuple with the CdUnavailable field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectView) GetCdUnavailableOk() (*PlatformUnreadable, bool) {
|
|
if o == nil || IsNil(o.CdUnavailable) {
|
|
return nil, false
|
|
}
|
|
return o.CdUnavailable, true
|
|
}
|
|
|
|
// HasCdUnavailable returns a boolean if a field has been set.
|
|
func (o *PlatformProjectView) HasCdUnavailable() bool {
|
|
if o != nil && !IsNil(o.CdUnavailable) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCdUnavailable gets a reference to the given PlatformUnreadable and assigns it to the CdUnavailable field.
|
|
func (o *PlatformProjectView) SetCdUnavailable(v PlatformUnreadable) {
|
|
o.CdUnavailable = &v
|
|
}
|
|
|
|
// GetClusterUnavailable returns the ClusterUnavailable field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetClusterUnavailable() PlatformUnreadable {
|
|
if o == nil || IsNil(o.ClusterUnavailable) {
|
|
var ret PlatformUnreadable
|
|
return ret
|
|
}
|
|
return *o.ClusterUnavailable
|
|
}
|
|
|
|
// GetClusterUnavailableOk returns a tuple with the ClusterUnavailable field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectView) GetClusterUnavailableOk() (*PlatformUnreadable, bool) {
|
|
if o == nil || IsNil(o.ClusterUnavailable) {
|
|
return nil, false
|
|
}
|
|
return o.ClusterUnavailable, true
|
|
}
|
|
|
|
// HasClusterUnavailable returns a boolean if a field has been set.
|
|
func (o *PlatformProjectView) HasClusterUnavailable() bool {
|
|
if o != nil && !IsNil(o.ClusterUnavailable) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetClusterUnavailable gets a reference to the given PlatformUnreadable and assigns it to the ClusterUnavailable field.
|
|
func (o *PlatformProjectView) SetClusterUnavailable(v PlatformUnreadable) {
|
|
o.ClusterUnavailable = &v
|
|
}
|
|
|
|
// GetDrift returns the Drift field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetDrift() PlatformDriftTally {
|
|
if o == nil || IsNil(o.Drift) {
|
|
var ret PlatformDriftTally
|
|
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 *PlatformProjectView) GetDriftOk() (*PlatformDriftTally, 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 *PlatformProjectView) HasDrift() bool {
|
|
if o != nil && !IsNil(o.Drift) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDrift gets a reference to the given PlatformDriftTally and assigns it to the Drift field.
|
|
func (o *PlatformProjectView) SetDrift(v PlatformDriftTally) {
|
|
o.Drift = &v
|
|
}
|
|
|
|
// GetHealth returns the Health field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetHealth() PlatformHealthTally {
|
|
if o == nil || IsNil(o.Health) {
|
|
var ret PlatformHealthTally
|
|
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 *PlatformProjectView) GetHealthOk() (*PlatformHealthTally, 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 *PlatformProjectView) HasHealth() bool {
|
|
if o != nil && !IsNil(o.Health) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHealth gets a reference to the given PlatformHealthTally and assigns it to the Health field.
|
|
func (o *PlatformProjectView) SetHealth(v PlatformHealthTally) {
|
|
o.Health = &v
|
|
}
|
|
|
|
// GetMembers returns the Members field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetMembers() []PlatformProjectApp {
|
|
if o == nil || IsNil(o.Members) {
|
|
var ret []PlatformProjectApp
|
|
return ret
|
|
}
|
|
return o.Members
|
|
}
|
|
|
|
// GetMembersOk returns a tuple with the Members field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectView) GetMembersOk() ([]PlatformProjectApp, bool) {
|
|
if o == nil || IsNil(o.Members) {
|
|
return nil, false
|
|
}
|
|
return o.Members, true
|
|
}
|
|
|
|
// HasMembers returns a boolean if a field has been set.
|
|
func (o *PlatformProjectView) HasMembers() bool {
|
|
if o != nil && !IsNil(o.Members) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMembers gets a reference to the given []PlatformProjectApp and assigns it to the Members field.
|
|
func (o *PlatformProjectView) SetMembers(v []PlatformProjectApp) {
|
|
o.Members = v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectView) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *PlatformProjectView) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *PlatformProjectView) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetNamespaces returns the Namespaces field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetNamespaces() []string {
|
|
if o == nil || IsNil(o.Namespaces) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Namespaces
|
|
}
|
|
|
|
// GetNamespacesOk returns a tuple with the Namespaces field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectView) GetNamespacesOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Namespaces) {
|
|
return nil, false
|
|
}
|
|
return o.Namespaces, true
|
|
}
|
|
|
|
// HasNamespaces returns a boolean if a field has been set.
|
|
func (o *PlatformProjectView) HasNamespaces() bool {
|
|
if o != nil && !IsNil(o.Namespaces) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNamespaces gets a reference to the given []string and assigns it to the Namespaces field.
|
|
func (o *PlatformProjectView) SetNamespaces(v []string) {
|
|
o.Namespaces = v
|
|
}
|
|
|
|
// GetOrg returns the Org field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) 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 *PlatformProjectView) 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 *PlatformProjectView) 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 *PlatformProjectView) SetOrg(v string) {
|
|
o.Org = &v
|
|
}
|
|
|
|
// GetSync returns the Sync field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetSync() PlatformSyncTally {
|
|
if o == nil || IsNil(o.Sync) {
|
|
var ret PlatformSyncTally
|
|
return ret
|
|
}
|
|
return *o.Sync
|
|
}
|
|
|
|
// GetSyncOk returns a tuple with the Sync field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectView) GetSyncOk() (*PlatformSyncTally, bool) {
|
|
if o == nil || IsNil(o.Sync) {
|
|
return nil, false
|
|
}
|
|
return o.Sync, true
|
|
}
|
|
|
|
// HasSync returns a boolean if a field has been set.
|
|
func (o *PlatformProjectView) HasSync() bool {
|
|
if o != nil && !IsNil(o.Sync) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSync gets a reference to the given PlatformSyncTally and assigns it to the Sync field.
|
|
func (o *PlatformProjectView) SetSync(v PlatformSyncTally) {
|
|
o.Sync = &v
|
|
}
|
|
|
|
// GetUnreadable returns the Unreadable field value if set, zero value otherwise.
|
|
func (o *PlatformProjectView) GetUnreadable() []PlatformUnreadableFile {
|
|
if o == nil || IsNil(o.Unreadable) {
|
|
var ret []PlatformUnreadableFile
|
|
return ret
|
|
}
|
|
return o.Unreadable
|
|
}
|
|
|
|
// GetUnreadableOk returns a tuple with the Unreadable field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformProjectView) GetUnreadableOk() ([]PlatformUnreadableFile, bool) {
|
|
if o == nil || IsNil(o.Unreadable) {
|
|
return nil, false
|
|
}
|
|
return o.Unreadable, true
|
|
}
|
|
|
|
// HasUnreadable returns a boolean if a field has been set.
|
|
func (o *PlatformProjectView) HasUnreadable() bool {
|
|
if o != nil && !IsNil(o.Unreadable) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUnreadable gets a reference to the given []PlatformUnreadableFile and assigns it to the Unreadable field.
|
|
func (o *PlatformProjectView) SetUnreadable(v []PlatformUnreadableFile) {
|
|
o.Unreadable = v
|
|
}
|
|
|
|
func (o PlatformProjectView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformProjectView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Apps) {
|
|
toSerialize["apps"] = o.Apps
|
|
}
|
|
if !IsNil(o.CdUnavailable) {
|
|
toSerialize["cdUnavailable"] = o.CdUnavailable
|
|
}
|
|
if !IsNil(o.ClusterUnavailable) {
|
|
toSerialize["clusterUnavailable"] = o.ClusterUnavailable
|
|
}
|
|
if !IsNil(o.Drift) {
|
|
toSerialize["drift"] = o.Drift
|
|
}
|
|
if !IsNil(o.Health) {
|
|
toSerialize["health"] = o.Health
|
|
}
|
|
if !IsNil(o.Members) {
|
|
toSerialize["members"] = o.Members
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Namespaces) {
|
|
toSerialize["namespaces"] = o.Namespaces
|
|
}
|
|
if !IsNil(o.Org) {
|
|
toSerialize["org"] = o.Org
|
|
}
|
|
if !IsNil(o.Sync) {
|
|
toSerialize["sync"] = o.Sync
|
|
}
|
|
if !IsNil(o.Unreadable) {
|
|
toSerialize["unreadable"] = o.Unreadable
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PlatformProjectView) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformProjectView := _PlatformProjectView{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformProjectView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformProjectView(varPlatformProjectView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "apps")
|
|
delete(additionalProperties, "cdUnavailable")
|
|
delete(additionalProperties, "clusterUnavailable")
|
|
delete(additionalProperties, "drift")
|
|
delete(additionalProperties, "health")
|
|
delete(additionalProperties, "members")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "namespaces")
|
|
delete(additionalProperties, "org")
|
|
delete(additionalProperties, "sync")
|
|
delete(additionalProperties, "unreadable")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformProjectView struct {
|
|
value *PlatformProjectView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformProjectView) Get() *PlatformProjectView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformProjectView) Set(val *PlatformProjectView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformProjectView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformProjectView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformProjectView(val *PlatformProjectView) *NullablePlatformProjectView {
|
|
return &NullablePlatformProjectView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformProjectView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformProjectView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|