bunnyshell.com/sdk@v0.16.0/model_environment_create_action.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 EnvironmentCreateAction type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &EnvironmentCreateAction{}
    20  
    21  // EnvironmentCreateAction An environment holds a collection of buildable and deployable components.
    22  type EnvironmentCreateAction struct {
    23  	Name                           string                          `json:"name"`
    24  	Project                        string                          `json:"project"`
    25  	Genesis                        *EnvironmentCreateActionGenesis `json:"genesis,omitempty"`
    26  	Type                           *string                         `json:"type,omitempty"`
    27  	RemoteDevelopmentAllowed       *bool                           `json:"remoteDevelopmentAllowed,omitempty"`
    28  	AutoUpdate                     *bool                           `json:"autoUpdate,omitempty"`
    29  	CreateEphemeralOnPrCreate      *bool                           `json:"createEphemeralOnPrCreate,omitempty"`
    30  	DestroyEphemeralOnPrClose      *bool                           `json:"destroyEphemeralOnPrClose,omitempty"`
    31  	AutoDeployEphemeral            *bool                           `json:"autoDeployEphemeral,omitempty"`
    32  	KubernetesIntegration          NullableString                  `json:"kubernetesIntegration,omitempty"`
    33  	EphemeralKubernetesIntegration NullableString                  `json:"ephemeralKubernetesIntegration,omitempty"`
    34  	Labels                         *map[string]string              `json:"labels,omitempty"`
    35  }
    36  
    37  // NewEnvironmentCreateAction instantiates a new EnvironmentCreateAction object
    38  // This constructor will assign default values to properties that have it defined,
    39  // and makes sure properties required by API are set, but the set of arguments
    40  // will change when the set of required properties is changed
    41  func NewEnvironmentCreateAction(name string, project string) *EnvironmentCreateAction {
    42  	this := EnvironmentCreateAction{}
    43  	this.Name = name
    44  	this.Project = project
    45  	return &this
    46  }
    47  
    48  // NewEnvironmentCreateActionWithDefaults instantiates a new EnvironmentCreateAction object
    49  // This constructor will only assign default values to properties that have it defined,
    50  // but it doesn't guarantee that properties required by API are set
    51  func NewEnvironmentCreateActionWithDefaults() *EnvironmentCreateAction {
    52  	this := EnvironmentCreateAction{}
    53  	return &this
    54  }
    55  
    56  // GetName returns the Name field value
    57  func (o *EnvironmentCreateAction) GetName() string {
    58  	if o == nil {
    59  		var ret string
    60  		return ret
    61  	}
    62  
    63  	return o.Name
    64  }
    65  
    66  // GetNameOk returns a tuple with the Name field value
    67  // and a boolean to check if the value has been set.
    68  func (o *EnvironmentCreateAction) GetNameOk() (*string, bool) {
    69  	if o == nil {
    70  		return nil, false
    71  	}
    72  	return &o.Name, true
    73  }
    74  
    75  // SetName sets field value
    76  func (o *EnvironmentCreateAction) SetName(v string) {
    77  	o.Name = v
    78  }
    79  
    80  // GetProject returns the Project field value
    81  func (o *EnvironmentCreateAction) GetProject() string {
    82  	if o == nil {
    83  		var ret string
    84  		return ret
    85  	}
    86  
    87  	return o.Project
    88  }
    89  
    90  // GetProjectOk returns a tuple with the Project field value
    91  // and a boolean to check if the value has been set.
    92  func (o *EnvironmentCreateAction) GetProjectOk() (*string, bool) {
    93  	if o == nil {
    94  		return nil, false
    95  	}
    96  	return &o.Project, true
    97  }
    98  
    99  // SetProject sets field value
   100  func (o *EnvironmentCreateAction) SetProject(v string) {
   101  	o.Project = v
   102  }
   103  
   104  // GetGenesis returns the Genesis field value if set, zero value otherwise.
   105  func (o *EnvironmentCreateAction) GetGenesis() EnvironmentCreateActionGenesis {
   106  	if o == nil || IsNil(o.Genesis) {
   107  		var ret EnvironmentCreateActionGenesis
   108  		return ret
   109  	}
   110  	return *o.Genesis
   111  }
   112  
   113  // GetGenesisOk returns a tuple with the Genesis field value if set, nil otherwise
   114  // and a boolean to check if the value has been set.
   115  func (o *EnvironmentCreateAction) GetGenesisOk() (*EnvironmentCreateActionGenesis, bool) {
   116  	if o == nil || IsNil(o.Genesis) {
   117  		return nil, false
   118  	}
   119  	return o.Genesis, true
   120  }
   121  
   122  // HasGenesis returns a boolean if a field has been set.
   123  func (o *EnvironmentCreateAction) HasGenesis() bool {
   124  	if o != nil && !IsNil(o.Genesis) {
   125  		return true
   126  	}
   127  
   128  	return false
   129  }
   130  
   131  // SetGenesis gets a reference to the given EnvironmentCreateActionGenesis and assigns it to the Genesis field.
   132  func (o *EnvironmentCreateAction) SetGenesis(v EnvironmentCreateActionGenesis) {
   133  	o.Genesis = &v
   134  }
   135  
   136  // GetType returns the Type field value if set, zero value otherwise.
   137  func (o *EnvironmentCreateAction) GetType() string {
   138  	if o == nil || IsNil(o.Type) {
   139  		var ret string
   140  		return ret
   141  	}
   142  	return *o.Type
   143  }
   144  
   145  // GetTypeOk returns a tuple with the Type field value if set, nil otherwise
   146  // and a boolean to check if the value has been set.
   147  func (o *EnvironmentCreateAction) GetTypeOk() (*string, bool) {
   148  	if o == nil || IsNil(o.Type) {
   149  		return nil, false
   150  	}
   151  	return o.Type, true
   152  }
   153  
   154  // HasType returns a boolean if a field has been set.
   155  func (o *EnvironmentCreateAction) HasType() bool {
   156  	if o != nil && !IsNil(o.Type) {
   157  		return true
   158  	}
   159  
   160  	return false
   161  }
   162  
   163  // SetType gets a reference to the given string and assigns it to the Type field.
   164  func (o *EnvironmentCreateAction) SetType(v string) {
   165  	o.Type = &v
   166  }
   167  
   168  // GetRemoteDevelopmentAllowed returns the RemoteDevelopmentAllowed field value if set, zero value otherwise.
   169  func (o *EnvironmentCreateAction) GetRemoteDevelopmentAllowed() bool {
   170  	if o == nil || IsNil(o.RemoteDevelopmentAllowed) {
   171  		var ret bool
   172  		return ret
   173  	}
   174  	return *o.RemoteDevelopmentAllowed
   175  }
   176  
   177  // GetRemoteDevelopmentAllowedOk returns a tuple with the RemoteDevelopmentAllowed field value if set, nil otherwise
   178  // and a boolean to check if the value has been set.
   179  func (o *EnvironmentCreateAction) GetRemoteDevelopmentAllowedOk() (*bool, bool) {
   180  	if o == nil || IsNil(o.RemoteDevelopmentAllowed) {
   181  		return nil, false
   182  	}
   183  	return o.RemoteDevelopmentAllowed, true
   184  }
   185  
   186  // HasRemoteDevelopmentAllowed returns a boolean if a field has been set.
   187  func (o *EnvironmentCreateAction) HasRemoteDevelopmentAllowed() bool {
   188  	if o != nil && !IsNil(o.RemoteDevelopmentAllowed) {
   189  		return true
   190  	}
   191  
   192  	return false
   193  }
   194  
   195  // SetRemoteDevelopmentAllowed gets a reference to the given bool and assigns it to the RemoteDevelopmentAllowed field.
   196  func (o *EnvironmentCreateAction) SetRemoteDevelopmentAllowed(v bool) {
   197  	o.RemoteDevelopmentAllowed = &v
   198  }
   199  
   200  // GetAutoUpdate returns the AutoUpdate field value if set, zero value otherwise.
   201  func (o *EnvironmentCreateAction) GetAutoUpdate() bool {
   202  	if o == nil || IsNil(o.AutoUpdate) {
   203  		var ret bool
   204  		return ret
   205  	}
   206  	return *o.AutoUpdate
   207  }
   208  
   209  // GetAutoUpdateOk returns a tuple with the AutoUpdate field value if set, nil otherwise
   210  // and a boolean to check if the value has been set.
   211  func (o *EnvironmentCreateAction) GetAutoUpdateOk() (*bool, bool) {
   212  	if o == nil || IsNil(o.AutoUpdate) {
   213  		return nil, false
   214  	}
   215  	return o.AutoUpdate, true
   216  }
   217  
   218  // HasAutoUpdate returns a boolean if a field has been set.
   219  func (o *EnvironmentCreateAction) HasAutoUpdate() bool {
   220  	if o != nil && !IsNil(o.AutoUpdate) {
   221  		return true
   222  	}
   223  
   224  	return false
   225  }
   226  
   227  // SetAutoUpdate gets a reference to the given bool and assigns it to the AutoUpdate field.
   228  func (o *EnvironmentCreateAction) SetAutoUpdate(v bool) {
   229  	o.AutoUpdate = &v
   230  }
   231  
   232  // GetCreateEphemeralOnPrCreate returns the CreateEphemeralOnPrCreate field value if set, zero value otherwise.
   233  func (o *EnvironmentCreateAction) GetCreateEphemeralOnPrCreate() bool {
   234  	if o == nil || IsNil(o.CreateEphemeralOnPrCreate) {
   235  		var ret bool
   236  		return ret
   237  	}
   238  	return *o.CreateEphemeralOnPrCreate
   239  }
   240  
   241  // GetCreateEphemeralOnPrCreateOk returns a tuple with the CreateEphemeralOnPrCreate field value if set, nil otherwise
   242  // and a boolean to check if the value has been set.
   243  func (o *EnvironmentCreateAction) GetCreateEphemeralOnPrCreateOk() (*bool, bool) {
   244  	if o == nil || IsNil(o.CreateEphemeralOnPrCreate) {
   245  		return nil, false
   246  	}
   247  	return o.CreateEphemeralOnPrCreate, true
   248  }
   249  
   250  // HasCreateEphemeralOnPrCreate returns a boolean if a field has been set.
   251  func (o *EnvironmentCreateAction) HasCreateEphemeralOnPrCreate() bool {
   252  	if o != nil && !IsNil(o.CreateEphemeralOnPrCreate) {
   253  		return true
   254  	}
   255  
   256  	return false
   257  }
   258  
   259  // SetCreateEphemeralOnPrCreate gets a reference to the given bool and assigns it to the CreateEphemeralOnPrCreate field.
   260  func (o *EnvironmentCreateAction) SetCreateEphemeralOnPrCreate(v bool) {
   261  	o.CreateEphemeralOnPrCreate = &v
   262  }
   263  
   264  // GetDestroyEphemeralOnPrClose returns the DestroyEphemeralOnPrClose field value if set, zero value otherwise.
   265  func (o *EnvironmentCreateAction) GetDestroyEphemeralOnPrClose() bool {
   266  	if o == nil || IsNil(o.DestroyEphemeralOnPrClose) {
   267  		var ret bool
   268  		return ret
   269  	}
   270  	return *o.DestroyEphemeralOnPrClose
   271  }
   272  
   273  // GetDestroyEphemeralOnPrCloseOk returns a tuple with the DestroyEphemeralOnPrClose field value if set, nil otherwise
   274  // and a boolean to check if the value has been set.
   275  func (o *EnvironmentCreateAction) GetDestroyEphemeralOnPrCloseOk() (*bool, bool) {
   276  	if o == nil || IsNil(o.DestroyEphemeralOnPrClose) {
   277  		return nil, false
   278  	}
   279  	return o.DestroyEphemeralOnPrClose, true
   280  }
   281  
   282  // HasDestroyEphemeralOnPrClose returns a boolean if a field has been set.
   283  func (o *EnvironmentCreateAction) HasDestroyEphemeralOnPrClose() bool {
   284  	if o != nil && !IsNil(o.DestroyEphemeralOnPrClose) {
   285  		return true
   286  	}
   287  
   288  	return false
   289  }
   290  
   291  // SetDestroyEphemeralOnPrClose gets a reference to the given bool and assigns it to the DestroyEphemeralOnPrClose field.
   292  func (o *EnvironmentCreateAction) SetDestroyEphemeralOnPrClose(v bool) {
   293  	o.DestroyEphemeralOnPrClose = &v
   294  }
   295  
   296  // GetAutoDeployEphemeral returns the AutoDeployEphemeral field value if set, zero value otherwise.
   297  func (o *EnvironmentCreateAction) GetAutoDeployEphemeral() bool {
   298  	if o == nil || IsNil(o.AutoDeployEphemeral) {
   299  		var ret bool
   300  		return ret
   301  	}
   302  	return *o.AutoDeployEphemeral
   303  }
   304  
   305  // GetAutoDeployEphemeralOk returns a tuple with the AutoDeployEphemeral field value if set, nil otherwise
   306  // and a boolean to check if the value has been set.
   307  func (o *EnvironmentCreateAction) GetAutoDeployEphemeralOk() (*bool, bool) {
   308  	if o == nil || IsNil(o.AutoDeployEphemeral) {
   309  		return nil, false
   310  	}
   311  	return o.AutoDeployEphemeral, true
   312  }
   313  
   314  // HasAutoDeployEphemeral returns a boolean if a field has been set.
   315  func (o *EnvironmentCreateAction) HasAutoDeployEphemeral() bool {
   316  	if o != nil && !IsNil(o.AutoDeployEphemeral) {
   317  		return true
   318  	}
   319  
   320  	return false
   321  }
   322  
   323  // SetAutoDeployEphemeral gets a reference to the given bool and assigns it to the AutoDeployEphemeral field.
   324  func (o *EnvironmentCreateAction) SetAutoDeployEphemeral(v bool) {
   325  	o.AutoDeployEphemeral = &v
   326  }
   327  
   328  // GetKubernetesIntegration returns the KubernetesIntegration field value if set, zero value otherwise (both if not set or set to explicit null).
   329  func (o *EnvironmentCreateAction) GetKubernetesIntegration() string {
   330  	if o == nil || IsNil(o.KubernetesIntegration.Get()) {
   331  		var ret string
   332  		return ret
   333  	}
   334  	return *o.KubernetesIntegration.Get()
   335  }
   336  
   337  // GetKubernetesIntegrationOk returns a tuple with the KubernetesIntegration field value if set, nil otherwise
   338  // and a boolean to check if the value has been set.
   339  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   340  func (o *EnvironmentCreateAction) GetKubernetesIntegrationOk() (*string, bool) {
   341  	if o == nil {
   342  		return nil, false
   343  	}
   344  	return o.KubernetesIntegration.Get(), o.KubernetesIntegration.IsSet()
   345  }
   346  
   347  // HasKubernetesIntegration returns a boolean if a field has been set.
   348  func (o *EnvironmentCreateAction) HasKubernetesIntegration() bool {
   349  	if o != nil && o.KubernetesIntegration.IsSet() {
   350  		return true
   351  	}
   352  
   353  	return false
   354  }
   355  
   356  // SetKubernetesIntegration gets a reference to the given NullableString and assigns it to the KubernetesIntegration field.
   357  func (o *EnvironmentCreateAction) SetKubernetesIntegration(v string) {
   358  	o.KubernetesIntegration.Set(&v)
   359  }
   360  
   361  // SetKubernetesIntegrationNil sets the value for KubernetesIntegration to be an explicit nil
   362  func (o *EnvironmentCreateAction) SetKubernetesIntegrationNil() {
   363  	o.KubernetesIntegration.Set(nil)
   364  }
   365  
   366  // UnsetKubernetesIntegration ensures that no value is present for KubernetesIntegration, not even an explicit nil
   367  func (o *EnvironmentCreateAction) UnsetKubernetesIntegration() {
   368  	o.KubernetesIntegration.Unset()
   369  }
   370  
   371  // GetEphemeralKubernetesIntegration returns the EphemeralKubernetesIntegration field value if set, zero value otherwise (both if not set or set to explicit null).
   372  func (o *EnvironmentCreateAction) GetEphemeralKubernetesIntegration() string {
   373  	if o == nil || IsNil(o.EphemeralKubernetesIntegration.Get()) {
   374  		var ret string
   375  		return ret
   376  	}
   377  	return *o.EphemeralKubernetesIntegration.Get()
   378  }
   379  
   380  // GetEphemeralKubernetesIntegrationOk returns a tuple with the EphemeralKubernetesIntegration field value if set, nil otherwise
   381  // and a boolean to check if the value has been set.
   382  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   383  func (o *EnvironmentCreateAction) GetEphemeralKubernetesIntegrationOk() (*string, bool) {
   384  	if o == nil {
   385  		return nil, false
   386  	}
   387  	return o.EphemeralKubernetesIntegration.Get(), o.EphemeralKubernetesIntegration.IsSet()
   388  }
   389  
   390  // HasEphemeralKubernetesIntegration returns a boolean if a field has been set.
   391  func (o *EnvironmentCreateAction) HasEphemeralKubernetesIntegration() bool {
   392  	if o != nil && o.EphemeralKubernetesIntegration.IsSet() {
   393  		return true
   394  	}
   395  
   396  	return false
   397  }
   398  
   399  // SetEphemeralKubernetesIntegration gets a reference to the given NullableString and assigns it to the EphemeralKubernetesIntegration field.
   400  func (o *EnvironmentCreateAction) SetEphemeralKubernetesIntegration(v string) {
   401  	o.EphemeralKubernetesIntegration.Set(&v)
   402  }
   403  
   404  // SetEphemeralKubernetesIntegrationNil sets the value for EphemeralKubernetesIntegration to be an explicit nil
   405  func (o *EnvironmentCreateAction) SetEphemeralKubernetesIntegrationNil() {
   406  	o.EphemeralKubernetesIntegration.Set(nil)
   407  }
   408  
   409  // UnsetEphemeralKubernetesIntegration ensures that no value is present for EphemeralKubernetesIntegration, not even an explicit nil
   410  func (o *EnvironmentCreateAction) UnsetEphemeralKubernetesIntegration() {
   411  	o.EphemeralKubernetesIntegration.Unset()
   412  }
   413  
   414  // GetLabels returns the Labels field value if set, zero value otherwise.
   415  func (o *EnvironmentCreateAction) GetLabels() map[string]string {
   416  	if o == nil || IsNil(o.Labels) {
   417  		var ret map[string]string
   418  		return ret
   419  	}
   420  	return *o.Labels
   421  }
   422  
   423  // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
   424  // and a boolean to check if the value has been set.
   425  func (o *EnvironmentCreateAction) GetLabelsOk() (*map[string]string, bool) {
   426  	if o == nil || IsNil(o.Labels) {
   427  		return nil, false
   428  	}
   429  	return o.Labels, true
   430  }
   431  
   432  // HasLabels returns a boolean if a field has been set.
   433  func (o *EnvironmentCreateAction) HasLabels() bool {
   434  	if o != nil && !IsNil(o.Labels) {
   435  		return true
   436  	}
   437  
   438  	return false
   439  }
   440  
   441  // SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
   442  func (o *EnvironmentCreateAction) SetLabels(v map[string]string) {
   443  	o.Labels = &v
   444  }
   445  
   446  func (o EnvironmentCreateAction) MarshalJSON() ([]byte, error) {
   447  	toSerialize, err := o.ToMap()
   448  	if err != nil {
   449  		return []byte{}, err
   450  	}
   451  	return json.Marshal(toSerialize)
   452  }
   453  
   454  func (o EnvironmentCreateAction) ToMap() (map[string]interface{}, error) {
   455  	toSerialize := map[string]interface{}{}
   456  	toSerialize["name"] = o.Name
   457  	toSerialize["project"] = o.Project
   458  	if !IsNil(o.Genesis) {
   459  		toSerialize["genesis"] = o.Genesis
   460  	}
   461  	if !IsNil(o.Type) {
   462  		toSerialize["type"] = o.Type
   463  	}
   464  	if !IsNil(o.RemoteDevelopmentAllowed) {
   465  		toSerialize["remoteDevelopmentAllowed"] = o.RemoteDevelopmentAllowed
   466  	}
   467  	if !IsNil(o.AutoUpdate) {
   468  		toSerialize["autoUpdate"] = o.AutoUpdate
   469  	}
   470  	if !IsNil(o.CreateEphemeralOnPrCreate) {
   471  		toSerialize["createEphemeralOnPrCreate"] = o.CreateEphemeralOnPrCreate
   472  	}
   473  	if !IsNil(o.DestroyEphemeralOnPrClose) {
   474  		toSerialize["destroyEphemeralOnPrClose"] = o.DestroyEphemeralOnPrClose
   475  	}
   476  	if !IsNil(o.AutoDeployEphemeral) {
   477  		toSerialize["autoDeployEphemeral"] = o.AutoDeployEphemeral
   478  	}
   479  	if o.KubernetesIntegration.IsSet() {
   480  		toSerialize["kubernetesIntegration"] = o.KubernetesIntegration.Get()
   481  	}
   482  	if o.EphemeralKubernetesIntegration.IsSet() {
   483  		toSerialize["ephemeralKubernetesIntegration"] = o.EphemeralKubernetesIntegration.Get()
   484  	}
   485  	if !IsNil(o.Labels) {
   486  		toSerialize["labels"] = o.Labels
   487  	}
   488  	return toSerialize, nil
   489  }
   490  
   491  type NullableEnvironmentCreateAction struct {
   492  	value *EnvironmentCreateAction
   493  	isSet bool
   494  }
   495  
   496  func (v NullableEnvironmentCreateAction) Get() *EnvironmentCreateAction {
   497  	return v.value
   498  }
   499  
   500  func (v *NullableEnvironmentCreateAction) Set(val *EnvironmentCreateAction) {
   501  	v.value = val
   502  	v.isSet = true
   503  }
   504  
   505  func (v NullableEnvironmentCreateAction) IsSet() bool {
   506  	return v.isSet
   507  }
   508  
   509  func (v *NullableEnvironmentCreateAction) Unset() {
   510  	v.value = nil
   511  	v.isSet = false
   512  }
   513  
   514  func NewNullableEnvironmentCreateAction(val *EnvironmentCreateAction) *NullableEnvironmentCreateAction {
   515  	return &NullableEnvironmentCreateAction{value: val, isSet: true}
   516  }
   517  
   518  func (v NullableEnvironmentCreateAction) MarshalJSON() ([]byte, error) {
   519  	return json.Marshal(v.value)
   520  }
   521  
   522  func (v *NullableEnvironmentCreateAction) UnmarshalJSON(src []byte) error {
   523  	v.isSet = true
   524  	return json.Unmarshal(src, &v.value)
   525  }