github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_license.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  // License struct for License
    18  type License struct {
    19  	Id NullableString `json:"id"`
    20  	IssuedAt *string `json:"issued_at,omitempty"`
    21  	ExpiresAt *string `json:"expires_at,omitempty"`
    22  	Subscription *Subscription `json:"subscription,omitempty"`
    23  }
    24  
    25  // NewLicense instantiates a new License 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 NewLicense(id NullableString, ) *License {
    30  	this := License{}
    31  	this.Id = id
    32  	return &this
    33  }
    34  
    35  // NewLicenseWithDefaults instantiates a new License object
    36  // This constructor will only assign default values to properties that have it defined,
    37  // but it doesn't guarantee that properties required by API are set
    38  func NewLicenseWithDefaults() *License {
    39  	this := License{}
    40  	return &this
    41  }
    42  
    43  // GetId returns the Id field value
    44  // If the value is explicit nil, the zero value for string will be returned
    45  func (o *License) GetId() string {
    46  	if o == nil || o.Id.Get() == nil {
    47  		var ret string
    48  		return ret
    49  	}
    50  
    51  	return *o.Id.Get()
    52  }
    53  
    54  // GetIdOk returns a tuple with the Id field value
    55  // and a boolean to check if the value has been set.
    56  // NOTE: If the value is an explicit nil, `nil, true` will be returned
    57  func (o *License) GetIdOk() (*string, bool) {
    58  	if o == nil  {
    59  		return nil, false
    60  	}
    61  	return o.Id.Get(), o.Id.IsSet()
    62  }
    63  
    64  // SetId sets field value
    65  func (o *License) SetId(v string) {
    66  	o.Id.Set(&v)
    67  }
    68  
    69  // GetIssuedAt returns the IssuedAt field value if set, zero value otherwise.
    70  func (o *License) GetIssuedAt() string {
    71  	if o == nil || o.IssuedAt == nil {
    72  		var ret string
    73  		return ret
    74  	}
    75  	return *o.IssuedAt
    76  }
    77  
    78  // GetIssuedAtOk returns a tuple with the IssuedAt field value if set, nil otherwise
    79  // and a boolean to check if the value has been set.
    80  func (o *License) GetIssuedAtOk() (*string, bool) {
    81  	if o == nil || o.IssuedAt == nil {
    82  		return nil, false
    83  	}
    84  	return o.IssuedAt, true
    85  }
    86  
    87  // HasIssuedAt returns a boolean if a field has been set.
    88  func (o *License) HasIssuedAt() bool {
    89  	if o != nil && o.IssuedAt != nil {
    90  		return true
    91  	}
    92  
    93  	return false
    94  }
    95  
    96  // SetIssuedAt gets a reference to the given string and assigns it to the IssuedAt field.
    97  func (o *License) SetIssuedAt(v string) {
    98  	o.IssuedAt = &v
    99  }
   100  
   101  // GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
   102  func (o *License) GetExpiresAt() string {
   103  	if o == nil || o.ExpiresAt == nil {
   104  		var ret string
   105  		return ret
   106  	}
   107  	return *o.ExpiresAt
   108  }
   109  
   110  // GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
   111  // and a boolean to check if the value has been set.
   112  func (o *License) GetExpiresAtOk() (*string, bool) {
   113  	if o == nil || o.ExpiresAt == nil {
   114  		return nil, false
   115  	}
   116  	return o.ExpiresAt, true
   117  }
   118  
   119  // HasExpiresAt returns a boolean if a field has been set.
   120  func (o *License) HasExpiresAt() bool {
   121  	if o != nil && o.ExpiresAt != nil {
   122  		return true
   123  	}
   124  
   125  	return false
   126  }
   127  
   128  // SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field.
   129  func (o *License) SetExpiresAt(v string) {
   130  	o.ExpiresAt = &v
   131  }
   132  
   133  // GetSubscription returns the Subscription field value if set, zero value otherwise.
   134  func (o *License) GetSubscription() Subscription {
   135  	if o == nil || o.Subscription == nil {
   136  		var ret Subscription
   137  		return ret
   138  	}
   139  	return *o.Subscription
   140  }
   141  
   142  // GetSubscriptionOk returns a tuple with the Subscription field value if set, nil otherwise
   143  // and a boolean to check if the value has been set.
   144  func (o *License) GetSubscriptionOk() (*Subscription, bool) {
   145  	if o == nil || o.Subscription == nil {
   146  		return nil, false
   147  	}
   148  	return o.Subscription, true
   149  }
   150  
   151  // HasSubscription returns a boolean if a field has been set.
   152  func (o *License) HasSubscription() bool {
   153  	if o != nil && o.Subscription != nil {
   154  		return true
   155  	}
   156  
   157  	return false
   158  }
   159  
   160  // SetSubscription gets a reference to the given Subscription and assigns it to the Subscription field.
   161  func (o *License) SetSubscription(v Subscription) {
   162  	o.Subscription = &v
   163  }
   164  
   165  func (o License) MarshalJSON() ([]byte, error) {
   166  	toSerialize := map[string]interface{}{}
   167  	if true {
   168  		toSerialize["id"] = o.Id.Get()
   169  	}
   170  	if o.IssuedAt != nil {
   171  		toSerialize["issued_at"] = o.IssuedAt
   172  	}
   173  	if o.ExpiresAt != nil {
   174  		toSerialize["expires_at"] = o.ExpiresAt
   175  	}
   176  	if o.Subscription != nil {
   177  		toSerialize["subscription"] = o.Subscription
   178  	}
   179  	return json.Marshal(toSerialize)
   180  }
   181  
   182  type NullableLicense struct {
   183  	value *License
   184  	isSet bool
   185  }
   186  
   187  func (v NullableLicense) Get() *License {
   188  	return v.value
   189  }
   190  
   191  func (v *NullableLicense) Set(val *License) {
   192  	v.value = val
   193  	v.isSet = true
   194  }
   195  
   196  func (v NullableLicense) IsSet() bool {
   197  	return v.isSet
   198  }
   199  
   200  func (v *NullableLicense) Unset() {
   201  	v.value = nil
   202  	v.isSet = false
   203  }
   204  
   205  func NewNullableLicense(val *License) *NullableLicense {
   206  	return &NullableLicense{value: val, isSet: true}
   207  }
   208  
   209  func (v NullableLicense) MarshalJSON() ([]byte, error) {
   210  	return json.Marshal(v.value)
   211  }
   212  
   213  func (v *NullableLicense) UnmarshalJSON(src []byte) error {
   214  	v.isSet = true
   215  	return json.Unmarshal(src, &v.value)
   216  }
   217  
   218