github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_session.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  // Session struct for Session
    18  type Session struct {
    19  	Id *string `json:"id,omitempty"`
    20  	First *string `json:"first,omitempty"`
    21  	Last *string `json:"last,omitempty"`
    22  	Count *string `json:"count,omitempty"`
    23  }
    24  
    25  // NewSession instantiates a new Session 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 NewSession() *Session {
    30  	this := Session{}
    31  	return &this
    32  }
    33  
    34  // NewSessionWithDefaults instantiates a new Session 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 NewSessionWithDefaults() *Session {
    38  	this := Session{}
    39  	return &this
    40  }
    41  
    42  // GetId returns the Id field value if set, zero value otherwise.
    43  func (o *Session) GetId() string {
    44  	if o == nil || o.Id == nil {
    45  		var ret string
    46  		return ret
    47  	}
    48  	return *o.Id
    49  }
    50  
    51  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
    52  // and a boolean to check if the value has been set.
    53  func (o *Session) GetIdOk() (*string, bool) {
    54  	if o == nil || o.Id == nil {
    55  		return nil, false
    56  	}
    57  	return o.Id, true
    58  }
    59  
    60  // HasId returns a boolean if a field has been set.
    61  func (o *Session) HasId() bool {
    62  	if o != nil && o.Id != nil {
    63  		return true
    64  	}
    65  
    66  	return false
    67  }
    68  
    69  // SetId gets a reference to the given string and assigns it to the Id field.
    70  func (o *Session) SetId(v string) {
    71  	o.Id = &v
    72  }
    73  
    74  // GetFirst returns the First field value if set, zero value otherwise.
    75  func (o *Session) GetFirst() string {
    76  	if o == nil || o.First == nil {
    77  		var ret string
    78  		return ret
    79  	}
    80  	return *o.First
    81  }
    82  
    83  // GetFirstOk returns a tuple with the First field value if set, nil otherwise
    84  // and a boolean to check if the value has been set.
    85  func (o *Session) GetFirstOk() (*string, bool) {
    86  	if o == nil || o.First == nil {
    87  		return nil, false
    88  	}
    89  	return o.First, true
    90  }
    91  
    92  // HasFirst returns a boolean if a field has been set.
    93  func (o *Session) HasFirst() bool {
    94  	if o != nil && o.First != nil {
    95  		return true
    96  	}
    97  
    98  	return false
    99  }
   100  
   101  // SetFirst gets a reference to the given string and assigns it to the First field.
   102  func (o *Session) SetFirst(v string) {
   103  	o.First = &v
   104  }
   105  
   106  // GetLast returns the Last field value if set, zero value otherwise.
   107  func (o *Session) GetLast() string {
   108  	if o == nil || o.Last == nil {
   109  		var ret string
   110  		return ret
   111  	}
   112  	return *o.Last
   113  }
   114  
   115  // GetLastOk returns a tuple with the Last field value if set, nil otherwise
   116  // and a boolean to check if the value has been set.
   117  func (o *Session) GetLastOk() (*string, bool) {
   118  	if o == nil || o.Last == nil {
   119  		return nil, false
   120  	}
   121  	return o.Last, true
   122  }
   123  
   124  // HasLast returns a boolean if a field has been set.
   125  func (o *Session) HasLast() bool {
   126  	if o != nil && o.Last != nil {
   127  		return true
   128  	}
   129  
   130  	return false
   131  }
   132  
   133  // SetLast gets a reference to the given string and assigns it to the Last field.
   134  func (o *Session) SetLast(v string) {
   135  	o.Last = &v
   136  }
   137  
   138  // GetCount returns the Count field value if set, zero value otherwise.
   139  func (o *Session) GetCount() string {
   140  	if o == nil || o.Count == nil {
   141  		var ret string
   142  		return ret
   143  	}
   144  	return *o.Count
   145  }
   146  
   147  // GetCountOk returns a tuple with the Count field value if set, nil otherwise
   148  // and a boolean to check if the value has been set.
   149  func (o *Session) GetCountOk() (*string, bool) {
   150  	if o == nil || o.Count == nil {
   151  		return nil, false
   152  	}
   153  	return o.Count, true
   154  }
   155  
   156  // HasCount returns a boolean if a field has been set.
   157  func (o *Session) HasCount() bool {
   158  	if o != nil && o.Count != nil {
   159  		return true
   160  	}
   161  
   162  	return false
   163  }
   164  
   165  // SetCount gets a reference to the given string and assigns it to the Count field.
   166  func (o *Session) SetCount(v string) {
   167  	o.Count = &v
   168  }
   169  
   170  func (o Session) MarshalJSON() ([]byte, error) {
   171  	toSerialize := map[string]interface{}{}
   172  	if o.Id != nil {
   173  		toSerialize["id"] = o.Id
   174  	}
   175  	if o.First != nil {
   176  		toSerialize["first"] = o.First
   177  	}
   178  	if o.Last != nil {
   179  		toSerialize["last"] = o.Last
   180  	}
   181  	if o.Count != nil {
   182  		toSerialize["count"] = o.Count
   183  	}
   184  	return json.Marshal(toSerialize)
   185  }
   186  
   187  type NullableSession struct {
   188  	value *Session
   189  	isSet bool
   190  }
   191  
   192  func (v NullableSession) Get() *Session {
   193  	return v.value
   194  }
   195  
   196  func (v *NullableSession) Set(val *Session) {
   197  	v.value = val
   198  	v.isSet = true
   199  }
   200  
   201  func (v NullableSession) IsSet() bool {
   202  	return v.isSet
   203  }
   204  
   205  func (v *NullableSession) Unset() {
   206  	v.value = nil
   207  	v.isSet = false
   208  }
   209  
   210  func NewNullableSession(val *Session) *NullableSession {
   211  	return &NullableSession{value: val, isSet: true}
   212  }
   213  
   214  func (v NullableSession) MarshalJSON() ([]byte, error) {
   215  	return json.Marshal(v.value)
   216  }
   217  
   218  func (v *NullableSession) UnmarshalJSON(src []byte) error {
   219  	v.isSet = true
   220  	return json.Unmarshal(src, &v.value)
   221  }
   222  
   223