-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathmodel_create_status_page_request_data_attributes.go
More file actions
386 lines (341 loc) · 14.1 KB
/
model_create_status_page_request_data_attributes.go
File metadata and controls
386 lines (341 loc) · 14.1 KB
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.
package datadogV2
import (
"fmt"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// CreateStatusPageRequestDataAttributes The supported attributes for creating a status page.
type CreateStatusPageRequestDataAttributes struct {
// The base64-encoded image data displayed on the status page.
CompanyLogo *string `json:"company_logo,omitempty"`
// The components displayed on the status page.
Components []CreateStatusPageRequestDataAttributesComponentsItems `json:"components,omitempty"`
// The subdomain of the status page's url taking the form `https://{domain_prefix}.statuspage.datadoghq.com`. Globally unique across Datadog Status Pages.
DomainPrefix string `json:"domain_prefix"`
// Base64-encoded image data included in email notifications sent to status page subscribers.
EmailHeaderImage *string `json:"email_header_image,omitempty"`
// Base64-encoded image data displayed in the browser tab.
Favicon *string `json:"favicon,omitempty"`
// The name of the status page.
Name string `json:"name"`
// Whether users can subscribe to the status page.
SubscriptionsEnabled *bool `json:"subscriptions_enabled,omitempty"`
// The type of the status page controlling how the status page is accessed.
Type CreateStatusPageRequestDataAttributesType `json:"type"`
// The visualization type of the status page.
VisualizationType CreateStatusPageRequestDataAttributesVisualizationType `json:"visualization_type"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{} `json:"-"`
}
// NewCreateStatusPageRequestDataAttributes instantiates a new CreateStatusPageRequestDataAttributes 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 NewCreateStatusPageRequestDataAttributes(domainPrefix string, name string, typeVar CreateStatusPageRequestDataAttributesType, visualizationType CreateStatusPageRequestDataAttributesVisualizationType) *CreateStatusPageRequestDataAttributes {
this := CreateStatusPageRequestDataAttributes{}
this.DomainPrefix = domainPrefix
this.Name = name
this.Type = typeVar
this.VisualizationType = visualizationType
return &this
}
// NewCreateStatusPageRequestDataAttributesWithDefaults instantiates a new CreateStatusPageRequestDataAttributes 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 NewCreateStatusPageRequestDataAttributesWithDefaults() *CreateStatusPageRequestDataAttributes {
this := CreateStatusPageRequestDataAttributes{}
return &this
}
// GetCompanyLogo returns the CompanyLogo field value if set, zero value otherwise.
func (o *CreateStatusPageRequestDataAttributes) GetCompanyLogo() string {
if o == nil || o.CompanyLogo == nil {
var ret string
return ret
}
return *o.CompanyLogo
}
// GetCompanyLogoOk returns a tuple with the CompanyLogo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetCompanyLogoOk() (*string, bool) {
if o == nil || o.CompanyLogo == nil {
return nil, false
}
return o.CompanyLogo, true
}
// HasCompanyLogo returns a boolean if a field has been set.
func (o *CreateStatusPageRequestDataAttributes) HasCompanyLogo() bool {
return o != nil && o.CompanyLogo != nil
}
// SetCompanyLogo gets a reference to the given string and assigns it to the CompanyLogo field.
func (o *CreateStatusPageRequestDataAttributes) SetCompanyLogo(v string) {
o.CompanyLogo = &v
}
// GetComponents returns the Components field value if set, zero value otherwise.
func (o *CreateStatusPageRequestDataAttributes) GetComponents() []CreateStatusPageRequestDataAttributesComponentsItems {
if o == nil || o.Components == nil {
var ret []CreateStatusPageRequestDataAttributesComponentsItems
return ret
}
return o.Components
}
// GetComponentsOk returns a tuple with the Components field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetComponentsOk() (*[]CreateStatusPageRequestDataAttributesComponentsItems, bool) {
if o == nil || o.Components == nil {
return nil, false
}
return &o.Components, true
}
// HasComponents returns a boolean if a field has been set.
func (o *CreateStatusPageRequestDataAttributes) HasComponents() bool {
return o != nil && o.Components != nil
}
// SetComponents gets a reference to the given []CreateStatusPageRequestDataAttributesComponentsItems and assigns it to the Components field.
func (o *CreateStatusPageRequestDataAttributes) SetComponents(v []CreateStatusPageRequestDataAttributesComponentsItems) {
o.Components = v
}
// GetDomainPrefix returns the DomainPrefix field value.
func (o *CreateStatusPageRequestDataAttributes) GetDomainPrefix() string {
if o == nil {
var ret string
return ret
}
return o.DomainPrefix
}
// GetDomainPrefixOk returns a tuple with the DomainPrefix field value
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetDomainPrefixOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DomainPrefix, true
}
// SetDomainPrefix sets field value.
func (o *CreateStatusPageRequestDataAttributes) SetDomainPrefix(v string) {
o.DomainPrefix = v
}
// GetEmailHeaderImage returns the EmailHeaderImage field value if set, zero value otherwise.
func (o *CreateStatusPageRequestDataAttributes) GetEmailHeaderImage() string {
if o == nil || o.EmailHeaderImage == nil {
var ret string
return ret
}
return *o.EmailHeaderImage
}
// GetEmailHeaderImageOk returns a tuple with the EmailHeaderImage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetEmailHeaderImageOk() (*string, bool) {
if o == nil || o.EmailHeaderImage == nil {
return nil, false
}
return o.EmailHeaderImage, true
}
// HasEmailHeaderImage returns a boolean if a field has been set.
func (o *CreateStatusPageRequestDataAttributes) HasEmailHeaderImage() bool {
return o != nil && o.EmailHeaderImage != nil
}
// SetEmailHeaderImage gets a reference to the given string and assigns it to the EmailHeaderImage field.
func (o *CreateStatusPageRequestDataAttributes) SetEmailHeaderImage(v string) {
o.EmailHeaderImage = &v
}
// GetFavicon returns the Favicon field value if set, zero value otherwise.
func (o *CreateStatusPageRequestDataAttributes) GetFavicon() string {
if o == nil || o.Favicon == nil {
var ret string
return ret
}
return *o.Favicon
}
// GetFaviconOk returns a tuple with the Favicon field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetFaviconOk() (*string, bool) {
if o == nil || o.Favicon == nil {
return nil, false
}
return o.Favicon, true
}
// HasFavicon returns a boolean if a field has been set.
func (o *CreateStatusPageRequestDataAttributes) HasFavicon() bool {
return o != nil && o.Favicon != nil
}
// SetFavicon gets a reference to the given string and assigns it to the Favicon field.
func (o *CreateStatusPageRequestDataAttributes) SetFavicon(v string) {
o.Favicon = &v
}
// GetName returns the Name field value.
func (o *CreateStatusPageRequestDataAttributes) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value.
func (o *CreateStatusPageRequestDataAttributes) SetName(v string) {
o.Name = v
}
// GetSubscriptionsEnabled returns the SubscriptionsEnabled field value if set, zero value otherwise.
func (o *CreateStatusPageRequestDataAttributes) GetSubscriptionsEnabled() bool {
if o == nil || o.SubscriptionsEnabled == nil {
var ret bool
return ret
}
return *o.SubscriptionsEnabled
}
// GetSubscriptionsEnabledOk returns a tuple with the SubscriptionsEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetSubscriptionsEnabledOk() (*bool, bool) {
if o == nil || o.SubscriptionsEnabled == nil {
return nil, false
}
return o.SubscriptionsEnabled, true
}
// HasSubscriptionsEnabled returns a boolean if a field has been set.
func (o *CreateStatusPageRequestDataAttributes) HasSubscriptionsEnabled() bool {
return o != nil && o.SubscriptionsEnabled != nil
}
// SetSubscriptionsEnabled gets a reference to the given bool and assigns it to the SubscriptionsEnabled field.
func (o *CreateStatusPageRequestDataAttributes) SetSubscriptionsEnabled(v bool) {
o.SubscriptionsEnabled = &v
}
// GetType returns the Type field value.
func (o *CreateStatusPageRequestDataAttributes) GetType() CreateStatusPageRequestDataAttributesType {
if o == nil {
var ret CreateStatusPageRequestDataAttributesType
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetTypeOk() (*CreateStatusPageRequestDataAttributesType, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value.
func (o *CreateStatusPageRequestDataAttributes) SetType(v CreateStatusPageRequestDataAttributesType) {
o.Type = v
}
// GetVisualizationType returns the VisualizationType field value.
func (o *CreateStatusPageRequestDataAttributes) GetVisualizationType() CreateStatusPageRequestDataAttributesVisualizationType {
if o == nil {
var ret CreateStatusPageRequestDataAttributesVisualizationType
return ret
}
return o.VisualizationType
}
// GetVisualizationTypeOk returns a tuple with the VisualizationType field value
// and a boolean to check if the value has been set.
func (o *CreateStatusPageRequestDataAttributes) GetVisualizationTypeOk() (*CreateStatusPageRequestDataAttributesVisualizationType, bool) {
if o == nil {
return nil, false
}
return &o.VisualizationType, true
}
// SetVisualizationType sets field value.
func (o *CreateStatusPageRequestDataAttributes) SetVisualizationType(v CreateStatusPageRequestDataAttributesVisualizationType) {
o.VisualizationType = v
}
// MarshalJSON serializes the struct using spec logic.
func (o CreateStatusPageRequestDataAttributes) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.CompanyLogo != nil {
toSerialize["company_logo"] = o.CompanyLogo
}
if o.Components != nil {
toSerialize["components"] = o.Components
}
toSerialize["domain_prefix"] = o.DomainPrefix
if o.EmailHeaderImage != nil {
toSerialize["email_header_image"] = o.EmailHeaderImage
}
if o.Favicon != nil {
toSerialize["favicon"] = o.Favicon
}
toSerialize["name"] = o.Name
if o.SubscriptionsEnabled != nil {
toSerialize["subscriptions_enabled"] = o.SubscriptionsEnabled
}
toSerialize["type"] = o.Type
toSerialize["visualization_type"] = o.VisualizationType
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *CreateStatusPageRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
CompanyLogo *string `json:"company_logo,omitempty"`
Components []CreateStatusPageRequestDataAttributesComponentsItems `json:"components,omitempty"`
DomainPrefix *string `json:"domain_prefix"`
EmailHeaderImage *string `json:"email_header_image,omitempty"`
Favicon *string `json:"favicon,omitempty"`
Name *string `json:"name"`
SubscriptionsEnabled *bool `json:"subscriptions_enabled,omitempty"`
Type *CreateStatusPageRequestDataAttributesType `json:"type"`
VisualizationType *CreateStatusPageRequestDataAttributesVisualizationType `json:"visualization_type"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
if all.DomainPrefix == nil {
return fmt.Errorf("required field domain_prefix missing")
}
if all.Name == nil {
return fmt.Errorf("required field name missing")
}
if all.Type == nil {
return fmt.Errorf("required field type missing")
}
if all.VisualizationType == nil {
return fmt.Errorf("required field visualization_type missing")
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"company_logo", "components", "domain_prefix", "email_header_image", "favicon", "name", "subscriptions_enabled", "type", "visualization_type"})
} else {
return err
}
hasInvalidField := false
o.CompanyLogo = all.CompanyLogo
o.Components = all.Components
o.DomainPrefix = *all.DomainPrefix
o.EmailHeaderImage = all.EmailHeaderImage
o.Favicon = all.Favicon
o.Name = *all.Name
o.SubscriptionsEnabled = all.SubscriptionsEnabled
if !all.Type.IsValid() {
hasInvalidField = true
} else {
o.Type = *all.Type
}
if !all.VisualizationType.IsValid() {
hasInvalidField = true
} else {
o.VisualizationType = *all.VisualizationType
}
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
return nil
}