forked from DataDog/datadog-api-client-go
/
model_widget_custom_link.go
252 lines (216 loc) · 7.02 KB
/
model_widget_custom_link.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
/*
* 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.
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package datadog
import (
"encoding/json"
)
// WidgetCustomLink Custom links help you connect a data value to a URL, like a Datadog page or your AWS console.
type WidgetCustomLink struct {
// The flag for toggling context menu link visibility.
IsHidden *bool `json:"is_hidden,omitempty"`
// The label for the custom link URL. Keep the label short and descriptive. Use metrics and tags as variables.
Label *string `json:"label,omitempty"`
// The URL of the custom link. URL must include `http` or `https`. A relative URL must start with `/`.
Link *string `json:"link,omitempty"`
// The label ID that refers to a context menu link. Can be `logs`, `hosts`, `traces`, `profiles`, `processes`, `containers`, or `rum`.
OverrideLabel *string `json:"override_label,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:-`
}
// NewWidgetCustomLink instantiates a new WidgetCustomLink 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 NewWidgetCustomLink() *WidgetCustomLink {
this := WidgetCustomLink{}
return &this
}
// NewWidgetCustomLinkWithDefaults instantiates a new WidgetCustomLink 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 NewWidgetCustomLinkWithDefaults() *WidgetCustomLink {
this := WidgetCustomLink{}
return &this
}
// GetIsHidden returns the IsHidden field value if set, zero value otherwise.
func (o *WidgetCustomLink) GetIsHidden() bool {
if o == nil || o.IsHidden == nil {
var ret bool
return ret
}
return *o.IsHidden
}
// GetIsHiddenOk returns a tuple with the IsHidden field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WidgetCustomLink) GetIsHiddenOk() (*bool, bool) {
if o == nil || o.IsHidden == nil {
return nil, false
}
return o.IsHidden, true
}
// HasIsHidden returns a boolean if a field has been set.
func (o *WidgetCustomLink) HasIsHidden() bool {
if o != nil && o.IsHidden != nil {
return true
}
return false
}
// SetIsHidden gets a reference to the given bool and assigns it to the IsHidden field.
func (o *WidgetCustomLink) SetIsHidden(v bool) {
o.IsHidden = &v
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *WidgetCustomLink) GetLabel() string {
if o == nil || o.Label == nil {
var ret string
return ret
}
return *o.Label
}
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WidgetCustomLink) GetLabelOk() (*string, bool) {
if o == nil || o.Label == nil {
return nil, false
}
return o.Label, true
}
// HasLabel returns a boolean if a field has been set.
func (o *WidgetCustomLink) HasLabel() bool {
if o != nil && o.Label != nil {
return true
}
return false
}
// SetLabel gets a reference to the given string and assigns it to the Label field.
func (o *WidgetCustomLink) SetLabel(v string) {
o.Label = &v
}
// GetLink returns the Link field value if set, zero value otherwise.
func (o *WidgetCustomLink) GetLink() string {
if o == nil || o.Link == nil {
var ret string
return ret
}
return *o.Link
}
// GetLinkOk returns a tuple with the Link field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WidgetCustomLink) GetLinkOk() (*string, bool) {
if o == nil || o.Link == nil {
return nil, false
}
return o.Link, true
}
// HasLink returns a boolean if a field has been set.
func (o *WidgetCustomLink) HasLink() bool {
if o != nil && o.Link != nil {
return true
}
return false
}
// SetLink gets a reference to the given string and assigns it to the Link field.
func (o *WidgetCustomLink) SetLink(v string) {
o.Link = &v
}
// GetOverrideLabel returns the OverrideLabel field value if set, zero value otherwise.
func (o *WidgetCustomLink) GetOverrideLabel() string {
if o == nil || o.OverrideLabel == nil {
var ret string
return ret
}
return *o.OverrideLabel
}
// GetOverrideLabelOk returns a tuple with the OverrideLabel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WidgetCustomLink) GetOverrideLabelOk() (*string, bool) {
if o == nil || o.OverrideLabel == nil {
return nil, false
}
return o.OverrideLabel, true
}
// HasOverrideLabel returns a boolean if a field has been set.
func (o *WidgetCustomLink) HasOverrideLabel() bool {
if o != nil && o.OverrideLabel != nil {
return true
}
return false
}
// SetOverrideLabel gets a reference to the given string and assigns it to the OverrideLabel field.
func (o *WidgetCustomLink) SetOverrideLabel(v string) {
o.OverrideLabel = &v
}
func (o WidgetCustomLink) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return json.Marshal(o.UnparsedObject)
}
if o.IsHidden != nil {
toSerialize["is_hidden"] = o.IsHidden
}
if o.Label != nil {
toSerialize["label"] = o.Label
}
if o.Link != nil {
toSerialize["link"] = o.Link
}
if o.OverrideLabel != nil {
toSerialize["override_label"] = o.OverrideLabel
}
return json.Marshal(toSerialize)
}
func (o *WidgetCustomLink) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
IsHidden *bool `json:"is_hidden,omitempty"`
Label *string `json:"label,omitempty"`
Link *string `json:"link,omitempty"`
OverrideLabel *string `json:"override_label,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
return nil
}
o.IsHidden = all.IsHidden
o.Label = all.Label
o.Link = all.Link
o.OverrideLabel = all.OverrideLabel
return nil
}
type NullableWidgetCustomLink struct {
value *WidgetCustomLink
isSet bool
}
func (v NullableWidgetCustomLink) Get() *WidgetCustomLink {
return v.value
}
func (v *NullableWidgetCustomLink) Set(val *WidgetCustomLink) {
v.value = val
v.isSet = true
}
func (v NullableWidgetCustomLink) IsSet() bool {
return v.isSet
}
func (v *NullableWidgetCustomLink) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWidgetCustomLink(val *WidgetCustomLink) *NullableWidgetCustomLink {
return &NullableWidgetCustomLink{value: val, isSet: true}
}
func (v NullableWidgetCustomLink) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWidgetCustomLink) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}