bunnyshell.com/sdk@v0.16.0/model_component_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 ComponentProfileItem type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ComponentProfileItem{} 20 21 // ComponentProfileItem A service component represents either an application or a group of applications as a single unit 22 type ComponentProfileItem 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 // NewComponentProfileItem instantiates a new ComponentProfileItem 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 NewComponentProfileItem() *ComponentProfileItem { 39 this := ComponentProfileItem{} 40 return &this 41 } 42 43 // NewComponentProfileItemWithDefaults instantiates a new ComponentProfileItem 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 NewComponentProfileItemWithDefaults() *ComponentProfileItem { 47 this := ComponentProfileItem{} 48 return &this 49 } 50 51 // GetCommand returns the Command field value if set, zero value otherwise. 52 func (o *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) SetCommand(v []string) { 80 o.Command = v 81 } 82 83 // GetPortMapping returns the PortMapping field value if set, zero value otherwise. 84 func (o *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) SetPortMapping(v []string) { 112 o.PortMapping = v 113 } 114 115 // GetEnviron returns the Environ field value if set, zero value otherwise. 116 func (o *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) 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 *ComponentProfileItem) UnsetRequirements() { 219 o.Requirements.Unset() 220 } 221 222 func (o ComponentProfileItem) 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 ComponentProfileItem) 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 NullableComponentProfileItem struct { 251 value *ComponentProfileItem 252 isSet bool 253 } 254 255 func (v NullableComponentProfileItem) Get() *ComponentProfileItem { 256 return v.value 257 } 258 259 func (v *NullableComponentProfileItem) Set(val *ComponentProfileItem) { 260 v.value = val 261 v.isSet = true 262 } 263 264 func (v NullableComponentProfileItem) IsSet() bool { 265 return v.isSet 266 } 267 268 func (v *NullableComponentProfileItem) Unset() { 269 v.value = nil 270 v.isSet = false 271 } 272 273 func NewNullableComponentProfileItem(val *ComponentProfileItem) *NullableComponentProfileItem { 274 return &NullableComponentProfileItem{value: val, isSet: true} 275 } 276 277 func (v NullableComponentProfileItem) MarshalJSON() ([]byte, error) { 278 return json.Marshal(v.value) 279 } 280 281 func (v *NullableComponentProfileItem) UnmarshalJSON(src []byte) error { 282 v.isSet = true 283 return json.Unmarshal(src, &v.value) 284 }