github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_inventory.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  // Inventory struct for Inventory
    18  type Inventory struct {
    19  	SerialNumber *string `json:"serial_number,omitempty"`
    20  	ResourceOwnerId *string `json:"resource_owner_id,omitempty"`
    21  	StartAt *string `json:"start_at,omitempty"`
    22  	CustomInventory *map[string]interface{} `json:"custom_inventory,omitempty"`
    23  }
    24  
    25  // NewInventory instantiates a new Inventory object
    26  // This constructor will assign default values to properties that have it defined,
    27  // and makes sure properties required by API are set, but the set of arguments
    28  // will change when the set of required properties is changed
    29  func NewInventory() *Inventory {
    30  	this := Inventory{}
    31  	return &this
    32  }
    33  
    34  // NewInventoryWithDefaults instantiates a new Inventory object
    35  // This constructor will only assign default values to properties that have it defined,
    36  // but it doesn't guarantee that properties required by API are set
    37  func NewInventoryWithDefaults() *Inventory {
    38  	this := Inventory{}
    39  	return &this
    40  }
    41  
    42  // GetSerialNumber returns the SerialNumber field value if set, zero value otherwise.
    43  func (o *Inventory) GetSerialNumber() string {
    44  	if o == nil || o.SerialNumber == nil {
    45  		var ret string
    46  		return ret
    47  	}
    48  	return *o.SerialNumber
    49  }
    50  
    51  // GetSerialNumberOk returns a tuple with the SerialNumber field value if set, nil otherwise
    52  // and a boolean to check if the value has been set.
    53  func (o *Inventory) GetSerialNumberOk() (*string, bool) {
    54  	if o == nil || o.SerialNumber == nil {
    55  		return nil, false
    56  	}
    57  	return o.SerialNumber, true
    58  }
    59  
    60  // HasSerialNumber returns a boolean if a field has been set.
    61  func (o *Inventory) HasSerialNumber() bool {
    62  	if o != nil && o.SerialNumber != nil {
    63  		return true
    64  	}
    65  
    66  	return false
    67  }
    68  
    69  // SetSerialNumber gets a reference to the given string and assigns it to the SerialNumber field.
    70  func (o *Inventory) SetSerialNumber(v string) {
    71  	o.SerialNumber = &v
    72  }
    73  
    74  // GetResourceOwnerId returns the ResourceOwnerId field value if set, zero value otherwise.
    75  func (o *Inventory) GetResourceOwnerId() string {
    76  	if o == nil || o.ResourceOwnerId == nil {
    77  		var ret string
    78  		return ret
    79  	}
    80  	return *o.ResourceOwnerId
    81  }
    82  
    83  // GetResourceOwnerIdOk returns a tuple with the ResourceOwnerId field value if set, nil otherwise
    84  // and a boolean to check if the value has been set.
    85  func (o *Inventory) GetResourceOwnerIdOk() (*string, bool) {
    86  	if o == nil || o.ResourceOwnerId == nil {
    87  		return nil, false
    88  	}
    89  	return o.ResourceOwnerId, true
    90  }
    91  
    92  // HasResourceOwnerId returns a boolean if a field has been set.
    93  func (o *Inventory) HasResourceOwnerId() bool {
    94  	if o != nil && o.ResourceOwnerId != nil {
    95  		return true
    96  	}
    97  
    98  	return false
    99  }
   100  
   101  // SetResourceOwnerId gets a reference to the given string and assigns it to the ResourceOwnerId field.
   102  func (o *Inventory) SetResourceOwnerId(v string) {
   103  	o.ResourceOwnerId = &v
   104  }
   105  
   106  // GetStartAt returns the StartAt field value if set, zero value otherwise.
   107  func (o *Inventory) GetStartAt() string {
   108  	if o == nil || o.StartAt == nil {
   109  		var ret string
   110  		return ret
   111  	}
   112  	return *o.StartAt
   113  }
   114  
   115  // GetStartAtOk returns a tuple with the StartAt field value if set, nil otherwise
   116  // and a boolean to check if the value has been set.
   117  func (o *Inventory) GetStartAtOk() (*string, bool) {
   118  	if o == nil || o.StartAt == nil {
   119  		return nil, false
   120  	}
   121  	return o.StartAt, true
   122  }
   123  
   124  // HasStartAt returns a boolean if a field has been set.
   125  func (o *Inventory) HasStartAt() bool {
   126  	if o != nil && o.StartAt != nil {
   127  		return true
   128  	}
   129  
   130  	return false
   131  }
   132  
   133  // SetStartAt gets a reference to the given string and assigns it to the StartAt field.
   134  func (o *Inventory) SetStartAt(v string) {
   135  	o.StartAt = &v
   136  }
   137  
   138  // GetCustomInventory returns the CustomInventory field value if set, zero value otherwise.
   139  func (o *Inventory) GetCustomInventory() map[string]interface{} {
   140  	if o == nil || o.CustomInventory == nil {
   141  		var ret map[string]interface{}
   142  		return ret
   143  	}
   144  	return *o.CustomInventory
   145  }
   146  
   147  // GetCustomInventoryOk returns a tuple with the CustomInventory field value if set, nil otherwise
   148  // and a boolean to check if the value has been set.
   149  func (o *Inventory) GetCustomInventoryOk() (*map[string]interface{}, bool) {
   150  	if o == nil || o.CustomInventory == nil {
   151  		return nil, false
   152  	}
   153  	return o.CustomInventory, true
   154  }
   155  
   156  // HasCustomInventory returns a boolean if a field has been set.
   157  func (o *Inventory) HasCustomInventory() bool {
   158  	if o != nil && o.CustomInventory != nil {
   159  		return true
   160  	}
   161  
   162  	return false
   163  }
   164  
   165  // SetCustomInventory gets a reference to the given map[string]interface{} and assigns it to the CustomInventory field.
   166  func (o *Inventory) SetCustomInventory(v map[string]interface{}) {
   167  	o.CustomInventory = &v
   168  }
   169  
   170  func (o Inventory) MarshalJSON() ([]byte, error) {
   171  	toSerialize := map[string]interface{}{}
   172  	if o.SerialNumber != nil {
   173  		toSerialize["serial_number"] = o.SerialNumber
   174  	}
   175  	if o.ResourceOwnerId != nil {
   176  		toSerialize["resource_owner_id"] = o.ResourceOwnerId
   177  	}
   178  	if o.StartAt != nil {
   179  		toSerialize["start_at"] = o.StartAt
   180  	}
   181  	if o.CustomInventory != nil {
   182  		toSerialize["custom_inventory"] = o.CustomInventory
   183  	}
   184  	return json.Marshal(toSerialize)
   185  }
   186  
   187  type NullableInventory struct {
   188  	value *Inventory
   189  	isSet bool
   190  }
   191  
   192  func (v NullableInventory) Get() *Inventory {
   193  	return v.value
   194  }
   195  
   196  func (v *NullableInventory) Set(val *Inventory) {
   197  	v.value = val
   198  	v.isSet = true
   199  }
   200  
   201  func (v NullableInventory) IsSet() bool {
   202  	return v.isSet
   203  }
   204  
   205  func (v *NullableInventory) Unset() {
   206  	v.value = nil
   207  	v.isSet = false
   208  }
   209  
   210  func NewNullableInventory(val *Inventory) *NullableInventory {
   211  	return &NullableInventory{value: val, isSet: true}
   212  }
   213  
   214  func (v NullableInventory) MarshalJSON() ([]byte, error) {
   215  	return json.Marshal(v.value)
   216  }
   217  
   218  func (v *NullableInventory) UnmarshalJSON(src []byte) error {
   219  	v.isSet = true
   220  	return json.Unmarshal(src, &v.value)
   221  }
   222  
   223