bunnyshell.com/sdk@v0.16.0/model_build_settings_item.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 BuildSettingsItem type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &BuildSettingsItem{}
    20  
    21  // BuildSettingsItem struct for BuildSettingsItem
    22  type BuildSettingsItem struct {
    23  	// Use the managed container registry.
    24  	UseManagedRegistry *bool `json:"useManagedRegistry,omitempty"`
    25  	// The Container Registry used for the built images.
    26  	RegistryIntegration NullableString `json:"registryIntegration,omitempty"`
    27  	// Use the managed builds Cluster.
    28  	UseManagedCluster *bool `json:"useManagedCluster,omitempty"`
    29  	// The Kubernetes integration cluster used for the image builds.
    30  	KubernetesIntegration NullableString `json:"kubernetesIntegration,omitempty"`
    31  	// The CPU allocated for the build runner.
    32  	Cpu NullableString `json:"cpu,omitempty"`
    33  	// The memory allocated for the build runner.
    34  	Memory NullableInt32 `json:"memory,omitempty"`
    35  	// The latest status of the build settings.
    36  	LastStatus NullableString `json:"lastStatus,omitempty"`
    37  	// The latest status of the build settings.
    38  	LastError NullableString `json:"lastError,omitempty"`
    39  }
    40  
    41  // NewBuildSettingsItem instantiates a new BuildSettingsItem object
    42  // This constructor will assign default values to properties that have it defined,
    43  // and makes sure properties required by API are set, but the set of arguments
    44  // will change when the set of required properties is changed
    45  func NewBuildSettingsItem() *BuildSettingsItem {
    46  	this := BuildSettingsItem{}
    47  	return &this
    48  }
    49  
    50  // NewBuildSettingsItemWithDefaults instantiates a new BuildSettingsItem object
    51  // This constructor will only assign default values to properties that have it defined,
    52  // but it doesn't guarantee that properties required by API are set
    53  func NewBuildSettingsItemWithDefaults() *BuildSettingsItem {
    54  	this := BuildSettingsItem{}
    55  	return &this
    56  }
    57  
    58  // GetUseManagedRegistry returns the UseManagedRegistry field value if set, zero value otherwise.
    59  func (o *BuildSettingsItem) GetUseManagedRegistry() bool {
    60  	if o == nil || IsNil(o.UseManagedRegistry) {
    61  		var ret bool
    62  		return ret
    63  	}
    64  	return *o.UseManagedRegistry
    65  }
    66  
    67  // GetUseManagedRegistryOk returns a tuple with the UseManagedRegistry field value if set, nil otherwise
    68  // and a boolean to check if the value has been set.
    69  func (o *BuildSettingsItem) GetUseManagedRegistryOk() (*bool, bool) {
    70  	if o == nil || IsNil(o.UseManagedRegistry) {
    71  		return nil, false
    72  	}
    73  	return o.UseManagedRegistry, true
    74  }
    75  
    76  // HasUseManagedRegistry returns a boolean if a field has been set.
    77  func (o *BuildSettingsItem) HasUseManagedRegistry() bool {
    78  	if o != nil && !IsNil(o.UseManagedRegistry) {
    79  		return true
    80  	}
    81  
    82  	return false
    83  }
    84  
    85  // SetUseManagedRegistry gets a reference to the given bool and assigns it to the UseManagedRegistry field.
    86  func (o *BuildSettingsItem) SetUseManagedRegistry(v bool) {
    87  	o.UseManagedRegistry = &v
    88  }
    89  
    90  // GetRegistryIntegration returns the RegistryIntegration field value if set, zero value otherwise (both if not set or set to explicit null).
    91  func (o *BuildSettingsItem) GetRegistryIntegration() string {
    92  	if o == nil || IsNil(o.RegistryIntegration.Get()) {
    93  		var ret string
    94  		return ret
    95  	}
    96  	return *o.RegistryIntegration.Get()
    97  }
    98  
    99  // GetRegistryIntegrationOk returns a tuple with the RegistryIntegration field value if set, nil otherwise
   100  // and a boolean to check if the value has been set.
   101  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   102  func (o *BuildSettingsItem) GetRegistryIntegrationOk() (*string, bool) {
   103  	if o == nil {
   104  		return nil, false
   105  	}
   106  	return o.RegistryIntegration.Get(), o.RegistryIntegration.IsSet()
   107  }
   108  
   109  // HasRegistryIntegration returns a boolean if a field has been set.
   110  func (o *BuildSettingsItem) HasRegistryIntegration() bool {
   111  	if o != nil && o.RegistryIntegration.IsSet() {
   112  		return true
   113  	}
   114  
   115  	return false
   116  }
   117  
   118  // SetRegistryIntegration gets a reference to the given NullableString and assigns it to the RegistryIntegration field.
   119  func (o *BuildSettingsItem) SetRegistryIntegration(v string) {
   120  	o.RegistryIntegration.Set(&v)
   121  }
   122  
   123  // SetRegistryIntegrationNil sets the value for RegistryIntegration to be an explicit nil
   124  func (o *BuildSettingsItem) SetRegistryIntegrationNil() {
   125  	o.RegistryIntegration.Set(nil)
   126  }
   127  
   128  // UnsetRegistryIntegration ensures that no value is present for RegistryIntegration, not even an explicit nil
   129  func (o *BuildSettingsItem) UnsetRegistryIntegration() {
   130  	o.RegistryIntegration.Unset()
   131  }
   132  
   133  // GetUseManagedCluster returns the UseManagedCluster field value if set, zero value otherwise.
   134  func (o *BuildSettingsItem) GetUseManagedCluster() bool {
   135  	if o == nil || IsNil(o.UseManagedCluster) {
   136  		var ret bool
   137  		return ret
   138  	}
   139  	return *o.UseManagedCluster
   140  }
   141  
   142  // GetUseManagedClusterOk returns a tuple with the UseManagedCluster field value if set, nil otherwise
   143  // and a boolean to check if the value has been set.
   144  func (o *BuildSettingsItem) GetUseManagedClusterOk() (*bool, bool) {
   145  	if o == nil || IsNil(o.UseManagedCluster) {
   146  		return nil, false
   147  	}
   148  	return o.UseManagedCluster, true
   149  }
   150  
   151  // HasUseManagedCluster returns a boolean if a field has been set.
   152  func (o *BuildSettingsItem) HasUseManagedCluster() bool {
   153  	if o != nil && !IsNil(o.UseManagedCluster) {
   154  		return true
   155  	}
   156  
   157  	return false
   158  }
   159  
   160  // SetUseManagedCluster gets a reference to the given bool and assigns it to the UseManagedCluster field.
   161  func (o *BuildSettingsItem) SetUseManagedCluster(v bool) {
   162  	o.UseManagedCluster = &v
   163  }
   164  
   165  // GetKubernetesIntegration returns the KubernetesIntegration field value if set, zero value otherwise (both if not set or set to explicit null).
   166  func (o *BuildSettingsItem) GetKubernetesIntegration() string {
   167  	if o == nil || IsNil(o.KubernetesIntegration.Get()) {
   168  		var ret string
   169  		return ret
   170  	}
   171  	return *o.KubernetesIntegration.Get()
   172  }
   173  
   174  // GetKubernetesIntegrationOk returns a tuple with the KubernetesIntegration field value if set, nil otherwise
   175  // and a boolean to check if the value has been set.
   176  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   177  func (o *BuildSettingsItem) GetKubernetesIntegrationOk() (*string, bool) {
   178  	if o == nil {
   179  		return nil, false
   180  	}
   181  	return o.KubernetesIntegration.Get(), o.KubernetesIntegration.IsSet()
   182  }
   183  
   184  // HasKubernetesIntegration returns a boolean if a field has been set.
   185  func (o *BuildSettingsItem) HasKubernetesIntegration() bool {
   186  	if o != nil && o.KubernetesIntegration.IsSet() {
   187  		return true
   188  	}
   189  
   190  	return false
   191  }
   192  
   193  // SetKubernetesIntegration gets a reference to the given NullableString and assigns it to the KubernetesIntegration field.
   194  func (o *BuildSettingsItem) SetKubernetesIntegration(v string) {
   195  	o.KubernetesIntegration.Set(&v)
   196  }
   197  
   198  // SetKubernetesIntegrationNil sets the value for KubernetesIntegration to be an explicit nil
   199  func (o *BuildSettingsItem) SetKubernetesIntegrationNil() {
   200  	o.KubernetesIntegration.Set(nil)
   201  }
   202  
   203  // UnsetKubernetesIntegration ensures that no value is present for KubernetesIntegration, not even an explicit nil
   204  func (o *BuildSettingsItem) UnsetKubernetesIntegration() {
   205  	o.KubernetesIntegration.Unset()
   206  }
   207  
   208  // GetCpu returns the Cpu field value if set, zero value otherwise (both if not set or set to explicit null).
   209  func (o *BuildSettingsItem) GetCpu() string {
   210  	if o == nil || IsNil(o.Cpu.Get()) {
   211  		var ret string
   212  		return ret
   213  	}
   214  	return *o.Cpu.Get()
   215  }
   216  
   217  // GetCpuOk returns a tuple with the Cpu field value if set, nil otherwise
   218  // and a boolean to check if the value has been set.
   219  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   220  func (o *BuildSettingsItem) GetCpuOk() (*string, bool) {
   221  	if o == nil {
   222  		return nil, false
   223  	}
   224  	return o.Cpu.Get(), o.Cpu.IsSet()
   225  }
   226  
   227  // HasCpu returns a boolean if a field has been set.
   228  func (o *BuildSettingsItem) HasCpu() bool {
   229  	if o != nil && o.Cpu.IsSet() {
   230  		return true
   231  	}
   232  
   233  	return false
   234  }
   235  
   236  // SetCpu gets a reference to the given NullableString and assigns it to the Cpu field.
   237  func (o *BuildSettingsItem) SetCpu(v string) {
   238  	o.Cpu.Set(&v)
   239  }
   240  
   241  // SetCpuNil sets the value for Cpu to be an explicit nil
   242  func (o *BuildSettingsItem) SetCpuNil() {
   243  	o.Cpu.Set(nil)
   244  }
   245  
   246  // UnsetCpu ensures that no value is present for Cpu, not even an explicit nil
   247  func (o *BuildSettingsItem) UnsetCpu() {
   248  	o.Cpu.Unset()
   249  }
   250  
   251  // GetMemory returns the Memory field value if set, zero value otherwise (both if not set or set to explicit null).
   252  func (o *BuildSettingsItem) GetMemory() int32 {
   253  	if o == nil || IsNil(o.Memory.Get()) {
   254  		var ret int32
   255  		return ret
   256  	}
   257  	return *o.Memory.Get()
   258  }
   259  
   260  // GetMemoryOk returns a tuple with the Memory field value if set, nil otherwise
   261  // and a boolean to check if the value has been set.
   262  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   263  func (o *BuildSettingsItem) GetMemoryOk() (*int32, bool) {
   264  	if o == nil {
   265  		return nil, false
   266  	}
   267  	return o.Memory.Get(), o.Memory.IsSet()
   268  }
   269  
   270  // HasMemory returns a boolean if a field has been set.
   271  func (o *BuildSettingsItem) HasMemory() bool {
   272  	if o != nil && o.Memory.IsSet() {
   273  		return true
   274  	}
   275  
   276  	return false
   277  }
   278  
   279  // SetMemory gets a reference to the given NullableInt32 and assigns it to the Memory field.
   280  func (o *BuildSettingsItem) SetMemory(v int32) {
   281  	o.Memory.Set(&v)
   282  }
   283  
   284  // SetMemoryNil sets the value for Memory to be an explicit nil
   285  func (o *BuildSettingsItem) SetMemoryNil() {
   286  	o.Memory.Set(nil)
   287  }
   288  
   289  // UnsetMemory ensures that no value is present for Memory, not even an explicit nil
   290  func (o *BuildSettingsItem) UnsetMemory() {
   291  	o.Memory.Unset()
   292  }
   293  
   294  // GetLastStatus returns the LastStatus field value if set, zero value otherwise (both if not set or set to explicit null).
   295  func (o *BuildSettingsItem) GetLastStatus() string {
   296  	if o == nil || IsNil(o.LastStatus.Get()) {
   297  		var ret string
   298  		return ret
   299  	}
   300  	return *o.LastStatus.Get()
   301  }
   302  
   303  // GetLastStatusOk returns a tuple with the LastStatus field value if set, nil otherwise
   304  // and a boolean to check if the value has been set.
   305  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   306  func (o *BuildSettingsItem) GetLastStatusOk() (*string, bool) {
   307  	if o == nil {
   308  		return nil, false
   309  	}
   310  	return o.LastStatus.Get(), o.LastStatus.IsSet()
   311  }
   312  
   313  // HasLastStatus returns a boolean if a field has been set.
   314  func (o *BuildSettingsItem) HasLastStatus() bool {
   315  	if o != nil && o.LastStatus.IsSet() {
   316  		return true
   317  	}
   318  
   319  	return false
   320  }
   321  
   322  // SetLastStatus gets a reference to the given NullableString and assigns it to the LastStatus field.
   323  func (o *BuildSettingsItem) SetLastStatus(v string) {
   324  	o.LastStatus.Set(&v)
   325  }
   326  
   327  // SetLastStatusNil sets the value for LastStatus to be an explicit nil
   328  func (o *BuildSettingsItem) SetLastStatusNil() {
   329  	o.LastStatus.Set(nil)
   330  }
   331  
   332  // UnsetLastStatus ensures that no value is present for LastStatus, not even an explicit nil
   333  func (o *BuildSettingsItem) UnsetLastStatus() {
   334  	o.LastStatus.Unset()
   335  }
   336  
   337  // GetLastError returns the LastError field value if set, zero value otherwise (both if not set or set to explicit null).
   338  func (o *BuildSettingsItem) GetLastError() string {
   339  	if o == nil || IsNil(o.LastError.Get()) {
   340  		var ret string
   341  		return ret
   342  	}
   343  	return *o.LastError.Get()
   344  }
   345  
   346  // GetLastErrorOk returns a tuple with the LastError field value if set, nil otherwise
   347  // and a boolean to check if the value has been set.
   348  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   349  func (o *BuildSettingsItem) GetLastErrorOk() (*string, bool) {
   350  	if o == nil {
   351  		return nil, false
   352  	}
   353  	return o.LastError.Get(), o.LastError.IsSet()
   354  }
   355  
   356  // HasLastError returns a boolean if a field has been set.
   357  func (o *BuildSettingsItem) HasLastError() bool {
   358  	if o != nil && o.LastError.IsSet() {
   359  		return true
   360  	}
   361  
   362  	return false
   363  }
   364  
   365  // SetLastError gets a reference to the given NullableString and assigns it to the LastError field.
   366  func (o *BuildSettingsItem) SetLastError(v string) {
   367  	o.LastError.Set(&v)
   368  }
   369  
   370  // SetLastErrorNil sets the value for LastError to be an explicit nil
   371  func (o *BuildSettingsItem) SetLastErrorNil() {
   372  	o.LastError.Set(nil)
   373  }
   374  
   375  // UnsetLastError ensures that no value is present for LastError, not even an explicit nil
   376  func (o *BuildSettingsItem) UnsetLastError() {
   377  	o.LastError.Unset()
   378  }
   379  
   380  func (o BuildSettingsItem) MarshalJSON() ([]byte, error) {
   381  	toSerialize, err := o.ToMap()
   382  	if err != nil {
   383  		return []byte{}, err
   384  	}
   385  	return json.Marshal(toSerialize)
   386  }
   387  
   388  func (o BuildSettingsItem) ToMap() (map[string]interface{}, error) {
   389  	toSerialize := map[string]interface{}{}
   390  	if !IsNil(o.UseManagedRegistry) {
   391  		toSerialize["useManagedRegistry"] = o.UseManagedRegistry
   392  	}
   393  	if o.RegistryIntegration.IsSet() {
   394  		toSerialize["registryIntegration"] = o.RegistryIntegration.Get()
   395  	}
   396  	if !IsNil(o.UseManagedCluster) {
   397  		toSerialize["useManagedCluster"] = o.UseManagedCluster
   398  	}
   399  	if o.KubernetesIntegration.IsSet() {
   400  		toSerialize["kubernetesIntegration"] = o.KubernetesIntegration.Get()
   401  	}
   402  	if o.Cpu.IsSet() {
   403  		toSerialize["cpu"] = o.Cpu.Get()
   404  	}
   405  	if o.Memory.IsSet() {
   406  		toSerialize["memory"] = o.Memory.Get()
   407  	}
   408  	if o.LastStatus.IsSet() {
   409  		toSerialize["lastStatus"] = o.LastStatus.Get()
   410  	}
   411  	if o.LastError.IsSet() {
   412  		toSerialize["lastError"] = o.LastError.Get()
   413  	}
   414  	return toSerialize, nil
   415  }
   416  
   417  type NullableBuildSettingsItem struct {
   418  	value *BuildSettingsItem
   419  	isSet bool
   420  }
   421  
   422  func (v NullableBuildSettingsItem) Get() *BuildSettingsItem {
   423  	return v.value
   424  }
   425  
   426  func (v *NullableBuildSettingsItem) Set(val *BuildSettingsItem) {
   427  	v.value = val
   428  	v.isSet = true
   429  }
   430  
   431  func (v NullableBuildSettingsItem) IsSet() bool {
   432  	return v.isSet
   433  }
   434  
   435  func (v *NullableBuildSettingsItem) Unset() {
   436  	v.value = nil
   437  	v.isSet = false
   438  }
   439  
   440  func NewNullableBuildSettingsItem(val *BuildSettingsItem) *NullableBuildSettingsItem {
   441  	return &NullableBuildSettingsItem{value: val, isSet: true}
   442  }
   443  
   444  func (v NullableBuildSettingsItem) MarshalJSON() ([]byte, error) {
   445  	return json.Marshal(v.value)
   446  }
   447  
   448  func (v *NullableBuildSettingsItem) UnmarshalJSON(src []byte) error {
   449  	v.isSet = true
   450  	return json.Unmarshal(src, &v.value)
   451  }