bunnyshell.com/sdk@v0.16.0/model_component_collection.go (about)

     1  /*
     2  API Bunnyshell Environments
     3  
     4  Interact with Bunnyshell Platform
     5  
     6  API version: 1.1.0
     7  Contact: osi+support@bunnyshell.com
     8  */
     9  
    10  // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
    11  
    12  package sdk
    13  
    14  import (
    15  	"encoding/json"
    16  )
    17  
    18  // checks if the ComponentCollection type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &ComponentCollection{}
    20  
    21  // ComponentCollection A service component represents either an application or a group of applications as a single unit
    22  type ComponentCollection struct {
    23  	// Service component identifier
    24  	Id *string `json:"id,omitempty"`
    25  	// Service component name
    26  	Name *string `json:"name,omitempty"`
    27  	// Service component cluster status
    28  	ClusterStatus *string `json:"clusterStatus,omitempty"`
    29  	// Service component operation status
    30  	OperationStatus *string `json:"operationStatus,omitempty"`
    31  	// Environment identifier.
    32  	Environment *string `json:"environment,omitempty"`
    33  }
    34  
    35  // NewComponentCollection instantiates a new ComponentCollection object
    36  // This constructor will assign default values to properties that have it defined,
    37  // and makes sure properties required by API are set, but the set of arguments
    38  // will change when the set of required properties is changed
    39  func NewComponentCollection() *ComponentCollection {
    40  	this := ComponentCollection{}
    41  	return &this
    42  }
    43  
    44  // NewComponentCollectionWithDefaults instantiates a new ComponentCollection object
    45  // This constructor will only assign default values to properties that have it defined,
    46  // but it doesn't guarantee that properties required by API are set
    47  func NewComponentCollectionWithDefaults() *ComponentCollection {
    48  	this := ComponentCollection{}
    49  	return &this
    50  }
    51  
    52  // GetId returns the Id field value if set, zero value otherwise.
    53  func (o *ComponentCollection) GetId() string {
    54  	if o == nil || IsNil(o.Id) {
    55  		var ret string
    56  		return ret
    57  	}
    58  	return *o.Id
    59  }
    60  
    61  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
    62  // and a boolean to check if the value has been set.
    63  func (o *ComponentCollection) GetIdOk() (*string, bool) {
    64  	if o == nil || IsNil(o.Id) {
    65  		return nil, false
    66  	}
    67  	return o.Id, true
    68  }
    69  
    70  // HasId returns a boolean if a field has been set.
    71  func (o *ComponentCollection) HasId() bool {
    72  	if o != nil && !IsNil(o.Id) {
    73  		return true
    74  	}
    75  
    76  	return false
    77  }
    78  
    79  // SetId gets a reference to the given string and assigns it to the Id field.
    80  func (o *ComponentCollection) SetId(v string) {
    81  	o.Id = &v
    82  }
    83  
    84  // GetName returns the Name field value if set, zero value otherwise.
    85  func (o *ComponentCollection) GetName() string {
    86  	if o == nil || IsNil(o.Name) {
    87  		var ret string
    88  		return ret
    89  	}
    90  	return *o.Name
    91  }
    92  
    93  // GetNameOk returns a tuple with the Name field value if set, nil otherwise
    94  // and a boolean to check if the value has been set.
    95  func (o *ComponentCollection) GetNameOk() (*string, bool) {
    96  	if o == nil || IsNil(o.Name) {
    97  		return nil, false
    98  	}
    99  	return o.Name, true
   100  }
   101  
   102  // HasName returns a boolean if a field has been set.
   103  func (o *ComponentCollection) HasName() bool {
   104  	if o != nil && !IsNil(o.Name) {
   105  		return true
   106  	}
   107  
   108  	return false
   109  }
   110  
   111  // SetName gets a reference to the given string and assigns it to the Name field.
   112  func (o *ComponentCollection) SetName(v string) {
   113  	o.Name = &v
   114  }
   115  
   116  // GetClusterStatus returns the ClusterStatus field value if set, zero value otherwise.
   117  func (o *ComponentCollection) GetClusterStatus() string {
   118  	if o == nil || IsNil(o.ClusterStatus) {
   119  		var ret string
   120  		return ret
   121  	}
   122  	return *o.ClusterStatus
   123  }
   124  
   125  // GetClusterStatusOk returns a tuple with the ClusterStatus field value if set, nil otherwise
   126  // and a boolean to check if the value has been set.
   127  func (o *ComponentCollection) GetClusterStatusOk() (*string, bool) {
   128  	if o == nil || IsNil(o.ClusterStatus) {
   129  		return nil, false
   130  	}
   131  	return o.ClusterStatus, true
   132  }
   133  
   134  // HasClusterStatus returns a boolean if a field has been set.
   135  func (o *ComponentCollection) HasClusterStatus() bool {
   136  	if o != nil && !IsNil(o.ClusterStatus) {
   137  		return true
   138  	}
   139  
   140  	return false
   141  }
   142  
   143  // SetClusterStatus gets a reference to the given string and assigns it to the ClusterStatus field.
   144  func (o *ComponentCollection) SetClusterStatus(v string) {
   145  	o.ClusterStatus = &v
   146  }
   147  
   148  // GetOperationStatus returns the OperationStatus field value if set, zero value otherwise.
   149  func (o *ComponentCollection) GetOperationStatus() string {
   150  	if o == nil || IsNil(o.OperationStatus) {
   151  		var ret string
   152  		return ret
   153  	}
   154  	return *o.OperationStatus
   155  }
   156  
   157  // GetOperationStatusOk returns a tuple with the OperationStatus field value if set, nil otherwise
   158  // and a boolean to check if the value has been set.
   159  func (o *ComponentCollection) GetOperationStatusOk() (*string, bool) {
   160  	if o == nil || IsNil(o.OperationStatus) {
   161  		return nil, false
   162  	}
   163  	return o.OperationStatus, true
   164  }
   165  
   166  // HasOperationStatus returns a boolean if a field has been set.
   167  func (o *ComponentCollection) HasOperationStatus() bool {
   168  	if o != nil && !IsNil(o.OperationStatus) {
   169  		return true
   170  	}
   171  
   172  	return false
   173  }
   174  
   175  // SetOperationStatus gets a reference to the given string and assigns it to the OperationStatus field.
   176  func (o *ComponentCollection) SetOperationStatus(v string) {
   177  	o.OperationStatus = &v
   178  }
   179  
   180  // GetEnvironment returns the Environment field value if set, zero value otherwise.
   181  func (o *ComponentCollection) GetEnvironment() string {
   182  	if o == nil || IsNil(o.Environment) {
   183  		var ret string
   184  		return ret
   185  	}
   186  	return *o.Environment
   187  }
   188  
   189  // GetEnvironmentOk returns a tuple with the Environment field value if set, nil otherwise
   190  // and a boolean to check if the value has been set.
   191  func (o *ComponentCollection) GetEnvironmentOk() (*string, bool) {
   192  	if o == nil || IsNil(o.Environment) {
   193  		return nil, false
   194  	}
   195  	return o.Environment, true
   196  }
   197  
   198  // HasEnvironment returns a boolean if a field has been set.
   199  func (o *ComponentCollection) HasEnvironment() bool {
   200  	if o != nil && !IsNil(o.Environment) {
   201  		return true
   202  	}
   203  
   204  	return false
   205  }
   206  
   207  // SetEnvironment gets a reference to the given string and assigns it to the Environment field.
   208  func (o *ComponentCollection) SetEnvironment(v string) {
   209  	o.Environment = &v
   210  }
   211  
   212  func (o ComponentCollection) MarshalJSON() ([]byte, error) {
   213  	toSerialize, err := o.ToMap()
   214  	if err != nil {
   215  		return []byte{}, err
   216  	}
   217  	return json.Marshal(toSerialize)
   218  }
   219  
   220  func (o ComponentCollection) ToMap() (map[string]interface{}, error) {
   221  	toSerialize := map[string]interface{}{}
   222  	if !IsNil(o.Id) {
   223  		toSerialize["id"] = o.Id
   224  	}
   225  	if !IsNil(o.Name) {
   226  		toSerialize["name"] = o.Name
   227  	}
   228  	if !IsNil(o.ClusterStatus) {
   229  		toSerialize["clusterStatus"] = o.ClusterStatus
   230  	}
   231  	if !IsNil(o.OperationStatus) {
   232  		toSerialize["operationStatus"] = o.OperationStatus
   233  	}
   234  	if !IsNil(o.Environment) {
   235  		toSerialize["environment"] = o.Environment
   236  	}
   237  	return toSerialize, nil
   238  }
   239  
   240  type NullableComponentCollection struct {
   241  	value *ComponentCollection
   242  	isSet bool
   243  }
   244  
   245  func (v NullableComponentCollection) Get() *ComponentCollection {
   246  	return v.value
   247  }
   248  
   249  func (v *NullableComponentCollection) Set(val *ComponentCollection) {
   250  	v.value = val
   251  	v.isSet = true
   252  }
   253  
   254  func (v NullableComponentCollection) IsSet() bool {
   255  	return v.isSet
   256  }
   257  
   258  func (v *NullableComponentCollection) Unset() {
   259  	v.value = nil
   260  	v.isSet = false
   261  }
   262  
   263  func NewNullableComponentCollection(val *ComponentCollection) *NullableComponentCollection {
   264  	return &NullableComponentCollection{value: val, isSet: true}
   265  }
   266  
   267  func (v NullableComponentCollection) MarshalJSON() ([]byte, error) {
   268  	return json.Marshal(v.value)
   269  }
   270  
   271  func (v *NullableComponentCollection) UnmarshalJSON(src []byte) error {
   272  	v.isSet = true
   273  	return json.Unmarshal(src, &v.value)
   274  }