bunnyshell.com/sdk@v0.16.0/model_primary.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 Primary type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &Primary{}
    20  
    21  // Primary struct for Primary
    22  type Primary struct {
    23  	Type                           *string        `json:"type,omitempty"`
    24  	AutoDeployEphemeral            NullableBool   `json:"autoDeployEphemeral,omitempty"`
    25  	CreateEphemeralOnPrCreate      NullableBool   `json:"createEphemeralOnPrCreate,omitempty"`
    26  	DestroyEphemeralOnPrClose      NullableBool   `json:"destroyEphemeralOnPrClose,omitempty"`
    27  	EphemeralKubernetesIntegration NullableString `json:"ephemeralKubernetesIntegration"`
    28  }
    29  
    30  // NewPrimary instantiates a new Primary object
    31  // This constructor will assign default values to properties that have it defined,
    32  // and makes sure properties required by API are set, but the set of arguments
    33  // will change when the set of required properties is changed
    34  func NewPrimary(ephemeralKubernetesIntegration NullableString) *Primary {
    35  	this := Primary{}
    36  	var type_ string = "primary"
    37  	this.Type = &type_
    38  	this.EphemeralKubernetesIntegration = ephemeralKubernetesIntegration
    39  	return &this
    40  }
    41  
    42  // NewPrimaryWithDefaults instantiates a new Primary object
    43  // This constructor will only assign default values to properties that have it defined,
    44  // but it doesn't guarantee that properties required by API are set
    45  func NewPrimaryWithDefaults() *Primary {
    46  	this := Primary{}
    47  	var type_ string = "primary"
    48  	this.Type = &type_
    49  	return &this
    50  }
    51  
    52  // GetType returns the Type field value if set, zero value otherwise.
    53  func (o *Primary) GetType() string {
    54  	if o == nil || IsNil(o.Type) {
    55  		var ret string
    56  		return ret
    57  	}
    58  	return *o.Type
    59  }
    60  
    61  // GetTypeOk returns a tuple with the Type field value if set, nil otherwise
    62  // and a boolean to check if the value has been set.
    63  func (o *Primary) GetTypeOk() (*string, bool) {
    64  	if o == nil || IsNil(o.Type) {
    65  		return nil, false
    66  	}
    67  	return o.Type, true
    68  }
    69  
    70  // HasType returns a boolean if a field has been set.
    71  func (o *Primary) HasType() bool {
    72  	if o != nil && !IsNil(o.Type) {
    73  		return true
    74  	}
    75  
    76  	return false
    77  }
    78  
    79  // SetType gets a reference to the given string and assigns it to the Type field.
    80  func (o *Primary) SetType(v string) {
    81  	o.Type = &v
    82  }
    83  
    84  // GetAutoDeployEphemeral returns the AutoDeployEphemeral field value if set, zero value otherwise (both if not set or set to explicit null).
    85  func (o *Primary) GetAutoDeployEphemeral() bool {
    86  	if o == nil || IsNil(o.AutoDeployEphemeral.Get()) {
    87  		var ret bool
    88  		return ret
    89  	}
    90  	return *o.AutoDeployEphemeral.Get()
    91  }
    92  
    93  // GetAutoDeployEphemeralOk returns a tuple with the AutoDeployEphemeral field value if set, nil otherwise
    94  // and a boolean to check if the value has been set.
    95  // NOTE: If the value is an explicit nil, `nil, true` will be returned
    96  func (o *Primary) GetAutoDeployEphemeralOk() (*bool, bool) {
    97  	if o == nil {
    98  		return nil, false
    99  	}
   100  	return o.AutoDeployEphemeral.Get(), o.AutoDeployEphemeral.IsSet()
   101  }
   102  
   103  // HasAutoDeployEphemeral returns a boolean if a field has been set.
   104  func (o *Primary) HasAutoDeployEphemeral() bool {
   105  	if o != nil && o.AutoDeployEphemeral.IsSet() {
   106  		return true
   107  	}
   108  
   109  	return false
   110  }
   111  
   112  // SetAutoDeployEphemeral gets a reference to the given NullableBool and assigns it to the AutoDeployEphemeral field.
   113  func (o *Primary) SetAutoDeployEphemeral(v bool) {
   114  	o.AutoDeployEphemeral.Set(&v)
   115  }
   116  
   117  // SetAutoDeployEphemeralNil sets the value for AutoDeployEphemeral to be an explicit nil
   118  func (o *Primary) SetAutoDeployEphemeralNil() {
   119  	o.AutoDeployEphemeral.Set(nil)
   120  }
   121  
   122  // UnsetAutoDeployEphemeral ensures that no value is present for AutoDeployEphemeral, not even an explicit nil
   123  func (o *Primary) UnsetAutoDeployEphemeral() {
   124  	o.AutoDeployEphemeral.Unset()
   125  }
   126  
   127  // GetCreateEphemeralOnPrCreate returns the CreateEphemeralOnPrCreate field value if set, zero value otherwise (both if not set or set to explicit null).
   128  func (o *Primary) GetCreateEphemeralOnPrCreate() bool {
   129  	if o == nil || IsNil(o.CreateEphemeralOnPrCreate.Get()) {
   130  		var ret bool
   131  		return ret
   132  	}
   133  	return *o.CreateEphemeralOnPrCreate.Get()
   134  }
   135  
   136  // GetCreateEphemeralOnPrCreateOk returns a tuple with the CreateEphemeralOnPrCreate field value if set, nil otherwise
   137  // and a boolean to check if the value has been set.
   138  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   139  func (o *Primary) GetCreateEphemeralOnPrCreateOk() (*bool, bool) {
   140  	if o == nil {
   141  		return nil, false
   142  	}
   143  	return o.CreateEphemeralOnPrCreate.Get(), o.CreateEphemeralOnPrCreate.IsSet()
   144  }
   145  
   146  // HasCreateEphemeralOnPrCreate returns a boolean if a field has been set.
   147  func (o *Primary) HasCreateEphemeralOnPrCreate() bool {
   148  	if o != nil && o.CreateEphemeralOnPrCreate.IsSet() {
   149  		return true
   150  	}
   151  
   152  	return false
   153  }
   154  
   155  // SetCreateEphemeralOnPrCreate gets a reference to the given NullableBool and assigns it to the CreateEphemeralOnPrCreate field.
   156  func (o *Primary) SetCreateEphemeralOnPrCreate(v bool) {
   157  	o.CreateEphemeralOnPrCreate.Set(&v)
   158  }
   159  
   160  // SetCreateEphemeralOnPrCreateNil sets the value for CreateEphemeralOnPrCreate to be an explicit nil
   161  func (o *Primary) SetCreateEphemeralOnPrCreateNil() {
   162  	o.CreateEphemeralOnPrCreate.Set(nil)
   163  }
   164  
   165  // UnsetCreateEphemeralOnPrCreate ensures that no value is present for CreateEphemeralOnPrCreate, not even an explicit nil
   166  func (o *Primary) UnsetCreateEphemeralOnPrCreate() {
   167  	o.CreateEphemeralOnPrCreate.Unset()
   168  }
   169  
   170  // GetDestroyEphemeralOnPrClose returns the DestroyEphemeralOnPrClose field value if set, zero value otherwise (both if not set or set to explicit null).
   171  func (o *Primary) GetDestroyEphemeralOnPrClose() bool {
   172  	if o == nil || IsNil(o.DestroyEphemeralOnPrClose.Get()) {
   173  		var ret bool
   174  		return ret
   175  	}
   176  	return *o.DestroyEphemeralOnPrClose.Get()
   177  }
   178  
   179  // GetDestroyEphemeralOnPrCloseOk returns a tuple with the DestroyEphemeralOnPrClose field value if set, nil otherwise
   180  // and a boolean to check if the value has been set.
   181  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   182  func (o *Primary) GetDestroyEphemeralOnPrCloseOk() (*bool, bool) {
   183  	if o == nil {
   184  		return nil, false
   185  	}
   186  	return o.DestroyEphemeralOnPrClose.Get(), o.DestroyEphemeralOnPrClose.IsSet()
   187  }
   188  
   189  // HasDestroyEphemeralOnPrClose returns a boolean if a field has been set.
   190  func (o *Primary) HasDestroyEphemeralOnPrClose() bool {
   191  	if o != nil && o.DestroyEphemeralOnPrClose.IsSet() {
   192  		return true
   193  	}
   194  
   195  	return false
   196  }
   197  
   198  // SetDestroyEphemeralOnPrClose gets a reference to the given NullableBool and assigns it to the DestroyEphemeralOnPrClose field.
   199  func (o *Primary) SetDestroyEphemeralOnPrClose(v bool) {
   200  	o.DestroyEphemeralOnPrClose.Set(&v)
   201  }
   202  
   203  // SetDestroyEphemeralOnPrCloseNil sets the value for DestroyEphemeralOnPrClose to be an explicit nil
   204  func (o *Primary) SetDestroyEphemeralOnPrCloseNil() {
   205  	o.DestroyEphemeralOnPrClose.Set(nil)
   206  }
   207  
   208  // UnsetDestroyEphemeralOnPrClose ensures that no value is present for DestroyEphemeralOnPrClose, not even an explicit nil
   209  func (o *Primary) UnsetDestroyEphemeralOnPrClose() {
   210  	o.DestroyEphemeralOnPrClose.Unset()
   211  }
   212  
   213  // GetEphemeralKubernetesIntegration returns the EphemeralKubernetesIntegration field value
   214  // If the value is explicit nil, the zero value for string will be returned
   215  func (o *Primary) GetEphemeralKubernetesIntegration() string {
   216  	if o == nil || o.EphemeralKubernetesIntegration.Get() == nil {
   217  		var ret string
   218  		return ret
   219  	}
   220  
   221  	return *o.EphemeralKubernetesIntegration.Get()
   222  }
   223  
   224  // GetEphemeralKubernetesIntegrationOk returns a tuple with the EphemeralKubernetesIntegration field value
   225  // and a boolean to check if the value has been set.
   226  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   227  func (o *Primary) GetEphemeralKubernetesIntegrationOk() (*string, bool) {
   228  	if o == nil {
   229  		return nil, false
   230  	}
   231  	return o.EphemeralKubernetesIntegration.Get(), o.EphemeralKubernetesIntegration.IsSet()
   232  }
   233  
   234  // SetEphemeralKubernetesIntegration sets field value
   235  func (o *Primary) SetEphemeralKubernetesIntegration(v string) {
   236  	o.EphemeralKubernetesIntegration.Set(&v)
   237  }
   238  
   239  func (o Primary) MarshalJSON() ([]byte, error) {
   240  	toSerialize, err := o.ToMap()
   241  	if err != nil {
   242  		return []byte{}, err
   243  	}
   244  	return json.Marshal(toSerialize)
   245  }
   246  
   247  func (o Primary) ToMap() (map[string]interface{}, error) {
   248  	toSerialize := map[string]interface{}{}
   249  	if !IsNil(o.Type) {
   250  		toSerialize["type"] = o.Type
   251  	}
   252  	if o.AutoDeployEphemeral.IsSet() {
   253  		toSerialize["autoDeployEphemeral"] = o.AutoDeployEphemeral.Get()
   254  	}
   255  	if o.CreateEphemeralOnPrCreate.IsSet() {
   256  		toSerialize["createEphemeralOnPrCreate"] = o.CreateEphemeralOnPrCreate.Get()
   257  	}
   258  	if o.DestroyEphemeralOnPrClose.IsSet() {
   259  		toSerialize["destroyEphemeralOnPrClose"] = o.DestroyEphemeralOnPrClose.Get()
   260  	}
   261  	toSerialize["ephemeralKubernetesIntegration"] = o.EphemeralKubernetesIntegration.Get()
   262  	return toSerialize, nil
   263  }
   264  
   265  type NullablePrimary struct {
   266  	value *Primary
   267  	isSet bool
   268  }
   269  
   270  func (v NullablePrimary) Get() *Primary {
   271  	return v.value
   272  }
   273  
   274  func (v *NullablePrimary) Set(val *Primary) {
   275  	v.value = val
   276  	v.isSet = true
   277  }
   278  
   279  func (v NullablePrimary) IsSet() bool {
   280  	return v.isSet
   281  }
   282  
   283  func (v *NullablePrimary) Unset() {
   284  	v.value = nil
   285  	v.isSet = false
   286  }
   287  
   288  func NewNullablePrimary(val *Primary) *NullablePrimary {
   289  	return &NullablePrimary{value: val, isSet: true}
   290  }
   291  
   292  func (v NullablePrimary) MarshalJSON() ([]byte, error) {
   293  	return json.Marshal(v.value)
   294  }
   295  
   296  func (v *NullablePrimary) UnmarshalJSON(src []byte) error {
   297  	v.isSet = true
   298  	return json.Unmarshal(src, &v.value)
   299  }