/
model_subscription_details.go
executable file
·320 lines (269 loc) · 8.41 KB
/
model_subscription_details.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
/*
Tenant API
Tenant API
API version: 0.0.1
Contact: abc@layer.fr
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package sdk
import (
"encoding/json"
)
// checks if the SubscriptionDetails type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SubscriptionDetails{}
// SubscriptionDetails struct for SubscriptionDetails
type SubscriptionDetails struct {
Details
Type *string `json:"type,omitempty"`
SupportPlan *string `json:"support_plan,omitempty"`
Account *string `json:"account,omitempty"`
Company *Company `json:"company,omitempty"`
Contact *Contact `json:"contact,omitempty"`
PaymentMethod *PaymentMethod `json:"payment_method,omitempty"`
}
// NewSubscriptionDetails instantiates a new SubscriptionDetails object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewSubscriptionDetails() *SubscriptionDetails {
this := SubscriptionDetails{}
var type_ string = "subscription"
this.Type = &type_
return &this
}
// NewSubscriptionDetailsWithDefaults instantiates a new SubscriptionDetails object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewSubscriptionDetailsWithDefaults() *SubscriptionDetails {
this := SubscriptionDetails{}
var type_ string = "subscription"
this.Type = &type_
return &this
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *SubscriptionDetails) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SubscriptionDetails) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *SubscriptionDetails) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *SubscriptionDetails) SetType(v string) {
o.Type = &v
}
// GetSupportPlan returns the SupportPlan field value if set, zero value otherwise.
func (o *SubscriptionDetails) GetSupportPlan() string {
if o == nil || IsNil(o.SupportPlan) {
var ret string
return ret
}
return *o.SupportPlan
}
// GetSupportPlanOk returns a tuple with the SupportPlan field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SubscriptionDetails) GetSupportPlanOk() (*string, bool) {
if o == nil || IsNil(o.SupportPlan) {
return nil, false
}
return o.SupportPlan, true
}
// HasSupportPlan returns a boolean if a field has been set.
func (o *SubscriptionDetails) HasSupportPlan() bool {
if o != nil && !IsNil(o.SupportPlan) {
return true
}
return false
}
// SetSupportPlan gets a reference to the given string and assigns it to the SupportPlan field.
func (o *SubscriptionDetails) SetSupportPlan(v string) {
o.SupportPlan = &v
}
// GetAccount returns the Account field value if set, zero value otherwise.
func (o *SubscriptionDetails) GetAccount() string {
if o == nil || IsNil(o.Account) {
var ret string
return ret
}
return *o.Account
}
// GetAccountOk returns a tuple with the Account field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SubscriptionDetails) GetAccountOk() (*string, bool) {
if o == nil || IsNil(o.Account) {
return nil, false
}
return o.Account, true
}
// HasAccount returns a boolean if a field has been set.
func (o *SubscriptionDetails) HasAccount() bool {
if o != nil && !IsNil(o.Account) {
return true
}
return false
}
// SetAccount gets a reference to the given string and assigns it to the Account field.
func (o *SubscriptionDetails) SetAccount(v string) {
o.Account = &v
}
// GetCompany returns the Company field value if set, zero value otherwise.
func (o *SubscriptionDetails) GetCompany() Company {
if o == nil || IsNil(o.Company) {
var ret Company
return ret
}
return *o.Company
}
// GetCompanyOk returns a tuple with the Company field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SubscriptionDetails) GetCompanyOk() (*Company, bool) {
if o == nil || IsNil(o.Company) {
return nil, false
}
return o.Company, true
}
// HasCompany returns a boolean if a field has been set.
func (o *SubscriptionDetails) HasCompany() bool {
if o != nil && !IsNil(o.Company) {
return true
}
return false
}
// SetCompany gets a reference to the given Company and assigns it to the Company field.
func (o *SubscriptionDetails) SetCompany(v Company) {
o.Company = &v
}
// GetContact returns the Contact field value if set, zero value otherwise.
func (o *SubscriptionDetails) GetContact() Contact {
if o == nil || IsNil(o.Contact) {
var ret Contact
return ret
}
return *o.Contact
}
// GetContactOk returns a tuple with the Contact field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SubscriptionDetails) GetContactOk() (*Contact, bool) {
if o == nil || IsNil(o.Contact) {
return nil, false
}
return o.Contact, true
}
// HasContact returns a boolean if a field has been set.
func (o *SubscriptionDetails) HasContact() bool {
if o != nil && !IsNil(o.Contact) {
return true
}
return false
}
// SetContact gets a reference to the given Contact and assigns it to the Contact field.
func (o *SubscriptionDetails) SetContact(v Contact) {
o.Contact = &v
}
// GetPaymentMethod returns the PaymentMethod field value if set, zero value otherwise.
func (o *SubscriptionDetails) GetPaymentMethod() PaymentMethod {
if o == nil || IsNil(o.PaymentMethod) {
var ret PaymentMethod
return ret
}
return *o.PaymentMethod
}
// GetPaymentMethodOk returns a tuple with the PaymentMethod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SubscriptionDetails) GetPaymentMethodOk() (*PaymentMethod, bool) {
if o == nil || IsNil(o.PaymentMethod) {
return nil, false
}
return o.PaymentMethod, true
}
// HasPaymentMethod returns a boolean if a field has been set.
func (o *SubscriptionDetails) HasPaymentMethod() bool {
if o != nil && !IsNil(o.PaymentMethod) {
return true
}
return false
}
// SetPaymentMethod gets a reference to the given PaymentMethod and assigns it to the PaymentMethod field.
func (o *SubscriptionDetails) SetPaymentMethod(v PaymentMethod) {
o.PaymentMethod = &v
}
func (o SubscriptionDetails) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SubscriptionDetails) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
serializedDetails, errDetails := json.Marshal(o.Details)
if errDetails != nil {
return map[string]interface{}{}, errDetails
}
errDetails = json.Unmarshal([]byte(serializedDetails), &toSerialize)
if errDetails != nil {
return map[string]interface{}{}, errDetails
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.SupportPlan) {
toSerialize["support_plan"] = o.SupportPlan
}
if !IsNil(o.Account) {
toSerialize["account"] = o.Account
}
if !IsNil(o.Company) {
toSerialize["company"] = o.Company
}
if !IsNil(o.Contact) {
toSerialize["contact"] = o.Contact
}
if !IsNil(o.PaymentMethod) {
toSerialize["payment_method"] = o.PaymentMethod
}
return toSerialize, nil
}
type NullableSubscriptionDetails struct {
value *SubscriptionDetails
isSet bool
}
func (v NullableSubscriptionDetails) Get() *SubscriptionDetails {
return v.value
}
func (v *NullableSubscriptionDetails) Set(val *SubscriptionDetails) {
v.value = val
v.isSet = true
}
func (v NullableSubscriptionDetails) IsSet() bool {
return v.isSet
}
func (v *NullableSubscriptionDetails) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSubscriptionDetails(val *SubscriptionDetails) *NullableSubscriptionDetails {
return &NullableSubscriptionDetails{value: val, isSet: true}
}
func (v NullableSubscriptionDetails) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSubscriptionDetails) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}