github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_device_entities_component.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  // DeviceEntitiesComponent struct for DeviceEntitiesComponent
    18  type DeviceEntitiesComponent struct {
    19  	Id string `json:"id"`
    20  	Type ComponentTypeEnum `json:"type"`
    21  	ParentId *string `json:"parent_id,omitempty"`
    22  	Attribute *map[string]interface{} `json:"attribute,omitempty"`
    23  	DisplayInfo *[]DisplayInfo `json:"display_info,omitempty"`
    24  	Components *[]DeviceEntitiesComponent `json:"components,omitempty"`
    25  }
    26  
    27  // NewDeviceEntitiesComponent instantiates a new DeviceEntitiesComponent 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 NewDeviceEntitiesComponent(id string, type_ ComponentTypeEnum, ) *DeviceEntitiesComponent {
    32  	this := DeviceEntitiesComponent{}
    33  	this.Id = id
    34  	this.Type = type_
    35  	return &this
    36  }
    37  
    38  // NewDeviceEntitiesComponentWithDefaults instantiates a new DeviceEntitiesComponent object
    39  // This constructor will only assign default values to properties that have it defined,
    40  // but it doesn't guarantee that properties required by API are set
    41  func NewDeviceEntitiesComponentWithDefaults() *DeviceEntitiesComponent {
    42  	this := DeviceEntitiesComponent{}
    43  	return &this
    44  }
    45  
    46  // GetId returns the Id field value
    47  func (o *DeviceEntitiesComponent) GetId() string {
    48  	if o == nil  {
    49  		var ret string
    50  		return ret
    51  	}
    52  
    53  	return o.Id
    54  }
    55  
    56  // GetIdOk returns a tuple with the Id field value
    57  // and a boolean to check if the value has been set.
    58  func (o *DeviceEntitiesComponent) GetIdOk() (*string, bool) {
    59  	if o == nil  {
    60  		return nil, false
    61  	}
    62  	return &o.Id, true
    63  }
    64  
    65  // SetId sets field value
    66  func (o *DeviceEntitiesComponent) SetId(v string) {
    67  	o.Id = v
    68  }
    69  
    70  // GetType returns the Type field value
    71  func (o *DeviceEntitiesComponent) GetType() ComponentTypeEnum {
    72  	if o == nil  {
    73  		var ret ComponentTypeEnum
    74  		return ret
    75  	}
    76  
    77  	return o.Type
    78  }
    79  
    80  // GetTypeOk returns a tuple with the Type field value
    81  // and a boolean to check if the value has been set.
    82  func (o *DeviceEntitiesComponent) GetTypeOk() (*ComponentTypeEnum, bool) {
    83  	if o == nil  {
    84  		return nil, false
    85  	}
    86  	return &o.Type, true
    87  }
    88  
    89  // SetType sets field value
    90  func (o *DeviceEntitiesComponent) SetType(v ComponentTypeEnum) {
    91  	o.Type = v
    92  }
    93  
    94  // GetParentId returns the ParentId field value if set, zero value otherwise.
    95  func (o *DeviceEntitiesComponent) GetParentId() string {
    96  	if o == nil || o.ParentId == nil {
    97  		var ret string
    98  		return ret
    99  	}
   100  	return *o.ParentId
   101  }
   102  
   103  // GetParentIdOk returns a tuple with the ParentId field value if set, nil otherwise
   104  // and a boolean to check if the value has been set.
   105  func (o *DeviceEntitiesComponent) GetParentIdOk() (*string, bool) {
   106  	if o == nil || o.ParentId == nil {
   107  		return nil, false
   108  	}
   109  	return o.ParentId, true
   110  }
   111  
   112  // HasParentId returns a boolean if a field has been set.
   113  func (o *DeviceEntitiesComponent) HasParentId() bool {
   114  	if o != nil && o.ParentId != nil {
   115  		return true
   116  	}
   117  
   118  	return false
   119  }
   120  
   121  // SetParentId gets a reference to the given string and assigns it to the ParentId field.
   122  func (o *DeviceEntitiesComponent) SetParentId(v string) {
   123  	o.ParentId = &v
   124  }
   125  
   126  // GetAttribute returns the Attribute field value if set, zero value otherwise.
   127  func (o *DeviceEntitiesComponent) GetAttribute() map[string]interface{} {
   128  	if o == nil || o.Attribute == nil {
   129  		var ret map[string]interface{}
   130  		return ret
   131  	}
   132  	return *o.Attribute
   133  }
   134  
   135  // GetAttributeOk returns a tuple with the Attribute field value if set, nil otherwise
   136  // and a boolean to check if the value has been set.
   137  func (o *DeviceEntitiesComponent) GetAttributeOk() (*map[string]interface{}, bool) {
   138  	if o == nil || o.Attribute == nil {
   139  		return nil, false
   140  	}
   141  	return o.Attribute, true
   142  }
   143  
   144  // HasAttribute returns a boolean if a field has been set.
   145  func (o *DeviceEntitiesComponent) HasAttribute() bool {
   146  	if o != nil && o.Attribute != nil {
   147  		return true
   148  	}
   149  
   150  	return false
   151  }
   152  
   153  // SetAttribute gets a reference to the given map[string]interface{} and assigns it to the Attribute field.
   154  func (o *DeviceEntitiesComponent) SetAttribute(v map[string]interface{}) {
   155  	o.Attribute = &v
   156  }
   157  
   158  // GetDisplayInfo returns the DisplayInfo field value if set, zero value otherwise.
   159  func (o *DeviceEntitiesComponent) GetDisplayInfo() []DisplayInfo {
   160  	if o == nil || o.DisplayInfo == nil {
   161  		var ret []DisplayInfo
   162  		return ret
   163  	}
   164  	return *o.DisplayInfo
   165  }
   166  
   167  // GetDisplayInfoOk returns a tuple with the DisplayInfo field value if set, nil otherwise
   168  // and a boolean to check if the value has been set.
   169  func (o *DeviceEntitiesComponent) GetDisplayInfoOk() (*[]DisplayInfo, bool) {
   170  	if o == nil || o.DisplayInfo == nil {
   171  		return nil, false
   172  	}
   173  	return o.DisplayInfo, true
   174  }
   175  
   176  // HasDisplayInfo returns a boolean if a field has been set.
   177  func (o *DeviceEntitiesComponent) HasDisplayInfo() bool {
   178  	if o != nil && o.DisplayInfo != nil {
   179  		return true
   180  	}
   181  
   182  	return false
   183  }
   184  
   185  // SetDisplayInfo gets a reference to the given []DisplayInfo and assigns it to the DisplayInfo field.
   186  func (o *DeviceEntitiesComponent) SetDisplayInfo(v []DisplayInfo) {
   187  	o.DisplayInfo = &v
   188  }
   189  
   190  // GetComponents returns the Components field value if set, zero value otherwise.
   191  func (o *DeviceEntitiesComponent) GetComponents() []DeviceEntitiesComponent {
   192  	if o == nil || o.Components == nil {
   193  		var ret []DeviceEntitiesComponent
   194  		return ret
   195  	}
   196  	return *o.Components
   197  }
   198  
   199  // GetComponentsOk returns a tuple with the Components field value if set, nil otherwise
   200  // and a boolean to check if the value has been set.
   201  func (o *DeviceEntitiesComponent) GetComponentsOk() (*[]DeviceEntitiesComponent, bool) {
   202  	if o == nil || o.Components == nil {
   203  		return nil, false
   204  	}
   205  	return o.Components, true
   206  }
   207  
   208  // HasComponents returns a boolean if a field has been set.
   209  func (o *DeviceEntitiesComponent) HasComponents() bool {
   210  	if o != nil && o.Components != nil {
   211  		return true
   212  	}
   213  
   214  	return false
   215  }
   216  
   217  // SetComponents gets a reference to the given []DeviceEntitiesComponent and assigns it to the Components field.
   218  func (o *DeviceEntitiesComponent) SetComponents(v []DeviceEntitiesComponent) {
   219  	o.Components = &v
   220  }
   221  
   222  func (o DeviceEntitiesComponent) MarshalJSON() ([]byte, error) {
   223  	toSerialize := map[string]interface{}{}
   224  	if true {
   225  		toSerialize["id"] = o.Id
   226  	}
   227  	if true {
   228  		toSerialize["type"] = o.Type
   229  	}
   230  	if o.ParentId != nil {
   231  		toSerialize["parent_id"] = o.ParentId
   232  	}
   233  	if o.Attribute != nil {
   234  		toSerialize["attribute"] = o.Attribute
   235  	}
   236  	if o.DisplayInfo != nil {
   237  		toSerialize["display_info"] = o.DisplayInfo
   238  	}
   239  	if o.Components != nil {
   240  		toSerialize["components"] = o.Components
   241  	}
   242  	return json.Marshal(toSerialize)
   243  }
   244  
   245  type NullableDeviceEntitiesComponent struct {
   246  	value *DeviceEntitiesComponent
   247  	isSet bool
   248  }
   249  
   250  func (v NullableDeviceEntitiesComponent) Get() *DeviceEntitiesComponent {
   251  	return v.value
   252  }
   253  
   254  func (v *NullableDeviceEntitiesComponent) Set(val *DeviceEntitiesComponent) {
   255  	v.value = val
   256  	v.isSet = true
   257  }
   258  
   259  func (v NullableDeviceEntitiesComponent) IsSet() bool {
   260  	return v.isSet
   261  }
   262  
   263  func (v *NullableDeviceEntitiesComponent) Unset() {
   264  	v.value = nil
   265  	v.isSet = false
   266  }
   267  
   268  func NewNullableDeviceEntitiesComponent(val *DeviceEntitiesComponent) *NullableDeviceEntitiesComponent {
   269  	return &NullableDeviceEntitiesComponent{value: val, isSet: true}
   270  }
   271  
   272  func (v NullableDeviceEntitiesComponent) MarshalJSON() ([]byte, error) {
   273  	return json.Marshal(v.value)
   274  }
   275  
   276  func (v *NullableDeviceEntitiesComponent) UnmarshalJSON(src []byte) error {
   277  	v.isSet = true
   278  	return json.Unmarshal(src, &v.value)
   279  }
   280  
   281