Skip to content

Commit c1627f9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 74866a53 of spec repo
1 parent 9522a0d commit c1627f9

8 files changed

Lines changed: 54 additions & 53 deletions

File tree

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-06-20 19:51:49.000722",
8-
"spec_repo_commit": "51272749"
7+
"regenerated": "2025-06-23 07:59:29.359544",
8+
"spec_repo_commit": "74866a53"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-06-20 19:51:49.016467",
13-
"spec_repo_commit": "51272749"
12+
"regenerated": "2025-06-23 07:59:29.376654",
13+
"spec_repo_commit": "74866a53"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14785,9 +14785,6 @@ components:
1478514785
description: Username to use for the basic authentication.
1478614786
example: my_username
1478714787
type: string
14788-
required:
14789-
- password
14790-
- username
1479114788
type: object
1479214789
SyntheticsBasicAuthWebType:
1479314790
default: web

api/datadogV1/model_synthetics_basic_auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (obj *SyntheticsBasicAuth) UnmarshalJSON(data []byte) error {
6060
if err == nil {
6161
if obj.SyntheticsBasicAuthWeb != nil && obj.SyntheticsBasicAuthWeb.UnparsedObject == nil {
6262
jsonSyntheticsBasicAuthWeb, _ := datadog.Marshal(obj.SyntheticsBasicAuthWeb)
63-
if string(jsonSyntheticsBasicAuthWeb) == "{}" { // empty struct
63+
if string(jsonSyntheticsBasicAuthWeb) == "{}" && string(data) != "{}" { // empty struct
6464
obj.SyntheticsBasicAuthWeb = nil
6565
} else {
6666
match++

api/datadogV1/model_synthetics_basic_auth_web.go

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@
55
package datadogV1
66

77
import (
8-
"fmt"
9-
108
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
119
)
1210

1311
// SyntheticsBasicAuthWeb Object to handle basic authentication when performing the test.
1412
type SyntheticsBasicAuthWeb struct {
1513
// Password to use for the basic authentication.
16-
Password string `json:"password"`
14+
Password *string `json:"password,omitempty"`
1715
// The type of basic authentication to use when performing the test.
1816
Type *SyntheticsBasicAuthWebType `json:"type,omitempty"`
1917
// Username to use for the basic authentication.
20-
Username string `json:"username"`
18+
Username *string `json:"username,omitempty"`
2119
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2220
UnparsedObject map[string]interface{} `json:"-"`
2321
AdditionalProperties map[string]interface{} `json:"-"`
@@ -27,12 +25,10 @@ type SyntheticsBasicAuthWeb struct {
2725
// This constructor will assign default values to properties that have it defined,
2826
// and makes sure properties required by API are set, but the set of arguments
2927
// will change when the set of required properties is changed.
30-
func NewSyntheticsBasicAuthWeb(password string, username string) *SyntheticsBasicAuthWeb {
28+
func NewSyntheticsBasicAuthWeb() *SyntheticsBasicAuthWeb {
3129
this := SyntheticsBasicAuthWeb{}
32-
this.Password = password
3330
var typeVar SyntheticsBasicAuthWebType = SYNTHETICSBASICAUTHWEBTYPE_WEB
3431
this.Type = &typeVar
35-
this.Username = username
3632
return &this
3733
}
3834

@@ -46,27 +42,32 @@ func NewSyntheticsBasicAuthWebWithDefaults() *SyntheticsBasicAuthWeb {
4642
return &this
4743
}
4844

49-
// GetPassword returns the Password field value.
45+
// GetPassword returns the Password field value if set, zero value otherwise.
5046
func (o *SyntheticsBasicAuthWeb) GetPassword() string {
51-
if o == nil {
47+
if o == nil || o.Password == nil {
5248
var ret string
5349
return ret
5450
}
55-
return o.Password
51+
return *o.Password
5652
}
5753

58-
// GetPasswordOk returns a tuple with the Password field value
54+
// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise
5955
// and a boolean to check if the value has been set.
6056
func (o *SyntheticsBasicAuthWeb) GetPasswordOk() (*string, bool) {
61-
if o == nil {
57+
if o == nil || o.Password == nil {
6258
return nil, false
6359
}
64-
return &o.Password, true
60+
return o.Password, true
61+
}
62+
63+
// HasPassword returns a boolean if a field has been set.
64+
func (o *SyntheticsBasicAuthWeb) HasPassword() bool {
65+
return o != nil && o.Password != nil
6566
}
6667

67-
// SetPassword sets field value.
68+
// SetPassword gets a reference to the given string and assigns it to the Password field.
6869
func (o *SyntheticsBasicAuthWeb) SetPassword(v string) {
69-
o.Password = v
70+
o.Password = &v
7071
}
7172

7273
// GetType returns the Type field value if set, zero value otherwise.
@@ -97,27 +98,32 @@ func (o *SyntheticsBasicAuthWeb) SetType(v SyntheticsBasicAuthWebType) {
9798
o.Type = &v
9899
}
99100

100-
// GetUsername returns the Username field value.
101+
// GetUsername returns the Username field value if set, zero value otherwise.
101102
func (o *SyntheticsBasicAuthWeb) GetUsername() string {
102-
if o == nil {
103+
if o == nil || o.Username == nil {
103104
var ret string
104105
return ret
105106
}
106-
return o.Username
107+
return *o.Username
107108
}
108109

109-
// GetUsernameOk returns a tuple with the Username field value
110+
// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise
110111
// and a boolean to check if the value has been set.
111112
func (o *SyntheticsBasicAuthWeb) GetUsernameOk() (*string, bool) {
112-
if o == nil {
113+
if o == nil || o.Username == nil {
113114
return nil, false
114115
}
115-
return &o.Username, true
116+
return o.Username, true
117+
}
118+
119+
// HasUsername returns a boolean if a field has been set.
120+
func (o *SyntheticsBasicAuthWeb) HasUsername() bool {
121+
return o != nil && o.Username != nil
116122
}
117123

118-
// SetUsername sets field value.
124+
// SetUsername gets a reference to the given string and assigns it to the Username field.
119125
func (o *SyntheticsBasicAuthWeb) SetUsername(v string) {
120-
o.Username = v
126+
o.Username = &v
121127
}
122128

123129
// MarshalJSON serializes the struct using spec logic.
@@ -126,11 +132,15 @@ func (o SyntheticsBasicAuthWeb) MarshalJSON() ([]byte, error) {
126132
if o.UnparsedObject != nil {
127133
return datadog.Marshal(o.UnparsedObject)
128134
}
129-
toSerialize["password"] = o.Password
135+
if o.Password != nil {
136+
toSerialize["password"] = o.Password
137+
}
130138
if o.Type != nil {
131139
toSerialize["type"] = o.Type
132140
}
133-
toSerialize["username"] = o.Username
141+
if o.Username != nil {
142+
toSerialize["username"] = o.Username
143+
}
134144

135145
for key, value := range o.AdditionalProperties {
136146
toSerialize[key] = value
@@ -141,19 +151,13 @@ func (o SyntheticsBasicAuthWeb) MarshalJSON() ([]byte, error) {
141151
// UnmarshalJSON deserializes the given payload.
142152
func (o *SyntheticsBasicAuthWeb) UnmarshalJSON(bytes []byte) (err error) {
143153
all := struct {
144-
Password *string `json:"password"`
154+
Password *string `json:"password,omitempty"`
145155
Type *SyntheticsBasicAuthWebType `json:"type,omitempty"`
146-
Username *string `json:"username"`
156+
Username *string `json:"username,omitempty"`
147157
}{}
148158
if err = datadog.Unmarshal(bytes, &all); err != nil {
149159
return datadog.Unmarshal(bytes, &o.UnparsedObject)
150160
}
151-
if all.Password == nil {
152-
return fmt.Errorf("required field password missing")
153-
}
154-
if all.Username == nil {
155-
return fmt.Errorf("required field username missing")
156-
}
157161
additionalProperties := make(map[string]interface{})
158162
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
159163
datadog.DeleteKeys(additionalProperties, &[]string{"password", "type", "username"})
@@ -162,13 +166,13 @@ func (o *SyntheticsBasicAuthWeb) UnmarshalJSON(bytes []byte) (err error) {
162166
}
163167

164168
hasInvalidField := false
165-
o.Password = *all.Password
169+
o.Password = all.Password
166170
if all.Type != nil && !all.Type.IsValid() {
167171
hasInvalidField = true
168172
} else {
169173
o.Type = all.Type
170174
}
171-
o.Username = *all.Username
175+
o.Username = all.Username
172176

173177
if len(additionalProperties) > 0 {
174178
o.AdditionalProperties = additionalProperties

examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ func main() {
234234
BasicAuth: &datadogV1.SyntheticsBasicAuth{
235235
SyntheticsBasicAuthWeb: &datadogV1.SyntheticsBasicAuthWeb{
236236
Type: datadogV1.SYNTHETICSBASICAUTHWEBTYPE_WEB.Ptr(),
237-
Username: "user",
238-
Password: "password",
237+
Username: datadog.PtrString("user"),
238+
Password: datadog.PtrString("password"),
239239
}},
240240
},
241241
}},

examples/v1/synthetics/CreateSyntheticsAPITest_1717840259.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func main() {
3333
Method: datadog.PtrString("GET"),
3434
BasicAuth: &datadogV1.SyntheticsBasicAuth{
3535
SyntheticsBasicAuthWeb: &datadogV1.SyntheticsBasicAuthWeb{
36-
Password: "password",
37-
Username: "username",
36+
Password: datadog.PtrString("password"),
37+
Username: datadog.PtrString("username"),
3838
}},
3939
},
4040
Subtype: datadogV1.SYNTHETICSAPITESTSTEPSUBTYPE_HTTP,
@@ -56,8 +56,8 @@ func main() {
5656
Method: datadog.PtrString("GET"),
5757
BasicAuth: &datadogV1.SyntheticsBasicAuth{
5858
SyntheticsBasicAuthWeb: &datadogV1.SyntheticsBasicAuthWeb{
59-
Password: "password",
60-
Username: "username",
59+
Password: datadog.PtrString("password"),
60+
Username: datadog.PtrString("username"),
6161
Type: datadogV1.SYNTHETICSBASICAUTHWEBTYPE_WEB.Ptr(),
6262
}},
6363
},

examples/v1/synthetics/TriggerCITests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ func main() {
1818
{
1919
BasicAuth: &datadogV1.SyntheticsBasicAuth{
2020
SyntheticsBasicAuthWeb: &datadogV1.SyntheticsBasicAuthWeb{
21-
Password: "PaSSw0RD!",
21+
Password: datadog.PtrString("PaSSw0RD!"),
2222
Type: datadogV1.SYNTHETICSBASICAUTHWEBTYPE_WEB.Ptr(),
23-
Username: "my_username",
23+
Username: datadog.PtrString("my_username"),
2424
}},
2525
DeviceIds: []string{
2626
"chrome.laptop_large",

examples/v1/synthetics/UpdateBrowserTest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ func main() {
2626
Request: datadogV1.SyntheticsTestRequest{
2727
BasicAuth: &datadogV1.SyntheticsBasicAuth{
2828
SyntheticsBasicAuthWeb: &datadogV1.SyntheticsBasicAuthWeb{
29-
Password: "PaSSw0RD!",
29+
Password: datadog.PtrString("PaSSw0RD!"),
3030
Type: datadogV1.SYNTHETICSBASICAUTHWEBTYPE_WEB.Ptr(),
31-
Username: "my_username",
31+
Username: datadog.PtrString("my_username"),
3232
}},
3333
BodyType: datadogV1.SYNTHETICSTESTREQUESTBODYTYPE_TEXT_PLAIN.Ptr(),
3434
CallType: datadogV1.SYNTHETICSTESTCALLTYPE_UNARY.Ptr(),

0 commit comments

Comments
 (0)