github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_node.go (about) 1 /* 2 * Cios Openapi 3 * 4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 5 * 6 * API version: 1.0.1 7 */ 8 9 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. 10 11 package cios 12 13 import ( 14 "encoding/json" 15 ) 16 17 // Node struct for Node 18 type Node struct { 19 Id string `json:"id"` 20 CreatedAt string `json:"created_at"` 21 CreatedBy *CreatedBy `json:"created_by,omitempty"` 22 UpdatedAt string `json:"updated_at"` 23 UpdatedBy *UpdatedBy `json:"updated_by,omitempty"` 24 Name string `json:"name"` 25 ParentNodeId NullableString `json:"parent_node_id,omitempty"` 26 Key string `json:"key"` 27 IsDirectory bool `json:"is_directory"` 28 File *NodeFile `json:"file,omitempty"` 29 } 30 31 // NewNode instantiates a new Node object 32 // This constructor will assign default values to properties that have it defined, 33 // and makes sure properties required by API are set, but the set of arguments 34 // will change when the set of required properties is changed 35 func NewNode(id string, createdAt string, updatedAt string, name string, key string, isDirectory bool, ) *Node { 36 this := Node{} 37 this.Id = id 38 this.CreatedAt = createdAt 39 this.UpdatedAt = updatedAt 40 this.Name = name 41 this.Key = key 42 this.IsDirectory = isDirectory 43 return &this 44 } 45 46 // NewNodeWithDefaults instantiates a new Node 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 NewNodeWithDefaults() *Node { 50 this := Node{} 51 return &this 52 } 53 54 // GetId returns the Id field value 55 func (o *Node) GetId() string { 56 if o == nil { 57 var ret string 58 return ret 59 } 60 61 return o.Id 62 } 63 64 // GetIdOk returns a tuple with the Id field value 65 // and a boolean to check if the value has been set. 66 func (o *Node) GetIdOk() (*string, bool) { 67 if o == nil { 68 return nil, false 69 } 70 return &o.Id, true 71 } 72 73 // SetId sets field value 74 func (o *Node) SetId(v string) { 75 o.Id = v 76 } 77 78 // GetCreatedAt returns the CreatedAt field value 79 func (o *Node) GetCreatedAt() string { 80 if o == nil { 81 var ret string 82 return ret 83 } 84 85 return o.CreatedAt 86 } 87 88 // GetCreatedAtOk returns a tuple with the CreatedAt field value 89 // and a boolean to check if the value has been set. 90 func (o *Node) GetCreatedAtOk() (*string, bool) { 91 if o == nil { 92 return nil, false 93 } 94 return &o.CreatedAt, true 95 } 96 97 // SetCreatedAt sets field value 98 func (o *Node) SetCreatedAt(v string) { 99 o.CreatedAt = v 100 } 101 102 // GetCreatedBy returns the CreatedBy field value if set, zero value otherwise. 103 func (o *Node) GetCreatedBy() CreatedBy { 104 if o == nil || o.CreatedBy == nil { 105 var ret CreatedBy 106 return ret 107 } 108 return *o.CreatedBy 109 } 110 111 // GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise 112 // and a boolean to check if the value has been set. 113 func (o *Node) GetCreatedByOk() (*CreatedBy, bool) { 114 if o == nil || o.CreatedBy == nil { 115 return nil, false 116 } 117 return o.CreatedBy, true 118 } 119 120 // HasCreatedBy returns a boolean if a field has been set. 121 func (o *Node) HasCreatedBy() bool { 122 if o != nil && o.CreatedBy != nil { 123 return true 124 } 125 126 return false 127 } 128 129 // SetCreatedBy gets a reference to the given CreatedBy and assigns it to the CreatedBy field. 130 func (o *Node) SetCreatedBy(v CreatedBy) { 131 o.CreatedBy = &v 132 } 133 134 // GetUpdatedAt returns the UpdatedAt field value 135 func (o *Node) GetUpdatedAt() string { 136 if o == nil { 137 var ret string 138 return ret 139 } 140 141 return o.UpdatedAt 142 } 143 144 // GetUpdatedAtOk returns a tuple with the UpdatedAt field value 145 // and a boolean to check if the value has been set. 146 func (o *Node) GetUpdatedAtOk() (*string, bool) { 147 if o == nil { 148 return nil, false 149 } 150 return &o.UpdatedAt, true 151 } 152 153 // SetUpdatedAt sets field value 154 func (o *Node) SetUpdatedAt(v string) { 155 o.UpdatedAt = v 156 } 157 158 // GetUpdatedBy returns the UpdatedBy field value if set, zero value otherwise. 159 func (o *Node) GetUpdatedBy() UpdatedBy { 160 if o == nil || o.UpdatedBy == nil { 161 var ret UpdatedBy 162 return ret 163 } 164 return *o.UpdatedBy 165 } 166 167 // GetUpdatedByOk returns a tuple with the UpdatedBy field value if set, nil otherwise 168 // and a boolean to check if the value has been set. 169 func (o *Node) GetUpdatedByOk() (*UpdatedBy, bool) { 170 if o == nil || o.UpdatedBy == nil { 171 return nil, false 172 } 173 return o.UpdatedBy, true 174 } 175 176 // HasUpdatedBy returns a boolean if a field has been set. 177 func (o *Node) HasUpdatedBy() bool { 178 if o != nil && o.UpdatedBy != nil { 179 return true 180 } 181 182 return false 183 } 184 185 // SetUpdatedBy gets a reference to the given UpdatedBy and assigns it to the UpdatedBy field. 186 func (o *Node) SetUpdatedBy(v UpdatedBy) { 187 o.UpdatedBy = &v 188 } 189 190 // GetName returns the Name field value 191 func (o *Node) GetName() string { 192 if o == nil { 193 var ret string 194 return ret 195 } 196 197 return o.Name 198 } 199 200 // GetNameOk returns a tuple with the Name field value 201 // and a boolean to check if the value has been set. 202 func (o *Node) GetNameOk() (*string, bool) { 203 if o == nil { 204 return nil, false 205 } 206 return &o.Name, true 207 } 208 209 // SetName sets field value 210 func (o *Node) SetName(v string) { 211 o.Name = v 212 } 213 214 // GetParentNodeId returns the ParentNodeId field value if set, zero value otherwise (both if not set or set to explicit null). 215 func (o *Node) GetParentNodeId() string { 216 if o == nil || o.ParentNodeId.Get() == nil { 217 var ret string 218 return ret 219 } 220 return *o.ParentNodeId.Get() 221 } 222 223 // GetParentNodeIdOk returns a tuple with the ParentNodeId field value if set, nil otherwise 224 // and a boolean to check if the value has been set. 225 // NOTE: If the value is an explicit nil, `nil, true` will be returned 226 func (o *Node) GetParentNodeIdOk() (*string, bool) { 227 if o == nil { 228 return nil, false 229 } 230 return o.ParentNodeId.Get(), o.ParentNodeId.IsSet() 231 } 232 233 // HasParentNodeId returns a boolean if a field has been set. 234 func (o *Node) HasParentNodeId() bool { 235 if o != nil && o.ParentNodeId.IsSet() { 236 return true 237 } 238 239 return false 240 } 241 242 // SetParentNodeId gets a reference to the given NullableString and assigns it to the ParentNodeId field. 243 func (o *Node) SetParentNodeId(v string) { 244 o.ParentNodeId.Set(&v) 245 } 246 // SetParentNodeIdNil sets the value for ParentNodeId to be an explicit nil 247 func (o *Node) SetParentNodeIdNil() { 248 o.ParentNodeId.Set(nil) 249 } 250 251 // UnsetParentNodeId ensures that no value is present for ParentNodeId, not even an explicit nil 252 func (o *Node) UnsetParentNodeId() { 253 o.ParentNodeId.Unset() 254 } 255 256 // GetKey returns the Key field value 257 func (o *Node) GetKey() string { 258 if o == nil { 259 var ret string 260 return ret 261 } 262 263 return o.Key 264 } 265 266 // GetKeyOk returns a tuple with the Key field value 267 // and a boolean to check if the value has been set. 268 func (o *Node) GetKeyOk() (*string, bool) { 269 if o == nil { 270 return nil, false 271 } 272 return &o.Key, true 273 } 274 275 // SetKey sets field value 276 func (o *Node) SetKey(v string) { 277 o.Key = v 278 } 279 280 // GetIsDirectory returns the IsDirectory field value 281 func (o *Node) GetIsDirectory() bool { 282 if o == nil { 283 var ret bool 284 return ret 285 } 286 287 return o.IsDirectory 288 } 289 290 // GetIsDirectoryOk returns a tuple with the IsDirectory field value 291 // and a boolean to check if the value has been set. 292 func (o *Node) GetIsDirectoryOk() (*bool, bool) { 293 if o == nil { 294 return nil, false 295 } 296 return &o.IsDirectory, true 297 } 298 299 // SetIsDirectory sets field value 300 func (o *Node) SetIsDirectory(v bool) { 301 o.IsDirectory = v 302 } 303 304 // GetFile returns the File field value if set, zero value otherwise. 305 func (o *Node) GetFile() NodeFile { 306 if o == nil || o.File == nil { 307 var ret NodeFile 308 return ret 309 } 310 return *o.File 311 } 312 313 // GetFileOk returns a tuple with the File field value if set, nil otherwise 314 // and a boolean to check if the value has been set. 315 func (o *Node) GetFileOk() (*NodeFile, bool) { 316 if o == nil || o.File == nil { 317 return nil, false 318 } 319 return o.File, true 320 } 321 322 // HasFile returns a boolean if a field has been set. 323 func (o *Node) HasFile() bool { 324 if o != nil && o.File != nil { 325 return true 326 } 327 328 return false 329 } 330 331 // SetFile gets a reference to the given NodeFile and assigns it to the File field. 332 func (o *Node) SetFile(v NodeFile) { 333 o.File = &v 334 } 335 336 func (o Node) MarshalJSON() ([]byte, error) { 337 toSerialize := map[string]interface{}{} 338 if true { 339 toSerialize["id"] = o.Id 340 } 341 if true { 342 toSerialize["created_at"] = o.CreatedAt 343 } 344 if o.CreatedBy != nil { 345 toSerialize["created_by"] = o.CreatedBy 346 } 347 if true { 348 toSerialize["updated_at"] = o.UpdatedAt 349 } 350 if o.UpdatedBy != nil { 351 toSerialize["updated_by"] = o.UpdatedBy 352 } 353 if true { 354 toSerialize["name"] = o.Name 355 } 356 if o.ParentNodeId.IsSet() { 357 toSerialize["parent_node_id"] = o.ParentNodeId.Get() 358 } 359 if true { 360 toSerialize["key"] = o.Key 361 } 362 if true { 363 toSerialize["is_directory"] = o.IsDirectory 364 } 365 if o.File != nil { 366 toSerialize["file"] = o.File 367 } 368 return json.Marshal(toSerialize) 369 } 370 371 type NullableNode struct { 372 value *Node 373 isSet bool 374 } 375 376 func (v NullableNode) Get() *Node { 377 return v.value 378 } 379 380 func (v *NullableNode) Set(val *Node) { 381 v.value = val 382 v.isSet = true 383 } 384 385 func (v NullableNode) IsSet() bool { 386 return v.isSet 387 } 388 389 func (v *NullableNode) Unset() { 390 v.value = nil 391 v.isSet = false 392 } 393 394 func NewNullableNode(val *Node) *NullableNode { 395 return &NullableNode{value: val, isSet: true} 396 } 397 398 func (v NullableNode) MarshalJSON() ([]byte, error) { 399 return json.Marshal(v.value) 400 } 401 402 func (v *NullableNode) UnmarshalJSON(src []byte) error { 403 v.isSet = true 404 return json.Unmarshal(src, &v.value) 405 } 406 407