github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_device_models_entity.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  // DeviceModelsEntity struct for DeviceModelsEntity
    18  type DeviceModelsEntity struct {
    19  	Id string `json:"id"`
    20  	Key string `json:"key"`
    21  	DeviceId string `json:"device_id"`
    22  	Model DeviceModelsEntityModel `json:"model"`
    23  	SerialNumber *string `json:"serial_number,omitempty"`
    24  	// ナノ秒
    25  	StartAt NullableString `json:"start_at,omitempty"`
    26  	CustomInventory *[]map[string]interface{} `json:"custom_inventory,omitempty"`
    27  	ResourceOwnerId string `json:"resource_owner_id"`
    28  	Watch NullableWatch `json:"watch,omitempty"`
    29  	Components NullableDeviceEntitiesComponent `json:"components,omitempty"`
    30  	CreatedAt string `json:"created_at"`
    31  	UpdatedAt string `json:"updated_at"`
    32  }
    33  
    34  // NewDeviceModelsEntity instantiates a new DeviceModelsEntity object
    35  // This constructor will assign default values to properties that have it defined,
    36  // and makes sure properties required by API are set, but the set of arguments
    37  // will change when the set of required properties is changed
    38  func NewDeviceModelsEntity(id string, key string, deviceId string, model DeviceModelsEntityModel, resourceOwnerId string, createdAt string, updatedAt string, ) *DeviceModelsEntity {
    39  	this := DeviceModelsEntity{}
    40  	this.Id = id
    41  	this.Key = key
    42  	this.DeviceId = deviceId
    43  	this.Model = model
    44  	this.ResourceOwnerId = resourceOwnerId
    45  	this.CreatedAt = createdAt
    46  	this.UpdatedAt = updatedAt
    47  	return &this
    48  }
    49  
    50  // NewDeviceModelsEntityWithDefaults instantiates a new DeviceModelsEntity object
    51  // This constructor will only assign default values to properties that have it defined,
    52  // but it doesn't guarantee that properties required by API are set
    53  func NewDeviceModelsEntityWithDefaults() *DeviceModelsEntity {
    54  	this := DeviceModelsEntity{}
    55  	return &this
    56  }
    57  
    58  // GetId returns the Id field value
    59  func (o *DeviceModelsEntity) GetId() string {
    60  	if o == nil  {
    61  		var ret string
    62  		return ret
    63  	}
    64  
    65  	return o.Id
    66  }
    67  
    68  // GetIdOk returns a tuple with the Id field value
    69  // and a boolean to check if the value has been set.
    70  func (o *DeviceModelsEntity) GetIdOk() (*string, bool) {
    71  	if o == nil  {
    72  		return nil, false
    73  	}
    74  	return &o.Id, true
    75  }
    76  
    77  // SetId sets field value
    78  func (o *DeviceModelsEntity) SetId(v string) {
    79  	o.Id = v
    80  }
    81  
    82  // GetKey returns the Key field value
    83  func (o *DeviceModelsEntity) GetKey() string {
    84  	if o == nil  {
    85  		var ret string
    86  		return ret
    87  	}
    88  
    89  	return o.Key
    90  }
    91  
    92  // GetKeyOk returns a tuple with the Key field value
    93  // and a boolean to check if the value has been set.
    94  func (o *DeviceModelsEntity) GetKeyOk() (*string, bool) {
    95  	if o == nil  {
    96  		return nil, false
    97  	}
    98  	return &o.Key, true
    99  }
   100  
   101  // SetKey sets field value
   102  func (o *DeviceModelsEntity) SetKey(v string) {
   103  	o.Key = v
   104  }
   105  
   106  // GetDeviceId returns the DeviceId field value
   107  func (o *DeviceModelsEntity) GetDeviceId() string {
   108  	if o == nil  {
   109  		var ret string
   110  		return ret
   111  	}
   112  
   113  	return o.DeviceId
   114  }
   115  
   116  // GetDeviceIdOk returns a tuple with the DeviceId field value
   117  // and a boolean to check if the value has been set.
   118  func (o *DeviceModelsEntity) GetDeviceIdOk() (*string, bool) {
   119  	if o == nil  {
   120  		return nil, false
   121  	}
   122  	return &o.DeviceId, true
   123  }
   124  
   125  // SetDeviceId sets field value
   126  func (o *DeviceModelsEntity) SetDeviceId(v string) {
   127  	o.DeviceId = v
   128  }
   129  
   130  // GetModel returns the Model field value
   131  func (o *DeviceModelsEntity) GetModel() DeviceModelsEntityModel {
   132  	if o == nil  {
   133  		var ret DeviceModelsEntityModel
   134  		return ret
   135  	}
   136  
   137  	return o.Model
   138  }
   139  
   140  // GetModelOk returns a tuple with the Model field value
   141  // and a boolean to check if the value has been set.
   142  func (o *DeviceModelsEntity) GetModelOk() (*DeviceModelsEntityModel, bool) {
   143  	if o == nil  {
   144  		return nil, false
   145  	}
   146  	return &o.Model, true
   147  }
   148  
   149  // SetModel sets field value
   150  func (o *DeviceModelsEntity) SetModel(v DeviceModelsEntityModel) {
   151  	o.Model = v
   152  }
   153  
   154  // GetSerialNumber returns the SerialNumber field value if set, zero value otherwise.
   155  func (o *DeviceModelsEntity) GetSerialNumber() string {
   156  	if o == nil || o.SerialNumber == nil {
   157  		var ret string
   158  		return ret
   159  	}
   160  	return *o.SerialNumber
   161  }
   162  
   163  // GetSerialNumberOk returns a tuple with the SerialNumber field value if set, nil otherwise
   164  // and a boolean to check if the value has been set.
   165  func (o *DeviceModelsEntity) GetSerialNumberOk() (*string, bool) {
   166  	if o == nil || o.SerialNumber == nil {
   167  		return nil, false
   168  	}
   169  	return o.SerialNumber, true
   170  }
   171  
   172  // HasSerialNumber returns a boolean if a field has been set.
   173  func (o *DeviceModelsEntity) HasSerialNumber() bool {
   174  	if o != nil && o.SerialNumber != nil {
   175  		return true
   176  	}
   177  
   178  	return false
   179  }
   180  
   181  // SetSerialNumber gets a reference to the given string and assigns it to the SerialNumber field.
   182  func (o *DeviceModelsEntity) SetSerialNumber(v string) {
   183  	o.SerialNumber = &v
   184  }
   185  
   186  // GetStartAt returns the StartAt field value if set, zero value otherwise (both if not set or set to explicit null).
   187  func (o *DeviceModelsEntity) GetStartAt() string {
   188  	if o == nil || o.StartAt.Get() == nil {
   189  		var ret string
   190  		return ret
   191  	}
   192  	return *o.StartAt.Get()
   193  }
   194  
   195  // GetStartAtOk returns a tuple with the StartAt field value if set, nil otherwise
   196  // and a boolean to check if the value has been set.
   197  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   198  func (o *DeviceModelsEntity) GetStartAtOk() (*string, bool) {
   199  	if o == nil  {
   200  		return nil, false
   201  	}
   202  	return o.StartAt.Get(), o.StartAt.IsSet()
   203  }
   204  
   205  // HasStartAt returns a boolean if a field has been set.
   206  func (o *DeviceModelsEntity) HasStartAt() bool {
   207  	if o != nil && o.StartAt.IsSet() {
   208  		return true
   209  	}
   210  
   211  	return false
   212  }
   213  
   214  // SetStartAt gets a reference to the given NullableString and assigns it to the StartAt field.
   215  func (o *DeviceModelsEntity) SetStartAt(v string) {
   216  	o.StartAt.Set(&v)
   217  }
   218  // SetStartAtNil sets the value for StartAt to be an explicit nil
   219  func (o *DeviceModelsEntity) SetStartAtNil() {
   220  	o.StartAt.Set(nil)
   221  }
   222  
   223  // UnsetStartAt ensures that no value is present for StartAt, not even an explicit nil
   224  func (o *DeviceModelsEntity) UnsetStartAt() {
   225  	o.StartAt.Unset()
   226  }
   227  
   228  // GetCustomInventory returns the CustomInventory field value if set, zero value otherwise.
   229  func (o *DeviceModelsEntity) GetCustomInventory() []map[string]interface{} {
   230  	if o == nil || o.CustomInventory == nil {
   231  		var ret []map[string]interface{}
   232  		return ret
   233  	}
   234  	return *o.CustomInventory
   235  }
   236  
   237  // GetCustomInventoryOk returns a tuple with the CustomInventory field value if set, nil otherwise
   238  // and a boolean to check if the value has been set.
   239  func (o *DeviceModelsEntity) GetCustomInventoryOk() (*[]map[string]interface{}, bool) {
   240  	if o == nil || o.CustomInventory == nil {
   241  		return nil, false
   242  	}
   243  	return o.CustomInventory, true
   244  }
   245  
   246  // HasCustomInventory returns a boolean if a field has been set.
   247  func (o *DeviceModelsEntity) HasCustomInventory() bool {
   248  	if o != nil && o.CustomInventory != nil {
   249  		return true
   250  	}
   251  
   252  	return false
   253  }
   254  
   255  // SetCustomInventory gets a reference to the given []map[string]interface{} and assigns it to the CustomInventory field.
   256  func (o *DeviceModelsEntity) SetCustomInventory(v []map[string]interface{}) {
   257  	o.CustomInventory = &v
   258  }
   259  
   260  // GetResourceOwnerId returns the ResourceOwnerId field value
   261  func (o *DeviceModelsEntity) GetResourceOwnerId() string {
   262  	if o == nil  {
   263  		var ret string
   264  		return ret
   265  	}
   266  
   267  	return o.ResourceOwnerId
   268  }
   269  
   270  // GetResourceOwnerIdOk returns a tuple with the ResourceOwnerId field value
   271  // and a boolean to check if the value has been set.
   272  func (o *DeviceModelsEntity) GetResourceOwnerIdOk() (*string, bool) {
   273  	if o == nil  {
   274  		return nil, false
   275  	}
   276  	return &o.ResourceOwnerId, true
   277  }
   278  
   279  // SetResourceOwnerId sets field value
   280  func (o *DeviceModelsEntity) SetResourceOwnerId(v string) {
   281  	o.ResourceOwnerId = v
   282  }
   283  
   284  // GetWatch returns the Watch field value if set, zero value otherwise (both if not set or set to explicit null).
   285  func (o *DeviceModelsEntity) GetWatch() Watch {
   286  	if o == nil || o.Watch.Get() == nil {
   287  		var ret Watch
   288  		return ret
   289  	}
   290  	return *o.Watch.Get()
   291  }
   292  
   293  // GetWatchOk returns a tuple with the Watch field value if set, nil otherwise
   294  // and a boolean to check if the value has been set.
   295  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   296  func (o *DeviceModelsEntity) GetWatchOk() (*Watch, bool) {
   297  	if o == nil  {
   298  		return nil, false
   299  	}
   300  	return o.Watch.Get(), o.Watch.IsSet()
   301  }
   302  
   303  // HasWatch returns a boolean if a field has been set.
   304  func (o *DeviceModelsEntity) HasWatch() bool {
   305  	if o != nil && o.Watch.IsSet() {
   306  		return true
   307  	}
   308  
   309  	return false
   310  }
   311  
   312  // SetWatch gets a reference to the given NullableWatch and assigns it to the Watch field.
   313  func (o *DeviceModelsEntity) SetWatch(v Watch) {
   314  	o.Watch.Set(&v)
   315  }
   316  // SetWatchNil sets the value for Watch to be an explicit nil
   317  func (o *DeviceModelsEntity) SetWatchNil() {
   318  	o.Watch.Set(nil)
   319  }
   320  
   321  // UnsetWatch ensures that no value is present for Watch, not even an explicit nil
   322  func (o *DeviceModelsEntity) UnsetWatch() {
   323  	o.Watch.Unset()
   324  }
   325  
   326  // GetComponents returns the Components field value if set, zero value otherwise (both if not set or set to explicit null).
   327  func (o *DeviceModelsEntity) GetComponents() DeviceEntitiesComponent {
   328  	if o == nil || o.Components.Get() == nil {
   329  		var ret DeviceEntitiesComponent
   330  		return ret
   331  	}
   332  	return *o.Components.Get()
   333  }
   334  
   335  // GetComponentsOk returns a tuple with the Components field value if set, nil otherwise
   336  // and a boolean to check if the value has been set.
   337  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   338  func (o *DeviceModelsEntity) GetComponentsOk() (*DeviceEntitiesComponent, bool) {
   339  	if o == nil  {
   340  		return nil, false
   341  	}
   342  	return o.Components.Get(), o.Components.IsSet()
   343  }
   344  
   345  // HasComponents returns a boolean if a field has been set.
   346  func (o *DeviceModelsEntity) HasComponents() bool {
   347  	if o != nil && o.Components.IsSet() {
   348  		return true
   349  	}
   350  
   351  	return false
   352  }
   353  
   354  // SetComponents gets a reference to the given NullableDeviceEntitiesComponent and assigns it to the Components field.
   355  func (o *DeviceModelsEntity) SetComponents(v DeviceEntitiesComponent) {
   356  	o.Components.Set(&v)
   357  }
   358  // SetComponentsNil sets the value for Components to be an explicit nil
   359  func (o *DeviceModelsEntity) SetComponentsNil() {
   360  	o.Components.Set(nil)
   361  }
   362  
   363  // UnsetComponents ensures that no value is present for Components, not even an explicit nil
   364  func (o *DeviceModelsEntity) UnsetComponents() {
   365  	o.Components.Unset()
   366  }
   367  
   368  // GetCreatedAt returns the CreatedAt field value
   369  func (o *DeviceModelsEntity) GetCreatedAt() string {
   370  	if o == nil  {
   371  		var ret string
   372  		return ret
   373  	}
   374  
   375  	return o.CreatedAt
   376  }
   377  
   378  // GetCreatedAtOk returns a tuple with the CreatedAt field value
   379  // and a boolean to check if the value has been set.
   380  func (o *DeviceModelsEntity) GetCreatedAtOk() (*string, bool) {
   381  	if o == nil  {
   382  		return nil, false
   383  	}
   384  	return &o.CreatedAt, true
   385  }
   386  
   387  // SetCreatedAt sets field value
   388  func (o *DeviceModelsEntity) SetCreatedAt(v string) {
   389  	o.CreatedAt = v
   390  }
   391  
   392  // GetUpdatedAt returns the UpdatedAt field value
   393  func (o *DeviceModelsEntity) GetUpdatedAt() string {
   394  	if o == nil  {
   395  		var ret string
   396  		return ret
   397  	}
   398  
   399  	return o.UpdatedAt
   400  }
   401  
   402  // GetUpdatedAtOk returns a tuple with the UpdatedAt field value
   403  // and a boolean to check if the value has been set.
   404  func (o *DeviceModelsEntity) GetUpdatedAtOk() (*string, bool) {
   405  	if o == nil  {
   406  		return nil, false
   407  	}
   408  	return &o.UpdatedAt, true
   409  }
   410  
   411  // SetUpdatedAt sets field value
   412  func (o *DeviceModelsEntity) SetUpdatedAt(v string) {
   413  	o.UpdatedAt = v
   414  }
   415  
   416  func (o DeviceModelsEntity) MarshalJSON() ([]byte, error) {
   417  	toSerialize := map[string]interface{}{}
   418  	if true {
   419  		toSerialize["id"] = o.Id
   420  	}
   421  	if true {
   422  		toSerialize["key"] = o.Key
   423  	}
   424  	if true {
   425  		toSerialize["device_id"] = o.DeviceId
   426  	}
   427  	if true {
   428  		toSerialize["model"] = o.Model
   429  	}
   430  	if o.SerialNumber != nil {
   431  		toSerialize["serial_number"] = o.SerialNumber
   432  	}
   433  	if o.StartAt.IsSet() {
   434  		toSerialize["start_at"] = o.StartAt.Get()
   435  	}
   436  	if o.CustomInventory != nil {
   437  		toSerialize["custom_inventory"] = o.CustomInventory
   438  	}
   439  	if true {
   440  		toSerialize["resource_owner_id"] = o.ResourceOwnerId
   441  	}
   442  	if o.Watch.IsSet() {
   443  		toSerialize["watch"] = o.Watch.Get()
   444  	}
   445  	if o.Components.IsSet() {
   446  		toSerialize["components"] = o.Components.Get()
   447  	}
   448  	if true {
   449  		toSerialize["created_at"] = o.CreatedAt
   450  	}
   451  	if true {
   452  		toSerialize["updated_at"] = o.UpdatedAt
   453  	}
   454  	return json.Marshal(toSerialize)
   455  }
   456  
   457  type NullableDeviceModelsEntity struct {
   458  	value *DeviceModelsEntity
   459  	isSet bool
   460  }
   461  
   462  func (v NullableDeviceModelsEntity) Get() *DeviceModelsEntity {
   463  	return v.value
   464  }
   465  
   466  func (v *NullableDeviceModelsEntity) Set(val *DeviceModelsEntity) {
   467  	v.value = val
   468  	v.isSet = true
   469  }
   470  
   471  func (v NullableDeviceModelsEntity) IsSet() bool {
   472  	return v.isSet
   473  }
   474  
   475  func (v *NullableDeviceModelsEntity) Unset() {
   476  	v.value = nil
   477  	v.isSet = false
   478  }
   479  
   480  func NewNullableDeviceModelsEntity(val *DeviceModelsEntity) *NullableDeviceModelsEntity {
   481  	return &NullableDeviceModelsEntity{value: val, isSet: true}
   482  }
   483  
   484  func (v NullableDeviceModelsEntity) MarshalJSON() ([]byte, error) {
   485  	return json.Marshal(v.value)
   486  }
   487  
   488  func (v *NullableDeviceModelsEntity) UnmarshalJSON(src []byte) error {
   489  	v.isSet = true
   490  	return json.Unmarshal(src, &v.value)
   491  }
   492  
   493