bunnyshell.com/sdk@v0.16.0/model_environment_partial_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 EnvironmentPartialAction type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &EnvironmentPartialAction{} 20 21 // EnvironmentPartialAction An environment holds a collection of buildable and deployable components. 22 type EnvironmentPartialAction struct { 23 IsPartial *bool `json:"isPartial,omitempty"` 24 Components []string `json:"components,omitempty"` 25 } 26 27 // NewEnvironmentPartialAction instantiates a new EnvironmentPartialAction object 28 // This constructor will assign default values to properties that have it defined, 29 // and makes sure properties required by API are set, but the set of arguments 30 // will change when the set of required properties is changed 31 func NewEnvironmentPartialAction() *EnvironmentPartialAction { 32 this := EnvironmentPartialAction{} 33 return &this 34 } 35 36 // NewEnvironmentPartialActionWithDefaults instantiates a new EnvironmentPartialAction object 37 // This constructor will only assign default values to properties that have it defined, 38 // but it doesn't guarantee that properties required by API are set 39 func NewEnvironmentPartialActionWithDefaults() *EnvironmentPartialAction { 40 this := EnvironmentPartialAction{} 41 return &this 42 } 43 44 // GetIsPartial returns the IsPartial field value if set, zero value otherwise. 45 func (o *EnvironmentPartialAction) GetIsPartial() bool { 46 if o == nil || IsNil(o.IsPartial) { 47 var ret bool 48 return ret 49 } 50 return *o.IsPartial 51 } 52 53 // GetIsPartialOk returns a tuple with the IsPartial field value if set, nil otherwise 54 // and a boolean to check if the value has been set. 55 func (o *EnvironmentPartialAction) GetIsPartialOk() (*bool, bool) { 56 if o == nil || IsNil(o.IsPartial) { 57 return nil, false 58 } 59 return o.IsPartial, true 60 } 61 62 // HasIsPartial returns a boolean if a field has been set. 63 func (o *EnvironmentPartialAction) HasIsPartial() bool { 64 if o != nil && !IsNil(o.IsPartial) { 65 return true 66 } 67 68 return false 69 } 70 71 // SetIsPartial gets a reference to the given bool and assigns it to the IsPartial field. 72 func (o *EnvironmentPartialAction) SetIsPartial(v bool) { 73 o.IsPartial = &v 74 } 75 76 // GetComponents returns the Components field value if set, zero value otherwise. 77 func (o *EnvironmentPartialAction) GetComponents() []string { 78 if o == nil || IsNil(o.Components) { 79 var ret []string 80 return ret 81 } 82 return o.Components 83 } 84 85 // GetComponentsOk returns a tuple with the Components field value if set, nil otherwise 86 // and a boolean to check if the value has been set. 87 func (o *EnvironmentPartialAction) GetComponentsOk() ([]string, bool) { 88 if o == nil || IsNil(o.Components) { 89 return nil, false 90 } 91 return o.Components, true 92 } 93 94 // HasComponents returns a boolean if a field has been set. 95 func (o *EnvironmentPartialAction) HasComponents() bool { 96 if o != nil && !IsNil(o.Components) { 97 return true 98 } 99 100 return false 101 } 102 103 // SetComponents gets a reference to the given []string and assigns it to the Components field. 104 func (o *EnvironmentPartialAction) SetComponents(v []string) { 105 o.Components = v 106 } 107 108 func (o EnvironmentPartialAction) MarshalJSON() ([]byte, error) { 109 toSerialize, err := o.ToMap() 110 if err != nil { 111 return []byte{}, err 112 } 113 return json.Marshal(toSerialize) 114 } 115 116 func (o EnvironmentPartialAction) ToMap() (map[string]interface{}, error) { 117 toSerialize := map[string]interface{}{} 118 if !IsNil(o.IsPartial) { 119 toSerialize["isPartial"] = o.IsPartial 120 } 121 if !IsNil(o.Components) { 122 toSerialize["components"] = o.Components 123 } 124 return toSerialize, nil 125 } 126 127 type NullableEnvironmentPartialAction struct { 128 value *EnvironmentPartialAction 129 isSet bool 130 } 131 132 func (v NullableEnvironmentPartialAction) Get() *EnvironmentPartialAction { 133 return v.value 134 } 135 136 func (v *NullableEnvironmentPartialAction) Set(val *EnvironmentPartialAction) { 137 v.value = val 138 v.isSet = true 139 } 140 141 func (v NullableEnvironmentPartialAction) IsSet() bool { 142 return v.isSet 143 } 144 145 func (v *NullableEnvironmentPartialAction) Unset() { 146 v.value = nil 147 v.isSet = false 148 } 149 150 func NewNullableEnvironmentPartialAction(val *EnvironmentPartialAction) *NullableEnvironmentPartialAction { 151 return &NullableEnvironmentPartialAction{value: val, isSet: true} 152 } 153 154 func (v NullableEnvironmentPartialAction) MarshalJSON() ([]byte, error) { 155 return json.Marshal(v.value) 156 } 157 158 func (v *NullableEnvironmentPartialAction) UnmarshalJSON(src []byte) error { 159 v.isSet = true 160 return json.Unmarshal(src, &v.value) 161 }