github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_series_data_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  // SeriesDataRequest struct for SeriesDataRequest
    18  type SeriesDataRequest struct {
    19  	Location NullableSeriesDataLocation `json:"location,omitempty"`
    20  	// 計測値。送信可能なプロパティはcollectionによって異なる。 collectionごとの定義は[Available Collections](./docs/available-collections.html)を参照。  以下の場合はリクエスト不正となる。 - collectionに定義されていないプロパティがmeasurementsに含まれる場合 - measurementsのJSON Objectのサイズが350KB以上の場合
    21  	Measurements *map[string]map[string]interface{} `json:"measurements,omitempty"`
    22  }
    23  
    24  // NewSeriesDataRequest instantiates a new SeriesDataRequest object
    25  // This constructor will assign default values to properties that have it defined,
    26  // and makes sure properties required by API are set, but the set of arguments
    27  // will change when the set of required properties is changed
    28  func NewSeriesDataRequest() *SeriesDataRequest {
    29  	this := SeriesDataRequest{}
    30  	return &this
    31  }
    32  
    33  // NewSeriesDataRequestWithDefaults instantiates a new SeriesDataRequest 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 NewSeriesDataRequestWithDefaults() *SeriesDataRequest {
    37  	this := SeriesDataRequest{}
    38  	return &this
    39  }
    40  
    41  // GetLocation returns the Location field value if set, zero value otherwise (both if not set or set to explicit null).
    42  func (o *SeriesDataRequest) GetLocation() SeriesDataLocation {
    43  	if o == nil || o.Location.Get() == nil {
    44  		var ret SeriesDataLocation
    45  		return ret
    46  	}
    47  	return *o.Location.Get()
    48  }
    49  
    50  // GetLocationOk returns a tuple with the Location field value if set, nil otherwise
    51  // and a boolean to check if the value has been set.
    52  // NOTE: If the value is an explicit nil, `nil, true` will be returned
    53  func (o *SeriesDataRequest) GetLocationOk() (*SeriesDataLocation, bool) {
    54  	if o == nil  {
    55  		return nil, false
    56  	}
    57  	return o.Location.Get(), o.Location.IsSet()
    58  }
    59  
    60  // HasLocation returns a boolean if a field has been set.
    61  func (o *SeriesDataRequest) HasLocation() bool {
    62  	if o != nil && o.Location.IsSet() {
    63  		return true
    64  	}
    65  
    66  	return false
    67  }
    68  
    69  // SetLocation gets a reference to the given NullableSeriesDataLocation and assigns it to the Location field.
    70  func (o *SeriesDataRequest) SetLocation(v SeriesDataLocation) {
    71  	o.Location.Set(&v)
    72  }
    73  // SetLocationNil sets the value for Location to be an explicit nil
    74  func (o *SeriesDataRequest) SetLocationNil() {
    75  	o.Location.Set(nil)
    76  }
    77  
    78  // UnsetLocation ensures that no value is present for Location, not even an explicit nil
    79  func (o *SeriesDataRequest) UnsetLocation() {
    80  	o.Location.Unset()
    81  }
    82  
    83  // GetMeasurements returns the Measurements field value if set, zero value otherwise.
    84  func (o *SeriesDataRequest) GetMeasurements() map[string]map[string]interface{} {
    85  	if o == nil || o.Measurements == nil {
    86  		var ret map[string]map[string]interface{}
    87  		return ret
    88  	}
    89  	return *o.Measurements
    90  }
    91  
    92  // GetMeasurementsOk returns a tuple with the Measurements field value if set, nil otherwise
    93  // and a boolean to check if the value has been set.
    94  func (o *SeriesDataRequest) GetMeasurementsOk() (*map[string]map[string]interface{}, bool) {
    95  	if o == nil || o.Measurements == nil {
    96  		return nil, false
    97  	}
    98  	return o.Measurements, true
    99  }
   100  
   101  // HasMeasurements returns a boolean if a field has been set.
   102  func (o *SeriesDataRequest) HasMeasurements() bool {
   103  	if o != nil && o.Measurements != nil {
   104  		return true
   105  	}
   106  
   107  	return false
   108  }
   109  
   110  // SetMeasurements gets a reference to the given map[string]map[string]interface{} and assigns it to the Measurements field.
   111  func (o *SeriesDataRequest) SetMeasurements(v map[string]map[string]interface{}) {
   112  	o.Measurements = &v
   113  }
   114  
   115  func (o SeriesDataRequest) MarshalJSON() ([]byte, error) {
   116  	toSerialize := map[string]interface{}{}
   117  	if o.Location.IsSet() {
   118  		toSerialize["location"] = o.Location.Get()
   119  	}
   120  	if o.Measurements != nil {
   121  		toSerialize["measurements"] = o.Measurements
   122  	}
   123  	return json.Marshal(toSerialize)
   124  }
   125  
   126  type NullableSeriesDataRequest struct {
   127  	value *SeriesDataRequest
   128  	isSet bool
   129  }
   130  
   131  func (v NullableSeriesDataRequest) Get() *SeriesDataRequest {
   132  	return v.value
   133  }
   134  
   135  func (v *NullableSeriesDataRequest) Set(val *SeriesDataRequest) {
   136  	v.value = val
   137  	v.isSet = true
   138  }
   139  
   140  func (v NullableSeriesDataRequest) IsSet() bool {
   141  	return v.isSet
   142  }
   143  
   144  func (v *NullableSeriesDataRequest) Unset() {
   145  	v.value = nil
   146  	v.isSet = false
   147  }
   148  
   149  func NewNullableSeriesDataRequest(val *SeriesDataRequest) *NullableSeriesDataRequest {
   150  	return &NullableSeriesDataRequest{value: val, isSet: true}
   151  }
   152  
   153  func (v NullableSeriesDataRequest) MarshalJSON() ([]byte, error) {
   154  	return json.Marshal(v.value)
   155  }
   156  
   157  func (v *NullableSeriesDataRequest) UnmarshalJSON(src []byte) error {
   158  	v.isSet = true
   159  	return json.Unmarshal(src, &v.value)
   160  }
   161  
   162