github.com/optim-corp/cios-golang-sdk@v0.5.1/cios/model_contract.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  // Contract struct for Contract
    18  type Contract struct {
    19  	Id *string `json:"id,omitempty"`
    20  	ProviderId *string `json:"provider_id,omitempty"`
    21  	Quantity *int32 `json:"quantity,omitempty"`
    22  	Unit *string `json:"unit,omitempty"`
    23  	LicenseType *string `json:"license_type,omitempty"`
    24  	ContractType *string `json:"contract_type,omitempty"`
    25  	SpanType *string `json:"span_type,omitempty"`
    26  	SpanNumber *int32 `json:"span_number,omitempty"`
    27  	Status *string `json:"status,omitempty"`
    28  	// ISO8601
    29  	PurchasedAt *string `json:"purchased_at,omitempty"`
    30  	// ISO8601
    31  	IssuedAt *string `json:"issued_at,omitempty"`
    32  	// ISO8601
    33  	ExpiresAt *string `json:"expires_at,omitempty"`
    34  	// ISO8601
    35  	StatusChangeAt *string `json:"status_change_at,omitempty"`
    36  	Items *[]ContractItem `json:"items,omitempty"`
    37  	Owner *ContractOwner `json:"owner,omitempty"`
    38  }
    39  
    40  // NewContract instantiates a new Contract object
    41  // This constructor will assign default values to properties that have it defined,
    42  // and makes sure properties required by API are set, but the set of arguments
    43  // will change when the set of required properties is changed
    44  func NewContract() *Contract {
    45  	this := Contract{}
    46  	return &this
    47  }
    48  
    49  // NewContractWithDefaults instantiates a new Contract object
    50  // This constructor will only assign default values to properties that have it defined,
    51  // but it doesn't guarantee that properties required by API are set
    52  func NewContractWithDefaults() *Contract {
    53  	this := Contract{}
    54  	return &this
    55  }
    56  
    57  // GetId returns the Id field value if set, zero value otherwise.
    58  func (o *Contract) GetId() string {
    59  	if o == nil || o.Id == nil {
    60  		var ret string
    61  		return ret
    62  	}
    63  	return *o.Id
    64  }
    65  
    66  // GetIdOk returns a tuple with the Id field value if set, nil otherwise
    67  // and a boolean to check if the value has been set.
    68  func (o *Contract) GetIdOk() (*string, bool) {
    69  	if o == nil || o.Id == nil {
    70  		return nil, false
    71  	}
    72  	return o.Id, true
    73  }
    74  
    75  // HasId returns a boolean if a field has been set.
    76  func (o *Contract) HasId() bool {
    77  	if o != nil && o.Id != nil {
    78  		return true
    79  	}
    80  
    81  	return false
    82  }
    83  
    84  // SetId gets a reference to the given string and assigns it to the Id field.
    85  func (o *Contract) SetId(v string) {
    86  	o.Id = &v
    87  }
    88  
    89  // GetProviderId returns the ProviderId field value if set, zero value otherwise.
    90  func (o *Contract) GetProviderId() string {
    91  	if o == nil || o.ProviderId == nil {
    92  		var ret string
    93  		return ret
    94  	}
    95  	return *o.ProviderId
    96  }
    97  
    98  // GetProviderIdOk returns a tuple with the ProviderId field value if set, nil otherwise
    99  // and a boolean to check if the value has been set.
   100  func (o *Contract) GetProviderIdOk() (*string, bool) {
   101  	if o == nil || o.ProviderId == nil {
   102  		return nil, false
   103  	}
   104  	return o.ProviderId, true
   105  }
   106  
   107  // HasProviderId returns a boolean if a field has been set.
   108  func (o *Contract) HasProviderId() bool {
   109  	if o != nil && o.ProviderId != nil {
   110  		return true
   111  	}
   112  
   113  	return false
   114  }
   115  
   116  // SetProviderId gets a reference to the given string and assigns it to the ProviderId field.
   117  func (o *Contract) SetProviderId(v string) {
   118  	o.ProviderId = &v
   119  }
   120  
   121  // GetQuantity returns the Quantity field value if set, zero value otherwise.
   122  func (o *Contract) GetQuantity() int32 {
   123  	if o == nil || o.Quantity == nil {
   124  		var ret int32
   125  		return ret
   126  	}
   127  	return *o.Quantity
   128  }
   129  
   130  // GetQuantityOk returns a tuple with the Quantity field value if set, nil otherwise
   131  // and a boolean to check if the value has been set.
   132  func (o *Contract) GetQuantityOk() (*int32, bool) {
   133  	if o == nil || o.Quantity == nil {
   134  		return nil, false
   135  	}
   136  	return o.Quantity, true
   137  }
   138  
   139  // HasQuantity returns a boolean if a field has been set.
   140  func (o *Contract) HasQuantity() bool {
   141  	if o != nil && o.Quantity != nil {
   142  		return true
   143  	}
   144  
   145  	return false
   146  }
   147  
   148  // SetQuantity gets a reference to the given int32 and assigns it to the Quantity field.
   149  func (o *Contract) SetQuantity(v int32) {
   150  	o.Quantity = &v
   151  }
   152  
   153  // GetUnit returns the Unit field value if set, zero value otherwise.
   154  func (o *Contract) GetUnit() string {
   155  	if o == nil || o.Unit == nil {
   156  		var ret string
   157  		return ret
   158  	}
   159  	return *o.Unit
   160  }
   161  
   162  // GetUnitOk returns a tuple with the Unit field value if set, nil otherwise
   163  // and a boolean to check if the value has been set.
   164  func (o *Contract) GetUnitOk() (*string, bool) {
   165  	if o == nil || o.Unit == nil {
   166  		return nil, false
   167  	}
   168  	return o.Unit, true
   169  }
   170  
   171  // HasUnit returns a boolean if a field has been set.
   172  func (o *Contract) HasUnit() bool {
   173  	if o != nil && o.Unit != nil {
   174  		return true
   175  	}
   176  
   177  	return false
   178  }
   179  
   180  // SetUnit gets a reference to the given string and assigns it to the Unit field.
   181  func (o *Contract) SetUnit(v string) {
   182  	o.Unit = &v
   183  }
   184  
   185  // GetLicenseType returns the LicenseType field value if set, zero value otherwise.
   186  func (o *Contract) GetLicenseType() string {
   187  	if o == nil || o.LicenseType == nil {
   188  		var ret string
   189  		return ret
   190  	}
   191  	return *o.LicenseType
   192  }
   193  
   194  // GetLicenseTypeOk returns a tuple with the LicenseType field value if set, nil otherwise
   195  // and a boolean to check if the value has been set.
   196  func (o *Contract) GetLicenseTypeOk() (*string, bool) {
   197  	if o == nil || o.LicenseType == nil {
   198  		return nil, false
   199  	}
   200  	return o.LicenseType, true
   201  }
   202  
   203  // HasLicenseType returns a boolean if a field has been set.
   204  func (o *Contract) HasLicenseType() bool {
   205  	if o != nil && o.LicenseType != nil {
   206  		return true
   207  	}
   208  
   209  	return false
   210  }
   211  
   212  // SetLicenseType gets a reference to the given string and assigns it to the LicenseType field.
   213  func (o *Contract) SetLicenseType(v string) {
   214  	o.LicenseType = &v
   215  }
   216  
   217  // GetContractType returns the ContractType field value if set, zero value otherwise.
   218  func (o *Contract) GetContractType() string {
   219  	if o == nil || o.ContractType == nil {
   220  		var ret string
   221  		return ret
   222  	}
   223  	return *o.ContractType
   224  }
   225  
   226  // GetContractTypeOk returns a tuple with the ContractType field value if set, nil otherwise
   227  // and a boolean to check if the value has been set.
   228  func (o *Contract) GetContractTypeOk() (*string, bool) {
   229  	if o == nil || o.ContractType == nil {
   230  		return nil, false
   231  	}
   232  	return o.ContractType, true
   233  }
   234  
   235  // HasContractType returns a boolean if a field has been set.
   236  func (o *Contract) HasContractType() bool {
   237  	if o != nil && o.ContractType != nil {
   238  		return true
   239  	}
   240  
   241  	return false
   242  }
   243  
   244  // SetContractType gets a reference to the given string and assigns it to the ContractType field.
   245  func (o *Contract) SetContractType(v string) {
   246  	o.ContractType = &v
   247  }
   248  
   249  // GetSpanType returns the SpanType field value if set, zero value otherwise.
   250  func (o *Contract) GetSpanType() string {
   251  	if o == nil || o.SpanType == nil {
   252  		var ret string
   253  		return ret
   254  	}
   255  	return *o.SpanType
   256  }
   257  
   258  // GetSpanTypeOk returns a tuple with the SpanType field value if set, nil otherwise
   259  // and a boolean to check if the value has been set.
   260  func (o *Contract) GetSpanTypeOk() (*string, bool) {
   261  	if o == nil || o.SpanType == nil {
   262  		return nil, false
   263  	}
   264  	return o.SpanType, true
   265  }
   266  
   267  // HasSpanType returns a boolean if a field has been set.
   268  func (o *Contract) HasSpanType() bool {
   269  	if o != nil && o.SpanType != nil {
   270  		return true
   271  	}
   272  
   273  	return false
   274  }
   275  
   276  // SetSpanType gets a reference to the given string and assigns it to the SpanType field.
   277  func (o *Contract) SetSpanType(v string) {
   278  	o.SpanType = &v
   279  }
   280  
   281  // GetSpanNumber returns the SpanNumber field value if set, zero value otherwise.
   282  func (o *Contract) GetSpanNumber() int32 {
   283  	if o == nil || o.SpanNumber == nil {
   284  		var ret int32
   285  		return ret
   286  	}
   287  	return *o.SpanNumber
   288  }
   289  
   290  // GetSpanNumberOk returns a tuple with the SpanNumber field value if set, nil otherwise
   291  // and a boolean to check if the value has been set.
   292  func (o *Contract) GetSpanNumberOk() (*int32, bool) {
   293  	if o == nil || o.SpanNumber == nil {
   294  		return nil, false
   295  	}
   296  	return o.SpanNumber, true
   297  }
   298  
   299  // HasSpanNumber returns a boolean if a field has been set.
   300  func (o *Contract) HasSpanNumber() bool {
   301  	if o != nil && o.SpanNumber != nil {
   302  		return true
   303  	}
   304  
   305  	return false
   306  }
   307  
   308  // SetSpanNumber gets a reference to the given int32 and assigns it to the SpanNumber field.
   309  func (o *Contract) SetSpanNumber(v int32) {
   310  	o.SpanNumber = &v
   311  }
   312  
   313  // GetStatus returns the Status field value if set, zero value otherwise.
   314  func (o *Contract) GetStatus() string {
   315  	if o == nil || o.Status == nil {
   316  		var ret string
   317  		return ret
   318  	}
   319  	return *o.Status
   320  }
   321  
   322  // GetStatusOk returns a tuple with the Status field value if set, nil otherwise
   323  // and a boolean to check if the value has been set.
   324  func (o *Contract) GetStatusOk() (*string, bool) {
   325  	if o == nil || o.Status == nil {
   326  		return nil, false
   327  	}
   328  	return o.Status, true
   329  }
   330  
   331  // HasStatus returns a boolean if a field has been set.
   332  func (o *Contract) HasStatus() bool {
   333  	if o != nil && o.Status != nil {
   334  		return true
   335  	}
   336  
   337  	return false
   338  }
   339  
   340  // SetStatus gets a reference to the given string and assigns it to the Status field.
   341  func (o *Contract) SetStatus(v string) {
   342  	o.Status = &v
   343  }
   344  
   345  // GetPurchasedAt returns the PurchasedAt field value if set, zero value otherwise.
   346  func (o *Contract) GetPurchasedAt() string {
   347  	if o == nil || o.PurchasedAt == nil {
   348  		var ret string
   349  		return ret
   350  	}
   351  	return *o.PurchasedAt
   352  }
   353  
   354  // GetPurchasedAtOk returns a tuple with the PurchasedAt field value if set, nil otherwise
   355  // and a boolean to check if the value has been set.
   356  func (o *Contract) GetPurchasedAtOk() (*string, bool) {
   357  	if o == nil || o.PurchasedAt == nil {
   358  		return nil, false
   359  	}
   360  	return o.PurchasedAt, true
   361  }
   362  
   363  // HasPurchasedAt returns a boolean if a field has been set.
   364  func (o *Contract) HasPurchasedAt() bool {
   365  	if o != nil && o.PurchasedAt != nil {
   366  		return true
   367  	}
   368  
   369  	return false
   370  }
   371  
   372  // SetPurchasedAt gets a reference to the given string and assigns it to the PurchasedAt field.
   373  func (o *Contract) SetPurchasedAt(v string) {
   374  	o.PurchasedAt = &v
   375  }
   376  
   377  // GetIssuedAt returns the IssuedAt field value if set, zero value otherwise.
   378  func (o *Contract) GetIssuedAt() string {
   379  	if o == nil || o.IssuedAt == nil {
   380  		var ret string
   381  		return ret
   382  	}
   383  	return *o.IssuedAt
   384  }
   385  
   386  // GetIssuedAtOk returns a tuple with the IssuedAt field value if set, nil otherwise
   387  // and a boolean to check if the value has been set.
   388  func (o *Contract) GetIssuedAtOk() (*string, bool) {
   389  	if o == nil || o.IssuedAt == nil {
   390  		return nil, false
   391  	}
   392  	return o.IssuedAt, true
   393  }
   394  
   395  // HasIssuedAt returns a boolean if a field has been set.
   396  func (o *Contract) HasIssuedAt() bool {
   397  	if o != nil && o.IssuedAt != nil {
   398  		return true
   399  	}
   400  
   401  	return false
   402  }
   403  
   404  // SetIssuedAt gets a reference to the given string and assigns it to the IssuedAt field.
   405  func (o *Contract) SetIssuedAt(v string) {
   406  	o.IssuedAt = &v
   407  }
   408  
   409  // GetExpiresAt returns the ExpiresAt field value if set, zero value otherwise.
   410  func (o *Contract) GetExpiresAt() string {
   411  	if o == nil || o.ExpiresAt == nil {
   412  		var ret string
   413  		return ret
   414  	}
   415  	return *o.ExpiresAt
   416  }
   417  
   418  // GetExpiresAtOk returns a tuple with the ExpiresAt field value if set, nil otherwise
   419  // and a boolean to check if the value has been set.
   420  func (o *Contract) GetExpiresAtOk() (*string, bool) {
   421  	if o == nil || o.ExpiresAt == nil {
   422  		return nil, false
   423  	}
   424  	return o.ExpiresAt, true
   425  }
   426  
   427  // HasExpiresAt returns a boolean if a field has been set.
   428  func (o *Contract) HasExpiresAt() bool {
   429  	if o != nil && o.ExpiresAt != nil {
   430  		return true
   431  	}
   432  
   433  	return false
   434  }
   435  
   436  // SetExpiresAt gets a reference to the given string and assigns it to the ExpiresAt field.
   437  func (o *Contract) SetExpiresAt(v string) {
   438  	o.ExpiresAt = &v
   439  }
   440  
   441  // GetStatusChangeAt returns the StatusChangeAt field value if set, zero value otherwise.
   442  func (o *Contract) GetStatusChangeAt() string {
   443  	if o == nil || o.StatusChangeAt == nil {
   444  		var ret string
   445  		return ret
   446  	}
   447  	return *o.StatusChangeAt
   448  }
   449  
   450  // GetStatusChangeAtOk returns a tuple with the StatusChangeAt field value if set, nil otherwise
   451  // and a boolean to check if the value has been set.
   452  func (o *Contract) GetStatusChangeAtOk() (*string, bool) {
   453  	if o == nil || o.StatusChangeAt == nil {
   454  		return nil, false
   455  	}
   456  	return o.StatusChangeAt, true
   457  }
   458  
   459  // HasStatusChangeAt returns a boolean if a field has been set.
   460  func (o *Contract) HasStatusChangeAt() bool {
   461  	if o != nil && o.StatusChangeAt != nil {
   462  		return true
   463  	}
   464  
   465  	return false
   466  }
   467  
   468  // SetStatusChangeAt gets a reference to the given string and assigns it to the StatusChangeAt field.
   469  func (o *Contract) SetStatusChangeAt(v string) {
   470  	o.StatusChangeAt = &v
   471  }
   472  
   473  // GetItems returns the Items field value if set, zero value otherwise.
   474  func (o *Contract) GetItems() []ContractItem {
   475  	if o == nil || o.Items == nil {
   476  		var ret []ContractItem
   477  		return ret
   478  	}
   479  	return *o.Items
   480  }
   481  
   482  // GetItemsOk returns a tuple with the Items field value if set, nil otherwise
   483  // and a boolean to check if the value has been set.
   484  func (o *Contract) GetItemsOk() (*[]ContractItem, bool) {
   485  	if o == nil || o.Items == nil {
   486  		return nil, false
   487  	}
   488  	return o.Items, true
   489  }
   490  
   491  // HasItems returns a boolean if a field has been set.
   492  func (o *Contract) HasItems() bool {
   493  	if o != nil && o.Items != nil {
   494  		return true
   495  	}
   496  
   497  	return false
   498  }
   499  
   500  // SetItems gets a reference to the given []ContractItem and assigns it to the Items field.
   501  func (o *Contract) SetItems(v []ContractItem) {
   502  	o.Items = &v
   503  }
   504  
   505  // GetOwner returns the Owner field value if set, zero value otherwise.
   506  func (o *Contract) GetOwner() ContractOwner {
   507  	if o == nil || o.Owner == nil {
   508  		var ret ContractOwner
   509  		return ret
   510  	}
   511  	return *o.Owner
   512  }
   513  
   514  // GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
   515  // and a boolean to check if the value has been set.
   516  func (o *Contract) GetOwnerOk() (*ContractOwner, bool) {
   517  	if o == nil || o.Owner == nil {
   518  		return nil, false
   519  	}
   520  	return o.Owner, true
   521  }
   522  
   523  // HasOwner returns a boolean if a field has been set.
   524  func (o *Contract) HasOwner() bool {
   525  	if o != nil && o.Owner != nil {
   526  		return true
   527  	}
   528  
   529  	return false
   530  }
   531  
   532  // SetOwner gets a reference to the given ContractOwner and assigns it to the Owner field.
   533  func (o *Contract) SetOwner(v ContractOwner) {
   534  	o.Owner = &v
   535  }
   536  
   537  func (o Contract) MarshalJSON() ([]byte, error) {
   538  	toSerialize := map[string]interface{}{}
   539  	if o.Id != nil {
   540  		toSerialize["id"] = o.Id
   541  	}
   542  	if o.ProviderId != nil {
   543  		toSerialize["provider_id"] = o.ProviderId
   544  	}
   545  	if o.Quantity != nil {
   546  		toSerialize["quantity"] = o.Quantity
   547  	}
   548  	if o.Unit != nil {
   549  		toSerialize["unit"] = o.Unit
   550  	}
   551  	if o.LicenseType != nil {
   552  		toSerialize["license_type"] = o.LicenseType
   553  	}
   554  	if o.ContractType != nil {
   555  		toSerialize["contract_type"] = o.ContractType
   556  	}
   557  	if o.SpanType != nil {
   558  		toSerialize["span_type"] = o.SpanType
   559  	}
   560  	if o.SpanNumber != nil {
   561  		toSerialize["span_number"] = o.SpanNumber
   562  	}
   563  	if o.Status != nil {
   564  		toSerialize["status"] = o.Status
   565  	}
   566  	if o.PurchasedAt != nil {
   567  		toSerialize["purchased_at"] = o.PurchasedAt
   568  	}
   569  	if o.IssuedAt != nil {
   570  		toSerialize["issued_at"] = o.IssuedAt
   571  	}
   572  	if o.ExpiresAt != nil {
   573  		toSerialize["expires_at"] = o.ExpiresAt
   574  	}
   575  	if o.StatusChangeAt != nil {
   576  		toSerialize["status_change_at"] = o.StatusChangeAt
   577  	}
   578  	if o.Items != nil {
   579  		toSerialize["items"] = o.Items
   580  	}
   581  	if o.Owner != nil {
   582  		toSerialize["owner"] = o.Owner
   583  	}
   584  	return json.Marshal(toSerialize)
   585  }
   586  
   587  type NullableContract struct {
   588  	value *Contract
   589  	isSet bool
   590  }
   591  
   592  func (v NullableContract) Get() *Contract {
   593  	return v.value
   594  }
   595  
   596  func (v *NullableContract) Set(val *Contract) {
   597  	v.value = val
   598  	v.isSet = true
   599  }
   600  
   601  func (v NullableContract) IsSet() bool {
   602  	return v.isSet
   603  }
   604  
   605  func (v *NullableContract) Unset() {
   606  	v.value = nil
   607  	v.isSet = false
   608  }
   609  
   610  func NewNullableContract(val *Contract) *NullableContract {
   611  	return &NullableContract{value: val, isSet: true}
   612  }
   613  
   614  func (v NullableContract) MarshalJSON() ([]byte, error) {
   615  	return json.Marshal(v.value)
   616  }
   617  
   618  func (v *NullableContract) UnmarshalJSON(src []byte) error {
   619  	v.isSet = true
   620  	return json.Unmarshal(src, &v.value)
   621  }
   622  
   623