Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-01-11 12:48:13.442587",
"spec_repo_commit": "c986b09e"
"regenerated": "2023-01-12 19:46:00.113071",
"spec_repo_commit": "8506d30d"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-01-11 12:48:13.454082",
"spec_repo_commit": "c986b09e"
"regenerated": "2023-01-12 19:46:00.126061",
"spec_repo_commit": "8506d30d"
}
}
}
13 changes: 13 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13449,6 +13449,8 @@ components:
follow_redirects:
description: For API HTTP test, whether or not the test should follow redirects.
type: boolean
httpVersion:
$ref: '#/components/schemas/SyntheticsTestOptionsHTTPVersion'
ignoreServerCertificateError:
description: Ignore server certificate error for browser tests.
type: boolean
Expand Down Expand Up @@ -13495,6 +13497,17 @@ components:
minimum: 30
type: integer
type: object
SyntheticsTestOptionsHTTPVersion:
description: HTTP version to use for a Synthetic test.
enum:
- http1
- http2
- any
type: string
x-enum-varnames:
- HTTP1
- HTTP2
- ANY
SyntheticsTestOptionsMonitorOptions:
description: 'Object containing the options for a Synthetic test as a monitor

Expand Down
43 changes: 43 additions & 0 deletions api/datadogV1/model_synthetics_test_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type SyntheticsTestOptions struct {
DisableCsp *bool `json:"disableCsp,omitempty"`
// For API HTTP test, whether or not the test should follow redirects.
FollowRedirects *bool `json:"follow_redirects,omitempty"`
// HTTP version to use for a Synthetic test.
HttpVersion *SyntheticsTestOptionsHTTPVersion `json:"httpVersion,omitempty"`
// Ignore server certificate error for browser tests.
IgnoreServerCertificateError *bool `json:"ignoreServerCertificateError,omitempty"`
// Timeout before declaring the initial step as failed (in seconds) for browser tests.
Expand Down Expand Up @@ -309,6 +311,34 @@ func (o *SyntheticsTestOptions) SetFollowRedirects(v bool) {
o.FollowRedirects = &v
}

// GetHttpVersion returns the HttpVersion field value if set, zero value otherwise.
func (o *SyntheticsTestOptions) GetHttpVersion() SyntheticsTestOptionsHTTPVersion {
if o == nil || o.HttpVersion == nil {
var ret SyntheticsTestOptionsHTTPVersion
return ret
}
return *o.HttpVersion
}

// GetHttpVersionOk returns a tuple with the HttpVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTestOptions) GetHttpVersionOk() (*SyntheticsTestOptionsHTTPVersion, bool) {
if o == nil || o.HttpVersion == nil {
return nil, false
}
return o.HttpVersion, true
}

// HasHttpVersion returns a boolean if a field has been set.
func (o *SyntheticsTestOptions) HasHttpVersion() bool {
return o != nil && o.HttpVersion != nil
}

// SetHttpVersion gets a reference to the given SyntheticsTestOptionsHTTPVersion and assigns it to the HttpVersion field.
func (o *SyntheticsTestOptions) SetHttpVersion(v SyntheticsTestOptionsHTTPVersion) {
o.HttpVersion = &v
}

// GetIgnoreServerCertificateError returns the IgnoreServerCertificateError field value if set, zero value otherwise.
func (o *SyntheticsTestOptions) GetIgnoreServerCertificateError() bool {
if o == nil || o.IgnoreServerCertificateError == nil {
Expand Down Expand Up @@ -675,6 +705,9 @@ func (o SyntheticsTestOptions) MarshalJSON() ([]byte, error) {
if o.FollowRedirects != nil {
toSerialize["follow_redirects"] = o.FollowRedirects
}
if o.HttpVersion != nil {
toSerialize["httpVersion"] = o.HttpVersion
}
if o.IgnoreServerCertificateError != nil {
toSerialize["ignoreServerCertificateError"] = o.IgnoreServerCertificateError
}
Expand Down Expand Up @@ -730,6 +763,7 @@ func (o *SyntheticsTestOptions) UnmarshalJSON(bytes []byte) (err error) {
DisableCors *bool `json:"disableCors,omitempty"`
DisableCsp *bool `json:"disableCsp,omitempty"`
FollowRedirects *bool `json:"follow_redirects,omitempty"`
HttpVersion *SyntheticsTestOptionsHTTPVersion `json:"httpVersion,omitempty"`
IgnoreServerCertificateError *bool `json:"ignoreServerCertificateError,omitempty"`
InitialNavigationTimeout *int64 `json:"initialNavigationTimeout,omitempty"`
MinFailureDuration *int64 `json:"min_failure_duration,omitempty"`
Expand All @@ -752,6 +786,14 @@ func (o *SyntheticsTestOptions) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
if v := all.HttpVersion; v != nil && !v.IsValid() {
err = json.Unmarshal(bytes, &raw)
if err != nil {
return err
}
o.UnparsedObject = raw
return nil
}
o.AcceptSelfSigned = all.AcceptSelfSigned
o.AllowInsecure = all.AllowInsecure
o.CheckCertificateRevocation = all.CheckCertificateRevocation
Expand All @@ -767,6 +809,7 @@ func (o *SyntheticsTestOptions) UnmarshalJSON(bytes []byte) (err error) {
o.DisableCors = all.DisableCors
o.DisableCsp = all.DisableCsp
o.FollowRedirects = all.FollowRedirects
o.HttpVersion = all.HttpVersion
o.IgnoreServerCertificateError = all.IgnoreServerCertificateError
o.InitialNavigationTimeout = all.InitialNavigationTimeout
o.MinFailureDuration = all.MinFailureDuration
Expand Down
111 changes: 111 additions & 0 deletions api/datadogV1/model_synthetics_test_options_http_version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// 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 datadogV1

import (
"encoding/json"
"fmt"
)

// SyntheticsTestOptionsHTTPVersion HTTP version to use for a Synthetic test.
type SyntheticsTestOptionsHTTPVersion string

// List of SyntheticsTestOptionsHTTPVersion.
const (
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1 SyntheticsTestOptionsHTTPVersion = "http1"
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP2 SyntheticsTestOptionsHTTPVersion = "http2"
SYNTHETICSTESTOPTIONSHTTPVERSION_ANY SyntheticsTestOptionsHTTPVersion = "any"
)

var allowedSyntheticsTestOptionsHTTPVersionEnumValues = []SyntheticsTestOptionsHTTPVersion{
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1,
SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP2,
SYNTHETICSTESTOPTIONSHTTPVERSION_ANY,
}

// GetAllowedValues reeturns the list of possible values.
func (v *SyntheticsTestOptionsHTTPVersion) GetAllowedValues() []SyntheticsTestOptionsHTTPVersion {
return allowedSyntheticsTestOptionsHTTPVersionEnumValues
}

// UnmarshalJSON deserializes the given payload.
func (v *SyntheticsTestOptionsHTTPVersion) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
*v = SyntheticsTestOptionsHTTPVersion(value)
return nil
}

// NewSyntheticsTestOptionsHTTPVersionFromValue returns a pointer to a valid SyntheticsTestOptionsHTTPVersion
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
func NewSyntheticsTestOptionsHTTPVersionFromValue(v string) (*SyntheticsTestOptionsHTTPVersion, error) {
ev := SyntheticsTestOptionsHTTPVersion(v)
if ev.IsValid() {
return &ev, nil
}
return nil, fmt.Errorf("invalid value '%v' for SyntheticsTestOptionsHTTPVersion: valid values are %v", v, allowedSyntheticsTestOptionsHTTPVersionEnumValues)
}

// IsValid return true if the value is valid for the enum, false otherwise.
func (v SyntheticsTestOptionsHTTPVersion) IsValid() bool {
for _, existing := range allowedSyntheticsTestOptionsHTTPVersionEnumValues {
if existing == v {
return true
}
}
return false
}

// Ptr returns reference to SyntheticsTestOptionsHTTPVersion value.
func (v SyntheticsTestOptionsHTTPVersion) Ptr() *SyntheticsTestOptionsHTTPVersion {
return &v
}

// NullableSyntheticsTestOptionsHTTPVersion handles when a null is used for SyntheticsTestOptionsHTTPVersion.
type NullableSyntheticsTestOptionsHTTPVersion struct {
value *SyntheticsTestOptionsHTTPVersion
isSet bool
}

// Get returns the associated value.
func (v NullableSyntheticsTestOptionsHTTPVersion) Get() *SyntheticsTestOptionsHTTPVersion {
return v.value
}

// Set changes the value and indicates it's been called.
func (v *NullableSyntheticsTestOptionsHTTPVersion) Set(val *SyntheticsTestOptionsHTTPVersion) {
v.value = val
v.isSet = true
}

// IsSet returns whether Set has been called.
func (v NullableSyntheticsTestOptionsHTTPVersion) IsSet() bool {
return v.isSet
}

// Unset sets the value to nil and resets the set flag.
func (v *NullableSyntheticsTestOptionsHTTPVersion) Unset() {
v.value = nil
v.isSet = false
}

// NewNullableSyntheticsTestOptionsHTTPVersion initializes the struct as if Set has been called.
func NewNullableSyntheticsTestOptionsHTTPVersion(val *SyntheticsTestOptionsHTTPVersion) *NullableSyntheticsTestOptionsHTTPVersion {
return &NullableSyntheticsTestOptionsHTTPVersion{value: val, isSet: true}
}

// MarshalJSON serializes the associated value.
func (v NullableSyntheticsTestOptionsHTTPVersion) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}

// UnmarshalJSON deserializes the payload and sets the flag as if Set has been called.
func (v *NullableSyntheticsTestOptionsHTTPVersion) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
1 change: 1 addition & 0 deletions examples/v1/synthetics/CreateSyntheticsAPITest.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func main() {
DeviceIds: []datadogV1.SyntheticsDeviceID{
datadogV1.SYNTHETICSDEVICEID_LAPTOP_LARGE,
},
HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1.Ptr(),
MonitorOptions: &datadogV1.SyntheticsTestOptionsMonitorOptions{},
RestrictedRoles: []string{
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ func main() {
Count: datadog.PtrInt64(3),
Interval: datadog.PtrFloat64(10),
},
TickEvery: datadog.PtrInt64(60),
TickEvery: datadog.PtrInt64(60),
HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP2.Ptr(),
},
Subtype: datadogV1.SYNTHETICSTESTDETAILSSUBTYPE_HTTP.Ptr(),
Tags: []string{
Expand Down
1 change: 1 addition & 0 deletions examples/v1/synthetics/UpdateBrowserTest.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func main() {
DeviceIds: []datadogV1.SyntheticsDeviceID{
datadogV1.SYNTHETICSDEVICEID_LAPTOP_LARGE,
},
HttpVersion: datadogV1.SYNTHETICSTESTOPTIONSHTTPVERSION_HTTP1.Ptr(),
MonitorOptions: &datadogV1.SyntheticsTestOptionsMonitorOptions{},
RestrictedRoles: []string{
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-11-21T13:20:41.192Z
2023-01-11T22:27:09.960Z
Loading