mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
383 lines
10 KiB
Go
383 lines
10 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 PlatformProject type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformProject{}
|
|
|
|
// PlatformProject struct for PlatformProject
|
|
type PlatformProject struct {
|
|
// Apps is how many declarations name the project.
|
|
Apps *int64 `json:"apps,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"`
|
|
// 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"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformProject PlatformProject
|
|
|
|
// NewPlatformProject instantiates a new PlatformProject 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 NewPlatformProject() *PlatformProject {
|
|
this := PlatformProject{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformProjectWithDefaults instantiates a new PlatformProject 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 NewPlatformProjectWithDefaults() *PlatformProject {
|
|
this := PlatformProject{}
|
|
return &this
|
|
}
|
|
|
|
// GetApps returns the Apps field value if set, zero value otherwise.
|
|
func (o *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) SetApps(v int64) {
|
|
o.Apps = &v
|
|
}
|
|
|
|
// GetDrift returns the Drift field value if set, zero value otherwise.
|
|
func (o *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) SetDrift(v PlatformDriftTally) {
|
|
o.Drift = &v
|
|
}
|
|
|
|
// GetHealth returns the Health field value if set, zero value otherwise.
|
|
func (o *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) SetHealth(v PlatformHealthTally) {
|
|
o.Health = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetNamespaces returns the Namespaces field value if set, zero value otherwise.
|
|
func (o *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) SetNamespaces(v []string) {
|
|
o.Namespaces = v
|
|
}
|
|
|
|
// GetOrg returns the Org field value if set, zero value otherwise.
|
|
func (o *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) SetOrg(v string) {
|
|
o.Org = &v
|
|
}
|
|
|
|
// GetSync returns the Sync field value if set, zero value otherwise.
|
|
func (o *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) 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 *PlatformProject) SetSync(v PlatformSyncTally) {
|
|
o.Sync = &v
|
|
}
|
|
|
|
func (o PlatformProject) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformProject) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Apps) {
|
|
toSerialize["apps"] = o.Apps
|
|
}
|
|
if !IsNil(o.Drift) {
|
|
toSerialize["drift"] = o.Drift
|
|
}
|
|
if !IsNil(o.Health) {
|
|
toSerialize["health"] = o.Health
|
|
}
|
|
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
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PlatformProject) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformProject := _PlatformProject{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformProject)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformProject(varPlatformProject)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "apps")
|
|
delete(additionalProperties, "drift")
|
|
delete(additionalProperties, "health")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "namespaces")
|
|
delete(additionalProperties, "org")
|
|
delete(additionalProperties, "sync")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformProject struct {
|
|
value *PlatformProject
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformProject) Get() *PlatformProject {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformProject) Set(val *PlatformProject) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformProject) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformProject) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformProject(val *PlatformProject) *NullablePlatformProject {
|
|
return &NullablePlatformProject{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformProject) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformProject) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|