bunnyshell.com/sdk@v0.16.0/model_project_variable_collection.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 ProjectVariableCollection type satisfies the MappedNullable interface at compile time 19 var _ MappedNullable = &ProjectVariableCollection{} 20 21 // ProjectVariableCollection A project variable used during Bunnyshell workflows. 22 type ProjectVariableCollection struct { 23 // Project variable identifier. 24 Id *string `json:"id,omitempty"` 25 // Project variable name. 26 Name *string `json:"name,omitempty"` 27 // Project variable value. 28 Value NullableString `json:"value,omitempty"` 29 // Project variable marked as secret. 30 Secret *bool `json:"secret,omitempty"` 31 // Project identifier. 32 Project *string `json:"project,omitempty"` 33 // Organization identifier. 34 Organization *string `json:"organization,omitempty"` 35 } 36 37 // NewProjectVariableCollection instantiates a new ProjectVariableCollection 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 NewProjectVariableCollection() *ProjectVariableCollection { 42 this := ProjectVariableCollection{} 43 return &this 44 } 45 46 // NewProjectVariableCollectionWithDefaults instantiates a new ProjectVariableCollection object 47 // This constructor will only assign default values to properties that have it defined, 48 // but it doesn't guarantee that properties required by API are set 49 func NewProjectVariableCollectionWithDefaults() *ProjectVariableCollection { 50 this := ProjectVariableCollection{} 51 return &this 52 } 53 54 // GetId returns the Id field value if set, zero value otherwise. 55 func (o *ProjectVariableCollection) GetId() string { 56 if o == nil || IsNil(o.Id) { 57 var ret string 58 return ret 59 } 60 return *o.Id 61 } 62 63 // GetIdOk returns a tuple with the Id field value if set, nil otherwise 64 // and a boolean to check if the value has been set. 65 func (o *ProjectVariableCollection) GetIdOk() (*string, bool) { 66 if o == nil || IsNil(o.Id) { 67 return nil, false 68 } 69 return o.Id, true 70 } 71 72 // HasId returns a boolean if a field has been set. 73 func (o *ProjectVariableCollection) HasId() bool { 74 if o != nil && !IsNil(o.Id) { 75 return true 76 } 77 78 return false 79 } 80 81 // SetId gets a reference to the given string and assigns it to the Id field. 82 func (o *ProjectVariableCollection) SetId(v string) { 83 o.Id = &v 84 } 85 86 // GetName returns the Name field value if set, zero value otherwise. 87 func (o *ProjectVariableCollection) GetName() string { 88 if o == nil || IsNil(o.Name) { 89 var ret string 90 return ret 91 } 92 return *o.Name 93 } 94 95 // GetNameOk returns a tuple with the Name field value if set, nil otherwise 96 // and a boolean to check if the value has been set. 97 func (o *ProjectVariableCollection) GetNameOk() (*string, bool) { 98 if o == nil || IsNil(o.Name) { 99 return nil, false 100 } 101 return o.Name, true 102 } 103 104 // HasName returns a boolean if a field has been set. 105 func (o *ProjectVariableCollection) HasName() bool { 106 if o != nil && !IsNil(o.Name) { 107 return true 108 } 109 110 return false 111 } 112 113 // SetName gets a reference to the given string and assigns it to the Name field. 114 func (o *ProjectVariableCollection) SetName(v string) { 115 o.Name = &v 116 } 117 118 // GetValue returns the Value field value if set, zero value otherwise (both if not set or set to explicit null). 119 func (o *ProjectVariableCollection) GetValue() string { 120 if o == nil || IsNil(o.Value.Get()) { 121 var ret string 122 return ret 123 } 124 return *o.Value.Get() 125 } 126 127 // GetValueOk returns a tuple with the Value field value if set, nil otherwise 128 // and a boolean to check if the value has been set. 129 // NOTE: If the value is an explicit nil, `nil, true` will be returned 130 func (o *ProjectVariableCollection) GetValueOk() (*string, bool) { 131 if o == nil { 132 return nil, false 133 } 134 return o.Value.Get(), o.Value.IsSet() 135 } 136 137 // HasValue returns a boolean if a field has been set. 138 func (o *ProjectVariableCollection) HasValue() bool { 139 if o != nil && o.Value.IsSet() { 140 return true 141 } 142 143 return false 144 } 145 146 // SetValue gets a reference to the given NullableString and assigns it to the Value field. 147 func (o *ProjectVariableCollection) SetValue(v string) { 148 o.Value.Set(&v) 149 } 150 151 // SetValueNil sets the value for Value to be an explicit nil 152 func (o *ProjectVariableCollection) SetValueNil() { 153 o.Value.Set(nil) 154 } 155 156 // UnsetValue ensures that no value is present for Value, not even an explicit nil 157 func (o *ProjectVariableCollection) UnsetValue() { 158 o.Value.Unset() 159 } 160 161 // GetSecret returns the Secret field value if set, zero value otherwise. 162 func (o *ProjectVariableCollection) GetSecret() bool { 163 if o == nil || IsNil(o.Secret) { 164 var ret bool 165 return ret 166 } 167 return *o.Secret 168 } 169 170 // GetSecretOk returns a tuple with the Secret field value if set, nil otherwise 171 // and a boolean to check if the value has been set. 172 func (o *ProjectVariableCollection) GetSecretOk() (*bool, bool) { 173 if o == nil || IsNil(o.Secret) { 174 return nil, false 175 } 176 return o.Secret, true 177 } 178 179 // HasSecret returns a boolean if a field has been set. 180 func (o *ProjectVariableCollection) HasSecret() bool { 181 if o != nil && !IsNil(o.Secret) { 182 return true 183 } 184 185 return false 186 } 187 188 // SetSecret gets a reference to the given bool and assigns it to the Secret field. 189 func (o *ProjectVariableCollection) SetSecret(v bool) { 190 o.Secret = &v 191 } 192 193 // GetProject returns the Project field value if set, zero value otherwise. 194 func (o *ProjectVariableCollection) GetProject() string { 195 if o == nil || IsNil(o.Project) { 196 var ret string 197 return ret 198 } 199 return *o.Project 200 } 201 202 // GetProjectOk returns a tuple with the Project field value if set, nil otherwise 203 // and a boolean to check if the value has been set. 204 func (o *ProjectVariableCollection) GetProjectOk() (*string, bool) { 205 if o == nil || IsNil(o.Project) { 206 return nil, false 207 } 208 return o.Project, true 209 } 210 211 // HasProject returns a boolean if a field has been set. 212 func (o *ProjectVariableCollection) HasProject() bool { 213 if o != nil && !IsNil(o.Project) { 214 return true 215 } 216 217 return false 218 } 219 220 // SetProject gets a reference to the given string and assigns it to the Project field. 221 func (o *ProjectVariableCollection) SetProject(v string) { 222 o.Project = &v 223 } 224 225 // GetOrganization returns the Organization field value if set, zero value otherwise. 226 func (o *ProjectVariableCollection) GetOrganization() string { 227 if o == nil || IsNil(o.Organization) { 228 var ret string 229 return ret 230 } 231 return *o.Organization 232 } 233 234 // GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise 235 // and a boolean to check if the value has been set. 236 func (o *ProjectVariableCollection) GetOrganizationOk() (*string, bool) { 237 if o == nil || IsNil(o.Organization) { 238 return nil, false 239 } 240 return o.Organization, true 241 } 242 243 // HasOrganization returns a boolean if a field has been set. 244 func (o *ProjectVariableCollection) HasOrganization() bool { 245 if o != nil && !IsNil(o.Organization) { 246 return true 247 } 248 249 return false 250 } 251 252 // SetOrganization gets a reference to the given string and assigns it to the Organization field. 253 func (o *ProjectVariableCollection) SetOrganization(v string) { 254 o.Organization = &v 255 } 256 257 func (o ProjectVariableCollection) MarshalJSON() ([]byte, error) { 258 toSerialize, err := o.ToMap() 259 if err != nil { 260 return []byte{}, err 261 } 262 return json.Marshal(toSerialize) 263 } 264 265 func (o ProjectVariableCollection) ToMap() (map[string]interface{}, error) { 266 toSerialize := map[string]interface{}{} 267 if !IsNil(o.Id) { 268 toSerialize["id"] = o.Id 269 } 270 if !IsNil(o.Name) { 271 toSerialize["name"] = o.Name 272 } 273 if o.Value.IsSet() { 274 toSerialize["value"] = o.Value.Get() 275 } 276 if !IsNil(o.Secret) { 277 toSerialize["secret"] = o.Secret 278 } 279 if !IsNil(o.Project) { 280 toSerialize["project"] = o.Project 281 } 282 if !IsNil(o.Organization) { 283 toSerialize["organization"] = o.Organization 284 } 285 return toSerialize, nil 286 } 287 288 type NullableProjectVariableCollection struct { 289 value *ProjectVariableCollection 290 isSet bool 291 } 292 293 func (v NullableProjectVariableCollection) Get() *ProjectVariableCollection { 294 return v.value 295 } 296 297 func (v *NullableProjectVariableCollection) Set(val *ProjectVariableCollection) { 298 v.value = val 299 v.isSet = true 300 } 301 302 func (v NullableProjectVariableCollection) IsSet() bool { 303 return v.isSet 304 } 305 306 func (v *NullableProjectVariableCollection) Unset() { 307 v.value = nil 308 v.isSet = false 309 } 310 311 func NewNullableProjectVariableCollection(val *ProjectVariableCollection) *NullableProjectVariableCollection { 312 return &NullableProjectVariableCollection{value: val, isSet: true} 313 } 314 315 func (v NullableProjectVariableCollection) MarshalJSON() ([]byte, error) { 316 return json.Marshal(v.value) 317 } 318 319 func (v *NullableProjectVariableCollection) UnmarshalJSON(src []byte) error { 320 v.isSet = true 321 return json.Unmarshal(src, &v.value) 322 }