github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_node_request.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  // NodeRequest struct for NodeRequest
    18  type NodeRequest struct {
    19  	Name string `json:"name"`
    20  	ParentNodeId *string `json:"parent_node_id,omitempty"`
    21  }
    22  
    23  // NewNodeRequest instantiates a new NodeRequest object
    24  // This constructor will assign default values to properties that have it defined,
    25  // and makes sure properties required by API are set, but the set of arguments
    26  // will change when the set of required properties is changed
    27  func NewNodeRequest(name string, ) *NodeRequest {
    28  	this := NodeRequest{}
    29  	this.Name = name
    30  	return &this
    31  }
    32  
    33  // NewNodeRequestWithDefaults instantiates a new NodeRequest object
    34  // This constructor will only assign default values to properties that have it defined,
    35  // but it doesn't guarantee that properties required by API are set
    36  func NewNodeRequestWithDefaults() *NodeRequest {
    37  	this := NodeRequest{}
    38  	return &this
    39  }
    40  
    41  // GetName returns the Name field value
    42  func (o *NodeRequest) GetName() string {
    43  	if o == nil  {
    44  		var ret string
    45  		return ret
    46  	}
    47  
    48  	return o.Name
    49  }
    50  
    51  // GetNameOk returns a tuple with the Name field value
    52  // and a boolean to check if the value has been set.
    53  func (o *NodeRequest) GetNameOk() (*string, bool) {
    54  	if o == nil  {
    55  		return nil, false
    56  	}
    57  	return &o.Name, true
    58  }
    59  
    60  // SetName sets field value
    61  func (o *NodeRequest) SetName(v string) {
    62  	o.Name = v
    63  }
    64  
    65  // GetParentNodeId returns the ParentNodeId field value if set, zero value otherwise.
    66  func (o *NodeRequest) GetParentNodeId() string {
    67  	if o == nil || o.ParentNodeId == nil {
    68  		var ret string
    69  		return ret
    70  	}
    71  	return *o.ParentNodeId
    72  }
    73  
    74  // GetParentNodeIdOk returns a tuple with the ParentNodeId field value if set, nil otherwise
    75  // and a boolean to check if the value has been set.
    76  func (o *NodeRequest) GetParentNodeIdOk() (*string, bool) {
    77  	if o == nil || o.ParentNodeId == nil {
    78  		return nil, false
    79  	}
    80  	return o.ParentNodeId, true
    81  }
    82  
    83  // HasParentNodeId returns a boolean if a field has been set.
    84  func (o *NodeRequest) HasParentNodeId() bool {
    85  	if o != nil && o.ParentNodeId != nil {
    86  		return true
    87  	}
    88  
    89  	return false
    90  }
    91  
    92  // SetParentNodeId gets a reference to the given string and assigns it to the ParentNodeId field.
    93  func (o *NodeRequest) SetParentNodeId(v string) {
    94  	o.ParentNodeId = &v
    95  }
    96  
    97  func (o NodeRequest) MarshalJSON() ([]byte, error) {
    98  	toSerialize := map[string]interface{}{}
    99  	if true {
   100  		toSerialize["name"] = o.Name
   101  	}
   102  	if o.ParentNodeId != nil {
   103  		toSerialize["parent_node_id"] = o.ParentNodeId
   104  	}
   105  	return json.Marshal(toSerialize)
   106  }
   107  
   108  type NullableNodeRequest struct {
   109  	value *NodeRequest
   110  	isSet bool
   111  }
   112  
   113  func (v NullableNodeRequest) Get() *NodeRequest {
   114  	return v.value
   115  }
   116  
   117  func (v *NullableNodeRequest) Set(val *NodeRequest) {
   118  	v.value = val
   119  	v.isSet = true
   120  }
   121  
   122  func (v NullableNodeRequest) IsSet() bool {
   123  	return v.isSet
   124  }
   125  
   126  func (v *NullableNodeRequest) Unset() {
   127  	v.value = nil
   128  	v.isSet = false
   129  }
   130  
   131  func NewNullableNodeRequest(val *NodeRequest) *NullableNodeRequest {
   132  	return &NullableNodeRequest{value: val, isSet: true}
   133  }
   134  
   135  func (v NullableNodeRequest) MarshalJSON() ([]byte, error) {
   136  	return json.Marshal(v.value)
   137  }
   138  
   139  func (v *NullableNodeRequest) UnmarshalJSON(src []byte) error {
   140  	v.isSet = true
   141  	return json.Unmarshal(src, &v.value)
   142  }
   143  
   144