github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_device_model_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  // DeviceModelRequest struct for DeviceModelRequest
    18  type DeviceModelRequest struct {
    19  	Name string `json:"name"`
    20  	ResourceOwnerId string `json:"resource_owner_id"`
    21  	MakerId *string `json:"maker_id,omitempty"`
    22  	Version *string `json:"version,omitempty"`
    23  	Watch NullableWatch `json:"watch,omitempty"`
    24  	Components *ConstitutionComponent `json:"components,omitempty"`
    25  }
    26  
    27  // NewDeviceModelRequest instantiates a new DeviceModelRequest 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 NewDeviceModelRequest(name string, resourceOwnerId string, ) *DeviceModelRequest {
    32  	this := DeviceModelRequest{}
    33  	this.Name = name
    34  	this.ResourceOwnerId = resourceOwnerId
    35  	return &this
    36  }
    37  
    38  // NewDeviceModelRequestWithDefaults instantiates a new DeviceModelRequest 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 NewDeviceModelRequestWithDefaults() *DeviceModelRequest {
    42  	this := DeviceModelRequest{}
    43  	return &this
    44  }
    45  
    46  // GetName returns the Name field value
    47  func (o *DeviceModelRequest) GetName() string {
    48  	if o == nil  {
    49  		var ret string
    50  		return ret
    51  	}
    52  
    53  	return o.Name
    54  }
    55  
    56  // GetNameOk returns a tuple with the Name field value
    57  // and a boolean to check if the value has been set.
    58  func (o *DeviceModelRequest) GetNameOk() (*string, bool) {
    59  	if o == nil  {
    60  		return nil, false
    61  	}
    62  	return &o.Name, true
    63  }
    64  
    65  // SetName sets field value
    66  func (o *DeviceModelRequest) SetName(v string) {
    67  	o.Name = v
    68  }
    69  
    70  // GetResourceOwnerId returns the ResourceOwnerId field value
    71  func (o *DeviceModelRequest) GetResourceOwnerId() string {
    72  	if o == nil  {
    73  		var ret string
    74  		return ret
    75  	}
    76  
    77  	return o.ResourceOwnerId
    78  }
    79  
    80  // GetResourceOwnerIdOk returns a tuple with the ResourceOwnerId field value
    81  // and a boolean to check if the value has been set.
    82  func (o *DeviceModelRequest) GetResourceOwnerIdOk() (*string, bool) {
    83  	if o == nil  {
    84  		return nil, false
    85  	}
    86  	return &o.ResourceOwnerId, true
    87  }
    88  
    89  // SetResourceOwnerId sets field value
    90  func (o *DeviceModelRequest) SetResourceOwnerId(v string) {
    91  	o.ResourceOwnerId = v
    92  }
    93  
    94  // GetMakerId returns the MakerId field value if set, zero value otherwise.
    95  func (o *DeviceModelRequest) GetMakerId() string {
    96  	if o == nil || o.MakerId == nil {
    97  		var ret string
    98  		return ret
    99  	}
   100  	return *o.MakerId
   101  }
   102  
   103  // GetMakerIdOk returns a tuple with the MakerId field value if set, nil otherwise
   104  // and a boolean to check if the value has been set.
   105  func (o *DeviceModelRequest) GetMakerIdOk() (*string, bool) {
   106  	if o == nil || o.MakerId == nil {
   107  		return nil, false
   108  	}
   109  	return o.MakerId, true
   110  }
   111  
   112  // HasMakerId returns a boolean if a field has been set.
   113  func (o *DeviceModelRequest) HasMakerId() bool {
   114  	if o != nil && o.MakerId != nil {
   115  		return true
   116  	}
   117  
   118  	return false
   119  }
   120  
   121  // SetMakerId gets a reference to the given string and assigns it to the MakerId field.
   122  func (o *DeviceModelRequest) SetMakerId(v string) {
   123  	o.MakerId = &v
   124  }
   125  
   126  // GetVersion returns the Version field value if set, zero value otherwise.
   127  func (o *DeviceModelRequest) GetVersion() string {
   128  	if o == nil || o.Version == nil {
   129  		var ret string
   130  		return ret
   131  	}
   132  	return *o.Version
   133  }
   134  
   135  // GetVersionOk returns a tuple with the Version field value if set, nil otherwise
   136  // and a boolean to check if the value has been set.
   137  func (o *DeviceModelRequest) GetVersionOk() (*string, bool) {
   138  	if o == nil || o.Version == nil {
   139  		return nil, false
   140  	}
   141  	return o.Version, true
   142  }
   143  
   144  // HasVersion returns a boolean if a field has been set.
   145  func (o *DeviceModelRequest) HasVersion() bool {
   146  	if o != nil && o.Version != nil {
   147  		return true
   148  	}
   149  
   150  	return false
   151  }
   152  
   153  // SetVersion gets a reference to the given string and assigns it to the Version field.
   154  func (o *DeviceModelRequest) SetVersion(v string) {
   155  	o.Version = &v
   156  }
   157  
   158  // GetWatch returns the Watch field value if set, zero value otherwise (both if not set or set to explicit null).
   159  func (o *DeviceModelRequest) GetWatch() Watch {
   160  	if o == nil || o.Watch.Get() == nil {
   161  		var ret Watch
   162  		return ret
   163  	}
   164  	return *o.Watch.Get()
   165  }
   166  
   167  // GetWatchOk returns a tuple with the Watch field value if set, nil otherwise
   168  // and a boolean to check if the value has been set.
   169  // NOTE: If the value is an explicit nil, `nil, true` will be returned
   170  func (o *DeviceModelRequest) GetWatchOk() (*Watch, bool) {
   171  	if o == nil  {
   172  		return nil, false
   173  	}
   174  	return o.Watch.Get(), o.Watch.IsSet()
   175  }
   176  
   177  // HasWatch returns a boolean if a field has been set.
   178  func (o *DeviceModelRequest) HasWatch() bool {
   179  	if o != nil && o.Watch.IsSet() {
   180  		return true
   181  	}
   182  
   183  	return false
   184  }
   185  
   186  // SetWatch gets a reference to the given NullableWatch and assigns it to the Watch field.
   187  func (o *DeviceModelRequest) SetWatch(v Watch) {
   188  	o.Watch.Set(&v)
   189  }
   190  // SetWatchNil sets the value for Watch to be an explicit nil
   191  func (o *DeviceModelRequest) SetWatchNil() {
   192  	o.Watch.Set(nil)
   193  }
   194  
   195  // UnsetWatch ensures that no value is present for Watch, not even an explicit nil
   196  func (o *DeviceModelRequest) UnsetWatch() {
   197  	o.Watch.Unset()
   198  }
   199  
   200  // GetComponents returns the Components field value if set, zero value otherwise.
   201  func (o *DeviceModelRequest) GetComponents() ConstitutionComponent {
   202  	if o == nil || o.Components == nil {
   203  		var ret ConstitutionComponent
   204  		return ret
   205  	}
   206  	return *o.Components
   207  }
   208  
   209  // GetComponentsOk returns a tuple with the Components field value if set, nil otherwise
   210  // and a boolean to check if the value has been set.
   211  func (o *DeviceModelRequest) GetComponentsOk() (*ConstitutionComponent, bool) {
   212  	if o == nil || o.Components == nil {
   213  		return nil, false
   214  	}
   215  	return o.Components, true
   216  }
   217  
   218  // HasComponents returns a boolean if a field has been set.
   219  func (o *DeviceModelRequest) HasComponents() bool {
   220  	if o != nil && o.Components != nil {
   221  		return true
   222  	}
   223  
   224  	return false
   225  }
   226  
   227  // SetComponents gets a reference to the given ConstitutionComponent and assigns it to the Components field.
   228  func (o *DeviceModelRequest) SetComponents(v ConstitutionComponent) {
   229  	o.Components = &v
   230  }
   231  
   232  func (o DeviceModelRequest) MarshalJSON() ([]byte, error) {
   233  	toSerialize := map[string]interface{}{}
   234  	if true {
   235  		toSerialize["name"] = o.Name
   236  	}
   237  	if true {
   238  		toSerialize["resource_owner_id"] = o.ResourceOwnerId
   239  	}
   240  	if o.MakerId != nil {
   241  		toSerialize["maker_id"] = o.MakerId
   242  	}
   243  	if o.Version != nil {
   244  		toSerialize["version"] = o.Version
   245  	}
   246  	if o.Watch.IsSet() {
   247  		toSerialize["watch"] = o.Watch.Get()
   248  	}
   249  	if o.Components != nil {
   250  		toSerialize["components"] = o.Components
   251  	}
   252  	return json.Marshal(toSerialize)
   253  }
   254  
   255  type NullableDeviceModelRequest struct {
   256  	value *DeviceModelRequest
   257  	isSet bool
   258  }
   259  
   260  func (v NullableDeviceModelRequest) Get() *DeviceModelRequest {
   261  	return v.value
   262  }
   263  
   264  func (v *NullableDeviceModelRequest) Set(val *DeviceModelRequest) {
   265  	v.value = val
   266  	v.isSet = true
   267  }
   268  
   269  func (v NullableDeviceModelRequest) IsSet() bool {
   270  	return v.isSet
   271  }
   272  
   273  func (v *NullableDeviceModelRequest) Unset() {
   274  	v.value = nil
   275  	v.isSet = false
   276  }
   277  
   278  func NewNullableDeviceModelRequest(val *DeviceModelRequest) *NullableDeviceModelRequest {
   279  	return &NullableDeviceModelRequest{value: val, isSet: true}
   280  }
   281  
   282  func (v NullableDeviceModelRequest) MarshalJSON() ([]byte, error) {
   283  	return json.Marshal(v.value)
   284  }
   285  
   286  func (v *NullableDeviceModelRequest) UnmarshalJSON(src []byte) error {
   287  	v.isSet = true
   288  	return json.Unmarshal(src, &v.value)
   289  }
   290  
   291