bunnyshell.com/sdk@v0.16.0/model_profile_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 ProfileItem type satisfies the MappedNullable interface at compile time
    19  var _ MappedNullable = &ProfileItem{}
    20  
    21  // ProfileItem struct for ProfileItem
    22  type ProfileItem struct {
    23  	// The command to be run when starting the container.
    24  	Command []string `json:"command,omitempty"`
    25  	// The port mapping for the container.
    26  	PortMapping []string `json:"portMapping,omitempty"`
    27  	// The environ for the container.
    28  	Environ *map[string]string `json:"environ,omitempty"`
    29  	// The sync paths for the container.
    30  	SyncPaths    []SyncPathItem                  `json:"syncPaths,omitempty"`
    31  	Requirements NullableResourceRequirementItem `json:"requirements,omitempty"`
    32  }
    33  
    34  // NewProfileItem instantiates a new ProfileItem object
    35  // This constructor will assign default values to properties that have it defined,
    36  // and makes sure properties required by API are set, but the set of arguments
    37  // will change when the set of required properties is changed
    38  func NewProfileItem() *ProfileItem {
    39  	this := ProfileItem{}
    40  	return &this
    41  }
    42  
    43  // NewProfileItemWithDefaults instantiates a new ProfileItem object
    44  // This constructor will only assign default values to properties that have it defined,
    45  // but it doesn't guarantee that properties required by API are set
    46  func NewProfileItemWithDefaults() *ProfileItem {
    47  	this := ProfileItem{}
    48  	return &this
    49  }
    50  
    51  // GetCommand returns the Command field value if set, zero value otherwise.
    52  func (o *ProfileItem) GetCommand() []string {
    53  	if o == nil || IsNil(o.Command) {
    54  		var ret []string
    55  		return ret
    56  	}
    57  	return o.Command
    58  }
    59  
    60  // GetCommandOk returns a tuple with the Command field value if set, nil otherwise
    61  // and a boolean to check if the value has been set.
    62  func (o *ProfileItem) GetCommandOk() ([]string, bool) {
    63  	if o == nil || IsNil(o.Command) {
    64  		return nil, false
    65  	}
    66  	return o.Command, true
    67  }
    68  
    69  // HasCommand returns a boolean if a field has been set.
    70  func (o *ProfileItem) HasCommand() bool {
    71  	if o != nil && !IsNil(o.Command) {
    72  		return true
    73  	}
    74  
    75  	return false
    76  }
    77  
    78  // SetCommand gets a reference to the given []string and assigns it to the Command field.
    79  func (o *ProfileItem) SetCommand(v []string) {
    80  	o.Command = v
    81  }
    82  
    83  // GetPortMapping returns the PortMapping field value if set, zero value otherwise.
    84  func (o *ProfileItem) GetPortMapping() []string {
    85  	if o == nil || IsNil(o.PortMapping) {
    86  		var ret []string
    87  		return ret
    88  	}
    89  	return o.PortMapping
    90  }
    91  
    92  // GetPortMappingOk returns a tuple with the PortMapping field value if set, nil otherwise
    93  // and a boolean to check if the value has been set.
    94  func (o *ProfileItem) GetPortMappingOk() ([]string, bool) {
    95  	if o == nil || IsNil(o.PortMapping) {
    96  		return nil, false
    97  	}
    98  	return o.PortMapping, true
    99  }
   100  
   101  // HasPortMapping returns a boolean if a field has been set.
   102  func (o *ProfileItem) HasPortMapping() bool {
   103  	if o != nil && !IsNil(o.PortMapping) {
   104  		return true
   105  	}
   106  
   107  	return false
   108  }
   109  
   110  // SetPortMapping gets a reference to the given []string and assigns it to the PortMapping field.
   111  func (o *ProfileItem) SetPortMapping(v []string) {
   112  	o.PortMapping = v
   113  }
   114  
   115  // GetEnviron returns the Environ field value if set, zero value otherwise.
   116  func (o *ProfileItem) GetEnviron() map[string]string {
   117  	if o == nil || IsNil(o.Environ) {
   118  		var ret map[string]string
   119  		return ret
   120  	}
   121  	return *o.Environ
   122  }
   123  
   124  // GetEnvironOk returns a tuple with the Environ field value if set, nil otherwise
   125  // and a boolean to check if the value has been set.
   126  func (o *ProfileItem) GetEnvironOk() (*map[string]string, bool) {
   127  	if o == nil || IsNil(o.Environ) {
   128  		return nil, false
   129  	}
   130  	return o.Environ, true
   131  }
   132  
   133  // HasEnviron returns a boolean if a field has been set.
   134  func (o *ProfileItem) HasEnviron() bool {
   135  	if o != nil && !IsNil(o.Environ) {
   136  		return true
   137  	}
   138  
   139  	return false
   140  }
   141  
   142  // SetEnviron gets a reference to the given map[string]string and assigns it to the Environ field.
   143  func (o *ProfileItem) SetEnviron(v map[string]string) {
   144  	o.Environ = &v
   145  }
   146  
   147  // GetSyncPaths returns the SyncPaths field value if set, zero value otherwise.
   148  func (o *ProfileItem) GetSyncPaths() []SyncPathItem {
   149  	if o == nil || IsNil(o.SyncPaths) {
   150  		var ret []SyncPathItem
   151  		return ret
   152  	}
   153  	return o.SyncPaths
   154  }
   155  
   156  // GetSyncPathsOk returns a tuple with the SyncPaths field value if set, nil otherwise
   157  // and a boolean to check if the value has been set.
   158  func (o *ProfileItem) GetSyncPathsOk() ([]SyncPathItem, bool) {
   159  	if o == nil || IsNil(o.SyncPaths) {
   160  		return nil, false
   161  	}
   162  	return o.SyncPaths, true
   163  }
   164  
   165  // HasSyncPaths returns a boolean if a field has been set.
   166  func (o *ProfileItem) HasSyncPaths() bool {
   167  	if o != nil && !IsNil(o.SyncPaths) {
   168  		return true
   169  	}
   170  
   171  	return false
   172  }
   173  
   174  // SetSyncPaths gets a reference to the given []SyncPathItem and assigns it to the SyncPaths field.
   175  func (o *ProfileItem) SetSyncPaths(v []SyncPathItem) {
   176  	o.SyncPaths = v
   177  }
   178  
   179  // GetRequirements returns the Requirements field value if set, zero value otherwise (both if not set or set to explicit null).
   180  func (o *ProfileItem) GetRequirements() ResourceRequirementItem {
   181  	if o == nil || IsNil(o.Requirements.Get()) {
   182  		var ret ResourceRequirementItem
   183  		return ret
   184  	}
   185  	return *o.Requirements.Get()
   186  }
   187  
   188  // GetRequirementsOk returns a tuple with the Requirements field value if set, nil otherwise
   189  // and a boolean to check if the value has been set.
   190  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   191  func (o *ProfileItem) GetRequirementsOk() (*ResourceRequirementItem, bool) {
   192  	if o == nil {
   193  		return nil, false
   194  	}
   195  	return o.Requirements.Get(), o.Requirements.IsSet()
   196  }
   197  
   198  // HasRequirements returns a boolean if a field has been set.
   199  func (o *ProfileItem) HasRequirements() bool {
   200  	if o != nil && o.Requirements.IsSet() {
   201  		return true
   202  	}
   203  
   204  	return false
   205  }
   206  
   207  // SetRequirements gets a reference to the given NullableResourceRequirementItem and assigns it to the Requirements field.
   208  func (o *ProfileItem) SetRequirements(v ResourceRequirementItem) {
   209  	o.Requirements.Set(&v)
   210  }
   211  
   212  // SetRequirementsNil sets the value for Requirements to be an explicit nil
   213  func (o *ProfileItem) SetRequirementsNil() {
   214  	o.Requirements.Set(nil)
   215  }
   216  
   217  // UnsetRequirements ensures that no value is present for Requirements, not even an explicit nil
   218  func (o *ProfileItem) UnsetRequirements() {
   219  	o.Requirements.Unset()
   220  }
   221  
   222  func (o ProfileItem) MarshalJSON() ([]byte, error) {
   223  	toSerialize, err := o.ToMap()
   224  	if err != nil {
   225  		return []byte{}, err
   226  	}
   227  	return json.Marshal(toSerialize)
   228  }
   229  
   230  func (o ProfileItem) ToMap() (map[string]interface{}, error) {
   231  	toSerialize := map[string]interface{}{}
   232  	if !IsNil(o.Command) {
   233  		toSerialize["command"] = o.Command
   234  	}
   235  	if !IsNil(o.PortMapping) {
   236  		toSerialize["portMapping"] = o.PortMapping
   237  	}
   238  	if !IsNil(o.Environ) {
   239  		toSerialize["environ"] = o.Environ
   240  	}
   241  	if !IsNil(o.SyncPaths) {
   242  		toSerialize["syncPaths"] = o.SyncPaths
   243  	}
   244  	if o.Requirements.IsSet() {
   245  		toSerialize["requirements"] = o.Requirements.Get()
   246  	}
   247  	return toSerialize, nil
   248  }
   249  
   250  type NullableProfileItem struct {
   251  	value *ProfileItem
   252  	isSet bool
   253  }
   254  
   255  func (v NullableProfileItem) Get() *ProfileItem {
   256  	return v.value
   257  }
   258  
   259  func (v *NullableProfileItem) Set(val *ProfileItem) {
   260  	v.value = val
   261  	v.isSet = true
   262  }
   263  
   264  func (v NullableProfileItem) IsSet() bool {
   265  	return v.isSet
   266  }
   267  
   268  func (v *NullableProfileItem) Unset() {
   269  	v.value = nil
   270  	v.isSet = false
   271  }
   272  
   273  func NewNullableProfileItem(val *ProfileItem) *NullableProfileItem {
   274  	return &NullableProfileItem{value: val, isSet: true}
   275  }
   276  
   277  func (v NullableProfileItem) MarshalJSON() ([]byte, error) {
   278  	return json.Marshal(v.value)
   279  }
   280  
   281  func (v *NullableProfileItem) UnmarshalJSON(src []byte) error {
   282  	v.isSet = true
   283  	return json.Unmarshal(src, &v.value)
   284  }