Skip to content

Commit 6e91848

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 817239f2 of spec repo
1 parent 83361af commit 6e91848

18 files changed

+227
-55
lines changed

.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.4",
7-
"regenerated": "2023-01-11 12:48:13.442587",
8-
"spec_repo_commit": "c986b09e"
7+
"regenerated": "2023-01-11 22:36:39.754129",
8+
"spec_repo_commit": "817239f2"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-01-11 12:48:13.454082",
13-
"spec_repo_commit": "c986b09e"
12+
"regenerated": "2023-01-11 22:36:39.768781",
13+
"spec_repo_commit": "817239f2"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13449,6 +13449,8 @@ components:
1344913449
follow_redirects:
1345013450
description: For API HTTP test, whether or not the test should follow redirects.
1345113451
type: boolean
13452+
httpVersion:
13453+
$ref: '#/components/schemas/SyntheticsTestOptionsHTTPVersion'
1345213454
ignoreServerCertificateError:
1345313455
description: Ignore server certificate error for browser tests.
1345413456
type: boolean
@@ -13495,6 +13497,17 @@ components:
1349513497
minimum: 30
1349613498
type: integer
1349713499
type: object
13500+
SyntheticsTestOptionsHTTPVersion:
13501+
description: HTTP version to use for a Synthetic test.
13502+
enum:
13503+
- http1
13504+
- http2
13505+
- any
13506+
type: string
13507+
x-enum-varnames:
13508+
- HTTP1
13509+
- HTTP2
13510+
- HTTP2_FALLBACK_TO_HTTP1
1349813511
SyntheticsTestOptionsMonitorOptions:
1349913512
description: 'Object containing the options for a Synthetic test as a monitor
1350013513

api/datadogV1/model_synthetics_test_options.go

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ type SyntheticsTestOptions struct {
2727
DisableCsp *bool `json:"disableCsp,omitempty"`
2828
// For API HTTP test, whether or not the test should follow redirects.
2929
FollowRedirects *bool `json:"follow_redirects,omitempty"`
30+
// HTTP version to use for a Synthetic test.
31+
HttpVersion *SyntheticsTestOptionsHTTPVersion `json:"httpVersion,omitempty"`
3032
// Ignore server certificate error for browser tests.
3133
IgnoreServerCertificateError *bool `json:"ignoreServerCertificateError,omitempty"`
3234
// Timeout before declaring the initial step as failed (in seconds) for browser tests.
@@ -309,6 +311,34 @@ func (o *SyntheticsTestOptions) SetFollowRedirects(v bool) {
309311
o.FollowRedirects = &v
310312
}
311313

314+
// GetHttpVersion returns the HttpVersion field value if set, zero value otherwise.
315+
func (o *SyntheticsTestOptions) GetHttpVersion() SyntheticsTestOptionsHTTPVersion {
316+
if o == nil || o.HttpVersion == nil {
317+
var ret SyntheticsTestOptionsHTTPVersion
318+
return ret
319+
}
320+
return *o.HttpVersion
321+
}
322+
323+
// GetHttpVersionOk returns a tuple with the HttpVersion field value if set, nil otherwise
324+
// and a boolean to check if the value has been set.
325+
func (o *SyntheticsTestOptions) GetHttpVersionOk() (*SyntheticsTestOptionsHTTPVersion, bool) {
326+
if o == nil || o.HttpVersion == nil {
327+
return nil, false
328+
}
329+
return o.HttpVersion, true
330+
}
331+
332+
// HasHttpVersion returns a boolean if a field has been set.
333+
func (o *SyntheticsTestOptions) HasHttpVersion() bool {
334+
return o != nil && o.HttpVersion != nil
335+
}
336+
337+
// SetHttpVersion gets a reference to the given SyntheticsTestOptionsHTTPVersion and assigns it to the HttpVersion field.
338+
func (o *SyntheticsTestOptions) SetHttpVersion(v SyntheticsTestOptionsHTTPVersion) {
339+
o.HttpVersion = &v
340+
}
341+
312342
// GetIgnoreServerCertificateError returns the IgnoreServerCertificateError field value if set, zero value otherwise.
313343
func (o *SyntheticsTestOptions) GetIgnoreServerCertificateError() bool {
314344
if o == nil || o.IgnoreServerCertificateError == nil {
@@ -675,6 +705,9 @@ func (o SyntheticsTestOptions) MarshalJSON() ([]byte, error) {
675705
if o.FollowRedirects != nil {
676706
toSerialize["follow_redirects"] = o.FollowRedirects
677707
}
708+
if o.HttpVersion != nil {
709+
toSerialize["httpVersion"] = o.HttpVersion
710+
}
678711
if o.IgnoreServerCertificateError != nil {
679712
toSerialize["ignoreServerCertificateError"] = o.IgnoreServerCertificateError
680713
}
@@ -730,6 +763,7 @@ func (o *SyntheticsTestOptions) UnmarshalJSON(bytes []byte) (err error) {
730763
DisableCors *bool `json:"disableCors,omitempty"`
731764
DisableCsp *bool `json:"disableCsp,omitempty"`
732765
FollowRedirects *bool `json:"follow_redirects,omitempty"`
766+
HttpVersion *SyntheticsTestOptionsHTTPVersion `json:"httpVersion,omitempty"`
733767
IgnoreServerCertificateError *bool `json:"ignoreServerCertificateError,omitempty"`
734768
InitialNavigationTimeout *int64 `json:"initialNavigationTimeout,omitempty"`
735769
MinFailureDuration *int64 `json:"min_failure_duration,omitempty"`
@@ -752,6 +786,14 @@ func (o *SyntheticsTestOptions) UnmarshalJSON(bytes []byte) (err error) {
752786
o.UnparsedObject = raw
753787
return nil
754788
}
789+
if v := all.HttpVersion; v != nil && !v.IsValid() {
790+
err = json.Unmarshal(bytes, &raw)
791+
if err != nil {
792+
return err
793+
}
794+
o.UnparsedObject = raw
795+
return nil
796+
}
755797
o.AcceptSelfSigned = all.AcceptSelfSigned
756798
o.AllowInsecure = all.AllowInsecure
757799
o.CheckCertificateRevocation = all.CheckCertificateRevocation
@@ -767,6 +809,7 @@ func (o *SyntheticsTestOptions) UnmarshalJSON(bytes []byte) (err error) {
767809
o.DisableCors = all.DisableCors
768810
o.DisableCsp = all.DisableCsp
769811
o.FollowRedirects = all.FollowRedirects
812+
o.HttpVersion = all.HttpVersion
770813
o.IgnoreServerCertificateError = all.IgnoreServerCertificateError
771814
o.InitialNavigationTimeout = all.InitialNavigationTimeout
772815
o.MinFailureDuration = all.MinFailureDuration
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV1
6+
7+
import (
8+
"encoding/json"
9+
"fmt"
10+
)
11+
12+
// SyntheticsTestOptionsHTTPVersion HTTP version to use for a Synthetic test.
13+
type SyntheticsTestOptionsHTTPVersion string
14+
15+
// List of SyntheticsTestOptionsHTTPVersion.
16+
const (
17+
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1 SyntheticsTestOptionsHTTPVersion = "http1"
18+
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP2 SyntheticsTestOptionsHTTPVersion = "http2"
19+
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP2_FALLBACK_TO_HTTP1 SyntheticsTestOptionsHTTPVersion = "any"
20+
)
21+
22+
var allowedSyntheticsTestOptionsHTTPVersionEnumValues = []SyntheticsTestOptionsHTTPVersion{
23+
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1,
24+
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP2,
25+
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP2_FALLBACK_TO_HTTP1,
26+
}
27+
28+
// GetAllowedValues reeturns the list of possible values.
29+
func (v *SyntheticsTestOptionsHTTPVersion) GetAllowedValues() []SyntheticsTestOptionsHTTPVersion {
30+
return allowedSyntheticsTestOptionsHTTPVersionEnumValues
31+
}
32+
33+
// UnmarshalJSON deserializes the given payload.
34+
func (v *SyntheticsTestOptionsHTTPVersion) UnmarshalJSON(src []byte) error {
35+
var value string
36+
err := json.Unmarshal(src, &value)
37+
if err != nil {
38+
return err
39+
}
40+
*v = SyntheticsTestOptionsHTTPVersion(value)
41+
return nil
42+
}
43+
44+
// NewSyntheticsTestOptionsHTTPVersionFromValue returns a pointer to a valid SyntheticsTestOptionsHTTPVersion
45+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
46+
func NewSyntheticsTestOptionsHTTPVersionFromValue(v string) (*SyntheticsTestOptionsHTTPVersion, error) {
47+
ev := SyntheticsTestOptionsHTTPVersion(v)
48+
if ev.IsValid() {
49+
return &ev, nil
50+
}
51+
return nil, fmt.Errorf("invalid value '%v' for SyntheticsTestOptionsHTTPVersion: valid values are %v", v, allowedSyntheticsTestOptionsHTTPVersionEnumValues)
52+
}
53+
54+
// IsValid return true if the value is valid for the enum, false otherwise.
55+
func (v SyntheticsTestOptionsHTTPVersion) IsValid() bool {
56+
for _, existing := range allowedSyntheticsTestOptionsHTTPVersionEnumValues {
57+
if existing == v {
58+
return true
59+
}
60+
}
61+
return false
62+
}
63+
64+
// Ptr returns reference to SyntheticsTestOptionsHTTPVersion value.
65+
func (v SyntheticsTestOptionsHTTPVersion) Ptr() *SyntheticsTestOptionsHTTPVersion {
66+
return &v
67+
}
68+
69+
// NullableSyntheticsTestOptionsHTTPVersion handles when a null is used for SyntheticsTestOptionsHTTPVersion.
70+
type NullableSyntheticsTestOptionsHTTPVersion struct {
71+
value *SyntheticsTestOptionsHTTPVersion
72+
isSet bool
73+
}
74+
75+
// Get returns the associated value.
76+
func (v NullableSyntheticsTestOptionsHTTPVersion) Get() *SyntheticsTestOptionsHTTPVersion {
77+
return v.value
78+
}
79+
80+
// Set changes the value and indicates it's been called.
81+
func (v *NullableSyntheticsTestOptionsHTTPVersion) Set(val *SyntheticsTestOptionsHTTPVersion) {
82+
v.value = val
83+
v.isSet = true
84+
}
85+
86+
// IsSet returns whether Set has been called.
87+
func (v NullableSyntheticsTestOptionsHTTPVersion) IsSet() bool {
88+
return v.isSet
89+
}
90+
91+
// Unset sets the value to nil and resets the set flag.
92+
func (v *NullableSyntheticsTestOptionsHTTPVersion) Unset() {
93+
v.value = nil
94+
v.isSet = false
95+
}
96+
97+
// NewNullableSyntheticsTestOptionsHTTPVersion initializes the struct as if Set has been called.
98+
func NewNullableSyntheticsTestOptionsHTTPVersion(val *SyntheticsTestOptionsHTTPVersion) *NullableSyntheticsTestOptionsHTTPVersion {
99+
return &NullableSyntheticsTestOptionsHTTPVersion{value: val, isSet: true}
100+
}
101+
102+
// MarshalJSON serializes the associated value.
103+
func (v NullableSyntheticsTestOptionsHTTPVersion) MarshalJSON() ([]byte, error) {
104+
return json.Marshal(v.value)
105+
}
106+
107+
// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called.
108+
func (v *NullableSyntheticsTestOptionsHTTPVersion) UnmarshalJSON(src []byte) error {
109+
v.isSet = true
110+
return json.Unmarshal(src, &v.value)
111+
}

examples/v1/synthetics/CreateSyntheticsAPITest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func main() {
4040
DeviceIds: []datadogV1.SyntheticsDeviceID{
4141
datadogV1.SYNTHETICSDEVICEID_LAPTOP_LARGE,
4242
},
43+
HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1.Ptr(),
4344
MonitorOptions: &datadogV1.SyntheticsTestOptionsMonitorOptions{},
4445
RestrictedRoles: []string{
4546
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",

examples/v1/synthetics/CreateSyntheticsAPITest_1487281163.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ func main() {
111111
Count: datadog.PtrInt64(3),
112112
Interval: datadog.PtrFloat64(10),
113113
},
114-
TickEvery: datadog.PtrInt64(60),
114+
TickEvery: datadog.PtrInt64(60),
115+
HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP2.Ptr(),
115116
},
116117
Subtype: datadogV1.SYNTHETICSTESTDETAILSSUBTYPE_HTTP.Ptr(),
117118
Tags: []string{

examples/v1/synthetics/UpdateBrowserTest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func main() {
6262
DeviceIds: []datadogV1.SyntheticsDeviceID{
6363
datadogV1.SYNTHETICSDEVICEID_LAPTOP_LARGE,
6464
},
65+
HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1.Ptr(),
6566
MonitorOptions: &datadogV1.SyntheticsTestOptionsMonitorOptions{},
6667
RestrictedRoles: []string{
6768
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2022-11-21T13:20:41.192Z
1+
2023-01-11T22:27:09.960Z

0 commit comments

Comments
 (0)