Files
sdk/model_application_view.go

413 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 ApplicationView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ApplicationView{}
// ApplicationView struct for ApplicationView
type ApplicationView struct {
CreatedTime *string `json:"createdTime,omitempty"`
Credentials []EnvVariable `json:"credentials,omitempty"`
Deployments []DeploymentDetail `json:"deployments,omitempty"`
Events []ApplicationEvent `json:"events,omitempty"`
Metrics *ResourceMetrics `json:"metrics,omitempty"`
Namespace *string `json:"namespace,omitempty"`
Services []ServiceDetail `json:"services,omitempty"`
Status *string `json:"status,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ApplicationView ApplicationView
// NewApplicationView instantiates a new ApplicationView 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 NewApplicationView() *ApplicationView {
this := ApplicationView{}
return &this
}
// NewApplicationViewWithDefaults instantiates a new ApplicationView 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 NewApplicationViewWithDefaults() *ApplicationView {
this := ApplicationView{}
return &this
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *ApplicationView) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationView) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *ApplicationView) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *ApplicationView) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetCredentials returns the Credentials field value if set, zero value otherwise.
func (o *ApplicationView) GetCredentials() []EnvVariable {
if o == nil || IsNil(o.Credentials) {
var ret []EnvVariable
return ret
}
return o.Credentials
}
// GetCredentialsOk returns a tuple with the Credentials field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationView) GetCredentialsOk() ([]EnvVariable, bool) {
if o == nil || IsNil(o.Credentials) {
return nil, false
}
return o.Credentials, true
}
// HasCredentials returns a boolean if a field has been set.
func (o *ApplicationView) HasCredentials() bool {
if o != nil && !IsNil(o.Credentials) {
return true
}
return false
}
// SetCredentials gets a reference to the given []EnvVariable and assigns it to the Credentials field.
func (o *ApplicationView) SetCredentials(v []EnvVariable) {
o.Credentials = v
}
// GetDeployments returns the Deployments field value if set, zero value otherwise.
func (o *ApplicationView) GetDeployments() []DeploymentDetail {
if o == nil || IsNil(o.Deployments) {
var ret []DeploymentDetail
return ret
}
return o.Deployments
}
// GetDeploymentsOk returns a tuple with the Deployments field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationView) GetDeploymentsOk() ([]DeploymentDetail, bool) {
if o == nil || IsNil(o.Deployments) {
return nil, false
}
return o.Deployments, true
}
// HasDeployments returns a boolean if a field has been set.
func (o *ApplicationView) HasDeployments() bool {
if o != nil && !IsNil(o.Deployments) {
return true
}
return false
}
// SetDeployments gets a reference to the given []DeploymentDetail and assigns it to the Deployments field.
func (o *ApplicationView) SetDeployments(v []DeploymentDetail) {
o.Deployments = v
}
// GetEvents returns the Events field value if set, zero value otherwise.
func (o *ApplicationView) GetEvents() []ApplicationEvent {
if o == nil || IsNil(o.Events) {
var ret []ApplicationEvent
return ret
}
return o.Events
}
// GetEventsOk returns a tuple with the Events field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationView) GetEventsOk() ([]ApplicationEvent, bool) {
if o == nil || IsNil(o.Events) {
return nil, false
}
return o.Events, true
}
// HasEvents returns a boolean if a field has been set.
func (o *ApplicationView) HasEvents() bool {
if o != nil && !IsNil(o.Events) {
return true
}
return false
}
// SetEvents gets a reference to the given []ApplicationEvent and assigns it to the Events field.
func (o *ApplicationView) SetEvents(v []ApplicationEvent) {
o.Events = v
}
// GetMetrics returns the Metrics field value if set, zero value otherwise.
func (o *ApplicationView) GetMetrics() ResourceMetrics {
if o == nil || IsNil(o.Metrics) {
var ret ResourceMetrics
return ret
}
return *o.Metrics
}
// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationView) GetMetricsOk() (*ResourceMetrics, bool) {
if o == nil || IsNil(o.Metrics) {
return nil, false
}
return o.Metrics, true
}
// HasMetrics returns a boolean if a field has been set.
func (o *ApplicationView) HasMetrics() bool {
if o != nil && !IsNil(o.Metrics) {
return true
}
return false
}
// SetMetrics gets a reference to the given ResourceMetrics and assigns it to the Metrics field.
func (o *ApplicationView) SetMetrics(v ResourceMetrics) {
o.Metrics = &v
}
// GetNamespace returns the Namespace field value if set, zero value otherwise.
func (o *ApplicationView) 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 *ApplicationView) 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 *ApplicationView) 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 *ApplicationView) SetNamespace(v string) {
o.Namespace = &v
}
// GetServices returns the Services field value if set, zero value otherwise.
func (o *ApplicationView) GetServices() []ServiceDetail {
if o == nil || IsNil(o.Services) {
var ret []ServiceDetail
return ret
}
return o.Services
}
// GetServicesOk returns a tuple with the Services field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApplicationView) GetServicesOk() ([]ServiceDetail, bool) {
if o == nil || IsNil(o.Services) {
return nil, false
}
return o.Services, true
}
// HasServices returns a boolean if a field has been set.
func (o *ApplicationView) HasServices() bool {
if o != nil && !IsNil(o.Services) {
return true
}
return false
}
// SetServices gets a reference to the given []ServiceDetail and assigns it to the Services field.
func (o *ApplicationView) SetServices(v []ServiceDetail) {
o.Services = v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *ApplicationView) 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 *ApplicationView) 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 *ApplicationView) 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 *ApplicationView) SetStatus(v string) {
o.Status = &v
}
func (o ApplicationView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ApplicationView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.Credentials) {
toSerialize["credentials"] = o.Credentials
}
if !IsNil(o.Deployments) {
toSerialize["deployments"] = o.Deployments
}
if !IsNil(o.Events) {
toSerialize["events"] = o.Events
}
if !IsNil(o.Metrics) {
toSerialize["metrics"] = o.Metrics
}
if !IsNil(o.Namespace) {
toSerialize["namespace"] = o.Namespace
}
if !IsNil(o.Services) {
toSerialize["services"] = o.Services
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ApplicationView) UnmarshalJSON(data []byte) (err error) {
varApplicationView := _ApplicationView{}
err = json.Unmarshal(data, &varApplicationView)
if err != nil {
return err
}
*o = ApplicationView(varApplicationView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "createdTime")
delete(additionalProperties, "credentials")
delete(additionalProperties, "deployments")
delete(additionalProperties, "events")
delete(additionalProperties, "metrics")
delete(additionalProperties, "namespace")
delete(additionalProperties, "services")
delete(additionalProperties, "status")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableApplicationView struct {
value *ApplicationView
isSet bool
}
func (v NullableApplicationView) Get() *ApplicationView {
return v.value
}
func (v *NullableApplicationView) Set(val *ApplicationView) {
v.value = val
v.isSet = true
}
func (v NullableApplicationView) IsSet() bool {
return v.isSet
}
func (v *NullableApplicationView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableApplicationView(val *ApplicationView) *NullableApplicationView {
return &NullableApplicationView{value: val, isSet: true}
}
func (v NullableApplicationView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableApplicationView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}