From de22f80d51ca457aa05593b0dc6719149c0a6e44 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2020 10:13:02 +0200 Subject: [PATCH] Update synthetics test to contain latest features (#375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update to use new target objects * Add new target * Remove the integer target * Add test showing failure * Regenerate client from commit 44c5568 of spec repo Co-authored-by: Thomas Hervé Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- api/v1/datadog/.openapi-generator/FILES | 8 + api/v1/datadog/README.md | 4 + api/v1/datadog/api/openapi.yaml | 54 ++++- api/v1/datadog/docs/SyntheticsApi.md | 4 +- api/v1/datadog/docs/SyntheticsAssertion.md | 18 +- .../SyntheticsAssertionJSONPathOperator.md | 11 + .../docs/SyntheticsAssertionJSONPathTarget.md | 124 +++++++++++ ...SyntheticsAssertionJSONPathTargetTarget.md | 108 +++++++++ .../datadog/docs/SyntheticsAssertionTarget.md | 124 +++++++++++ api/v1/datadog/model_synthetics_assertion.go | 203 ++++++----------- ...synthetics_assertion_json_path_operator.go | 80 +++++++ ...l_synthetics_assertion_json_path_target.go | 206 +++++++++++++++++ ...etics_assertion_json_path_target_target.go | 186 ++++++++++++++++ .../model_synthetics_assertion_operator.go | 4 +- .../model_synthetics_assertion_target.go | 207 ++++++++++++++++++ tests/api/v1/datadog/api_synthetics_test.go | 59 ++++- .../TestSyntheticsAPITestLifecycle.freeze | 2 +- .../TestSyntheticsAPITestLifecycle.yaml | 176 +++++++-------- 19 files changed, 1319 insertions(+), 267 deletions(-) create mode 100644 api/v1/datadog/docs/SyntheticsAssertionJSONPathOperator.md create mode 100644 api/v1/datadog/docs/SyntheticsAssertionJSONPathTarget.md create mode 100644 api/v1/datadog/docs/SyntheticsAssertionJSONPathTargetTarget.md create mode 100644 api/v1/datadog/docs/SyntheticsAssertionTarget.md create mode 100644 api/v1/datadog/model_synthetics_assertion_json_path_operator.go create mode 100644 api/v1/datadog/model_synthetics_assertion_json_path_target.go create mode 100644 api/v1/datadog/model_synthetics_assertion_json_path_target_target.go create mode 100644 api/v1/datadog/model_synthetics_assertion_target.go diff --git a/.apigentools-info b/.apigentools-info index 6696766e35b..22883207e2e 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.2.0", - "regenerated": "2020-07-02 22:52:46.497889", - "spec_repo_commit": "4d84e86" + "regenerated": "2020-07-08 07:59:40.929470", + "spec_repo_commit": "44c5568" }, "v2": { "apigentools_version": "1.2.0", - "regenerated": "2020-07-02 22:52:51.322419", - "spec_repo_commit": "4d84e86" + "regenerated": "2020-07-08 07:59:45.823088", + "spec_repo_commit": "44c5568" } } } \ No newline at end of file diff --git a/api/v1/datadog/.openapi-generator/FILES b/api/v1/datadog/.openapi-generator/FILES index a94a7a72730..5e3b2a0fa2d 100644 --- a/api/v1/datadog/.openapi-generator/FILES +++ b/api/v1/datadog/.openapi-generator/FILES @@ -286,7 +286,11 @@ docs/SyntheticsAPITestResultShort.md docs/SyntheticsAPITestResultShortResult.md docs/SyntheticsApi.md docs/SyntheticsAssertion.md +docs/SyntheticsAssertionJSONPathOperator.md +docs/SyntheticsAssertionJSONPathTarget.md +docs/SyntheticsAssertionJSONPathTargetTarget.md docs/SyntheticsAssertionOperator.md +docs/SyntheticsAssertionTarget.md docs/SyntheticsAssertionType.md docs/SyntheticsBrowserError.md docs/SyntheticsBrowserErrorType.md @@ -670,7 +674,11 @@ model_synthetics_api_test_result_full_check.go model_synthetics_api_test_result_short.go model_synthetics_api_test_result_short_result.go model_synthetics_assertion.go +model_synthetics_assertion_json_path_operator.go +model_synthetics_assertion_json_path_target.go +model_synthetics_assertion_json_path_target_target.go model_synthetics_assertion_operator.go +model_synthetics_assertion_target.go model_synthetics_assertion_type.go model_synthetics_browser_error.go model_synthetics_browser_error_type.go diff --git a/api/v1/datadog/README.md b/api/v1/datadog/README.md index d236ed35bd3..ae82acbc39b 100644 --- a/api/v1/datadog/README.md +++ b/api/v1/datadog/README.md @@ -450,7 +450,11 @@ Class | Method | HTTP request | Description - [SyntheticsAPITestResultShort](docs/SyntheticsAPITestResultShort.md) - [SyntheticsAPITestResultShortResult](docs/SyntheticsAPITestResultShortResult.md) - [SyntheticsAssertion](docs/SyntheticsAssertion.md) + - [SyntheticsAssertionJSONPathOperator](docs/SyntheticsAssertionJSONPathOperator.md) + - [SyntheticsAssertionJSONPathTarget](docs/SyntheticsAssertionJSONPathTarget.md) + - [SyntheticsAssertionJSONPathTargetTarget](docs/SyntheticsAssertionJSONPathTargetTarget.md) - [SyntheticsAssertionOperator](docs/SyntheticsAssertionOperator.md) + - [SyntheticsAssertionTarget](docs/SyntheticsAssertionTarget.md) - [SyntheticsAssertionType](docs/SyntheticsAssertionType.md) - [SyntheticsBrowserError](docs/SyntheticsBrowserError.md) - [SyntheticsBrowserErrorType](docs/SyntheticsBrowserErrorType.md) diff --git a/api/v1/datadog/api/openapi.yaml b/api/v1/datadog/api/openapi.yaml index 620fa15424b..1f9a1ced20c 100644 --- a/api/v1/datadog/api/openapi.yaml +++ b/api/v1/datadog/api/openapi.yaml @@ -12396,17 +12396,28 @@ components: SyntheticsAssertion: description: |- Object describing the assertions type, their associated operator, - which property they apply , and upon which target. + which property they apply, and upon which target. + oneOf: + - $ref: '#/components/schemas/SyntheticsAssertionTarget' + - $ref: '#/components/schemas/SyntheticsAssertionJSONPathTarget' + type: object + SyntheticsAssertionJSONPathOperator: + description: Assertion operator to apply. + enum: + - validatesJSONPath + type: string + x-enum-varnames: + - VALIDATES_JSON_PATH + SyntheticsAssertionJSONPathTarget: + description: An assertion for the `validatesJSONPath` operator. properties: operator: - $ref: '#/components/schemas/SyntheticsAssertionOperator' + $ref: '#/components/schemas/SyntheticsAssertionJSONPathOperator' property: description: The associated assertion property. type: string target: - description: Target to apply the assertion to. It can be a string, a number, - or a Date. - type: object + $ref: '#/components/schemas/SyntheticsAssertionJSONPathTarget_target' type: $ref: '#/components/schemas/SyntheticsAssertionType' required: @@ -12421,10 +12432,12 @@ components: - is - isNot - lessThan + - moreThan - matches - doesNotMatch - validates - isInMoreThan + - isInLessThan type: string x-enum-varnames: - CONTAINS @@ -12432,10 +12445,29 @@ components: - IS - IS_NOT - LESS_THAN + - MORE_THAN - MATCHES - DOES_NOT_MATCH - VALIDATES - IS_IN_MORE_DAYS_THAN + - IS_IN_LESS_DAYS_THAN + SyntheticsAssertionTarget: + description: An assertion which uses a simple target. + properties: + operator: + $ref: '#/components/schemas/SyntheticsAssertionOperator' + property: + description: The associated assertion property. + type: string + target: + description: Value used by the operator. + type: object + type: + $ref: '#/components/schemas/SyntheticsAssertionType' + required: + - operator + - type + type: object SyntheticsAssertionType: description: Type of the assertion. enum: @@ -17637,6 +17669,18 @@ components: properties: timings: $ref: '#/components/schemas/SyntheticsTiming' + SyntheticsAssertionJSONPathTarget_target: + description: Composed target for `validatesJSONPath` operator. + properties: + jsonPath: + description: The JSON path to assert. + type: string + operator: + description: The specific operator to use on the path. + type: string + targetValue: + description: The path target value to compare to. + type: object SyntheticsBrowserTestResultFull_check: description: Object describing the browser test configuration. example: diff --git a/api/v1/datadog/docs/SyntheticsApi.md b/api/v1/datadog/docs/SyntheticsApi.md index 14671ac3bd5..cb08246d220 100644 --- a/api/v1/datadog/docs/SyntheticsApi.md +++ b/api/v1/datadog/docs/SyntheticsApi.md @@ -53,7 +53,7 @@ func main() { }, ) - body := datadog.SyntheticsTestDetails{Config: datadog.SyntheticsTestConfig{Assertions: []SyntheticsAssertion{datadog.SyntheticsAssertion{Operator: datadog.SyntheticsAssertionOperator{}, Property: "Property_example", Target: 123, Type: datadog.SyntheticsAssertionType{}}), Request: datadog.SyntheticsTestRequest{BasicAuth: datadog.SyntheticsTestRequest_basicAuth{Password: "Password_example", Username: "Username_example"}, Body: "Body_example", Headers: map[string]string{ "Key" = "Value" }, Host: "Host_example", Method: datadog.HTTPMethod{}, Port: int64(123), Query: 123, Timeout: 123, Url: "Url_example"}, Variables: []SyntheticsBrowserVariable{datadog.SyntheticsBrowserVariable{Example: "Example_example", Id: "Id_example", Name: "Name_example", Pattern: "Pattern_example", Type: datadog.SyntheticsBrowserVariableType{}})}, Locations: []string{"Locations_example"), Message: "Message_example", MonitorId: int64(123), Name: "Name_example", Options: datadog.SyntheticsTestOptions{AcceptSelfSigned: false, AllowInsecure: false, DeviceIds: []SyntheticsDeviceID{datadog.SyntheticsDeviceID{}), FollowRedirects: false, MinFailureDuration: int64(123), MinLocationFailed: int64(123), Retry: datadog.SyntheticsTestOptions_retry{Count: int64(123), Interval: 123}, TickEvery: datadog.SyntheticsTickInterval{}}, PublicId: "PublicId_example", Status: datadog.SyntheticsTestPauseStatus{}, Steps: []SyntheticsStep{datadog.SyntheticsStep{AllowFailure: false, Name: "Name_example", Params: 123, Timeout: 123, Type: datadog.SyntheticsStepType{}}), Subtype: datadog.SyntheticsTestDetailsSubType{}, Tags: []string{"Tags_example"), Type: datadog.SyntheticsTestDetailsType{}} // SyntheticsTestDetails | Details of the test to create. + body := datadog.SyntheticsTestDetails{Config: datadog.SyntheticsTestConfig{Assertions: []SyntheticsAssertion{datadog.SyntheticsAssertion{Operator: datadog.SyntheticsAssertionJSONPathOperator{}, Property: "Property_example", Target: datadog.SyntheticsAssertionJSONPathTarget_target{JsonPath: "JsonPath_example", Operator: "Operator_example", TargetValue: 123}, Type: datadog.SyntheticsAssertionType{}}), Request: datadog.SyntheticsTestRequest{BasicAuth: datadog.SyntheticsTestRequest_basicAuth{Password: "Password_example", Username: "Username_example"}, Body: "Body_example", Headers: map[string]string{ "Key" = "Value" }, Host: "Host_example", Method: datadog.HTTPMethod{}, Port: int64(123), Query: 123, Timeout: 123, Url: "Url_example"}, Variables: []SyntheticsBrowserVariable{datadog.SyntheticsBrowserVariable{Example: "Example_example", Id: "Id_example", Name: "Name_example", Pattern: "Pattern_example", Type: datadog.SyntheticsBrowserVariableType{}})}, Locations: []string{"Locations_example"), Message: "Message_example", MonitorId: int64(123), Name: "Name_example", Options: datadog.SyntheticsTestOptions{AcceptSelfSigned: false, AllowInsecure: false, DeviceIds: []SyntheticsDeviceID{datadog.SyntheticsDeviceID{}), FollowRedirects: false, MinFailureDuration: int64(123), MinLocationFailed: int64(123), Retry: datadog.SyntheticsTestOptions_retry{Count: int64(123), Interval: 123}, TickEvery: datadog.SyntheticsTickInterval{}}, PublicId: "PublicId_example", Status: datadog.SyntheticsTestPauseStatus{}, Steps: []SyntheticsStep{datadog.SyntheticsStep{AllowFailure: false, Name: "Name_example", Params: 123, Timeout: 123, Type: datadog.SyntheticsStepType{}}), Subtype: datadog.SyntheticsTestDetailsSubType{}, Tags: []string{"Tags_example"), Type: datadog.SyntheticsTestDetailsType{}} // SyntheticsTestDetails | Details of the test to create. configuration := datadog.NewConfiguration() api_client := datadog.NewAPIClient(configuration) @@ -881,7 +881,7 @@ func main() { ) publicId := "publicId_example" // string | The public ID of the test to get details from. - body := datadog.SyntheticsTestDetails{Config: datadog.SyntheticsTestConfig{Assertions: []SyntheticsAssertion{datadog.SyntheticsAssertion{Operator: datadog.SyntheticsAssertionOperator{}, Property: "Property_example", Target: 123, Type: datadog.SyntheticsAssertionType{}}), Request: datadog.SyntheticsTestRequest{BasicAuth: datadog.SyntheticsTestRequest_basicAuth{Password: "Password_example", Username: "Username_example"}, Body: "Body_example", Headers: map[string]string{ "Key" = "Value" }, Host: "Host_example", Method: datadog.HTTPMethod{}, Port: int64(123), Query: 123, Timeout: 123, Url: "Url_example"}, Variables: []SyntheticsBrowserVariable{datadog.SyntheticsBrowserVariable{Example: "Example_example", Id: "Id_example", Name: "Name_example", Pattern: "Pattern_example", Type: datadog.SyntheticsBrowserVariableType{}})}, Locations: []string{"Locations_example"), Message: "Message_example", MonitorId: int64(123), Name: "Name_example", Options: datadog.SyntheticsTestOptions{AcceptSelfSigned: false, AllowInsecure: false, DeviceIds: []SyntheticsDeviceID{datadog.SyntheticsDeviceID{}), FollowRedirects: false, MinFailureDuration: int64(123), MinLocationFailed: int64(123), Retry: datadog.SyntheticsTestOptions_retry{Count: int64(123), Interval: 123}, TickEvery: datadog.SyntheticsTickInterval{}}, PublicId: "PublicId_example", Status: datadog.SyntheticsTestPauseStatus{}, Steps: []SyntheticsStep{datadog.SyntheticsStep{AllowFailure: false, Name: "Name_example", Params: 123, Timeout: 123, Type: datadog.SyntheticsStepType{}}), Subtype: datadog.SyntheticsTestDetailsSubType{}, Tags: []string{"Tags_example"), Type: datadog.SyntheticsTestDetailsType{}} // SyntheticsTestDetails | New test details to be saved. + body := datadog.SyntheticsTestDetails{Config: datadog.SyntheticsTestConfig{Assertions: []SyntheticsAssertion{datadog.SyntheticsAssertion{Operator: datadog.SyntheticsAssertionJSONPathOperator{}, Property: "Property_example", Target: datadog.SyntheticsAssertionJSONPathTarget_target{JsonPath: "JsonPath_example", Operator: "Operator_example", TargetValue: 123}, Type: datadog.SyntheticsAssertionType{}}), Request: datadog.SyntheticsTestRequest{BasicAuth: datadog.SyntheticsTestRequest_basicAuth{Password: "Password_example", Username: "Username_example"}, Body: "Body_example", Headers: map[string]string{ "Key" = "Value" }, Host: "Host_example", Method: datadog.HTTPMethod{}, Port: int64(123), Query: 123, Timeout: 123, Url: "Url_example"}, Variables: []SyntheticsBrowserVariable{datadog.SyntheticsBrowserVariable{Example: "Example_example", Id: "Id_example", Name: "Name_example", Pattern: "Pattern_example", Type: datadog.SyntheticsBrowserVariableType{}})}, Locations: []string{"Locations_example"), Message: "Message_example", MonitorId: int64(123), Name: "Name_example", Options: datadog.SyntheticsTestOptions{AcceptSelfSigned: false, AllowInsecure: false, DeviceIds: []SyntheticsDeviceID{datadog.SyntheticsDeviceID{}), FollowRedirects: false, MinFailureDuration: int64(123), MinLocationFailed: int64(123), Retry: datadog.SyntheticsTestOptions_retry{Count: int64(123), Interval: 123}, TickEvery: datadog.SyntheticsTickInterval{}}, PublicId: "PublicId_example", Status: datadog.SyntheticsTestPauseStatus{}, Steps: []SyntheticsStep{datadog.SyntheticsStep{AllowFailure: false, Name: "Name_example", Params: 123, Timeout: 123, Type: datadog.SyntheticsStepType{}}), Subtype: datadog.SyntheticsTestDetailsSubType{}, Tags: []string{"Tags_example"), Type: datadog.SyntheticsTestDetailsType{}} // SyntheticsTestDetails | New test details to be saved. configuration := datadog.NewConfiguration() api_client := datadog.NewAPIClient(configuration) diff --git a/api/v1/datadog/docs/SyntheticsAssertion.md b/api/v1/datadog/docs/SyntheticsAssertion.md index 030056adb6d..2318e74c720 100644 --- a/api/v1/datadog/docs/SyntheticsAssertion.md +++ b/api/v1/datadog/docs/SyntheticsAssertion.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Operator** | Pointer to [**SyntheticsAssertionOperator**](SyntheticsAssertionOperator.md) | | +**Operator** | Pointer to [**SyntheticsAssertionJSONPathOperator**](SyntheticsAssertionJSONPathOperator.md) | | **Property** | Pointer to **string** | The associated assertion property. | [optional] -**Target** | Pointer to **interface{}** | Target to apply the assertion to. It can be a string, a number, or a Date. | [optional] +**Target** | Pointer to [**SyntheticsAssertionJSONPathTargetTarget**](SyntheticsAssertionJSONPathTarget_target.md) | | [optional] **Type** | Pointer to [**SyntheticsAssertionType**](SyntheticsAssertionType.md) | | ## Methods ### NewSyntheticsAssertion -`func NewSyntheticsAssertion(operator SyntheticsAssertionOperator, type_ SyntheticsAssertionType, ) *SyntheticsAssertion` +`func NewSyntheticsAssertion(operator SyntheticsAssertionJSONPathOperator, type_ SyntheticsAssertionType, ) *SyntheticsAssertion` NewSyntheticsAssertion instantiates a new SyntheticsAssertion object This constructor will assign default values to properties that have it defined, @@ -30,20 +30,20 @@ but it doesn't guarantee that properties required by API are set ### GetOperator -`func (o *SyntheticsAssertion) GetOperator() SyntheticsAssertionOperator` +`func (o *SyntheticsAssertion) GetOperator() SyntheticsAssertionJSONPathOperator` GetOperator returns the Operator field if non-nil, zero value otherwise. ### GetOperatorOk -`func (o *SyntheticsAssertion) GetOperatorOk() (*SyntheticsAssertionOperator, bool)` +`func (o *SyntheticsAssertion) GetOperatorOk() (*SyntheticsAssertionJSONPathOperator, bool)` GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetOperator -`func (o *SyntheticsAssertion) SetOperator(v SyntheticsAssertionOperator)` +`func (o *SyntheticsAssertion) SetOperator(v SyntheticsAssertionJSONPathOperator)` SetOperator sets Operator field to given value. @@ -75,20 +75,20 @@ HasProperty returns a boolean if a field has been set. ### GetTarget -`func (o *SyntheticsAssertion) GetTarget() interface{}` +`func (o *SyntheticsAssertion) GetTarget() SyntheticsAssertionJSONPathTargetTarget` GetTarget returns the Target field if non-nil, zero value otherwise. ### GetTargetOk -`func (o *SyntheticsAssertion) GetTargetOk() (*interface{}, bool)` +`func (o *SyntheticsAssertion) GetTargetOk() (*SyntheticsAssertionJSONPathTargetTarget, bool)` GetTargetOk returns a tuple with the Target field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTarget -`func (o *SyntheticsAssertion) SetTarget(v interface{})` +`func (o *SyntheticsAssertion) SetTarget(v SyntheticsAssertionJSONPathTargetTarget)` SetTarget sets Target field to given value. diff --git a/api/v1/datadog/docs/SyntheticsAssertionJSONPathOperator.md b/api/v1/datadog/docs/SyntheticsAssertionJSONPathOperator.md new file mode 100644 index 00000000000..832dab8213d --- /dev/null +++ b/api/v1/datadog/docs/SyntheticsAssertionJSONPathOperator.md @@ -0,0 +1,11 @@ +# SyntheticsAssertionJSONPathOperator + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SyntheticsAssertionJSONPathTarget.md b/api/v1/datadog/docs/SyntheticsAssertionJSONPathTarget.md new file mode 100644 index 00000000000..fc64582d97b --- /dev/null +++ b/api/v1/datadog/docs/SyntheticsAssertionJSONPathTarget.md @@ -0,0 +1,124 @@ +# SyntheticsAssertionJSONPathTarget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Operator** | Pointer to [**SyntheticsAssertionJSONPathOperator**](SyntheticsAssertionJSONPathOperator.md) | | +**Property** | Pointer to **string** | The associated assertion property. | [optional] +**Target** | Pointer to [**SyntheticsAssertionJSONPathTargetTarget**](SyntheticsAssertionJSONPathTarget_target.md) | | [optional] +**Type** | Pointer to [**SyntheticsAssertionType**](SyntheticsAssertionType.md) | | + +## Methods + +### NewSyntheticsAssertionJSONPathTarget + +`func NewSyntheticsAssertionJSONPathTarget(operator SyntheticsAssertionJSONPathOperator, type_ SyntheticsAssertionType, ) *SyntheticsAssertionJSONPathTarget` + +NewSyntheticsAssertionJSONPathTarget instantiates a new SyntheticsAssertionJSONPathTarget 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 + +### NewSyntheticsAssertionJSONPathTargetWithDefaults + +`func NewSyntheticsAssertionJSONPathTargetWithDefaults() *SyntheticsAssertionJSONPathTarget` + +NewSyntheticsAssertionJSONPathTargetWithDefaults instantiates a new SyntheticsAssertionJSONPathTarget 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 + +### GetOperator + +`func (o *SyntheticsAssertionJSONPathTarget) GetOperator() SyntheticsAssertionJSONPathOperator` + +GetOperator returns the Operator field if non-nil, zero value otherwise. + +### GetOperatorOk + +`func (o *SyntheticsAssertionJSONPathTarget) GetOperatorOk() (*SyntheticsAssertionJSONPathOperator, bool)` + +GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperator + +`func (o *SyntheticsAssertionJSONPathTarget) SetOperator(v SyntheticsAssertionJSONPathOperator)` + +SetOperator sets Operator field to given value. + + +### GetProperty + +`func (o *SyntheticsAssertionJSONPathTarget) GetProperty() string` + +GetProperty returns the Property field if non-nil, zero value otherwise. + +### GetPropertyOk + +`func (o *SyntheticsAssertionJSONPathTarget) GetPropertyOk() (*string, bool)` + +GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperty + +`func (o *SyntheticsAssertionJSONPathTarget) SetProperty(v string)` + +SetProperty sets Property field to given value. + +### HasProperty + +`func (o *SyntheticsAssertionJSONPathTarget) HasProperty() bool` + +HasProperty returns a boolean if a field has been set. + +### GetTarget + +`func (o *SyntheticsAssertionJSONPathTarget) GetTarget() SyntheticsAssertionJSONPathTargetTarget` + +GetTarget returns the Target field if non-nil, zero value otherwise. + +### GetTargetOk + +`func (o *SyntheticsAssertionJSONPathTarget) GetTargetOk() (*SyntheticsAssertionJSONPathTargetTarget, bool)` + +GetTargetOk returns a tuple with the Target field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTarget + +`func (o *SyntheticsAssertionJSONPathTarget) SetTarget(v SyntheticsAssertionJSONPathTargetTarget)` + +SetTarget sets Target field to given value. + +### HasTarget + +`func (o *SyntheticsAssertionJSONPathTarget) HasTarget() bool` + +HasTarget returns a boolean if a field has been set. + +### GetType + +`func (o *SyntheticsAssertionJSONPathTarget) GetType() SyntheticsAssertionType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SyntheticsAssertionJSONPathTarget) GetTypeOk() (*SyntheticsAssertionType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SyntheticsAssertionJSONPathTarget) SetType(v SyntheticsAssertionType)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SyntheticsAssertionJSONPathTargetTarget.md b/api/v1/datadog/docs/SyntheticsAssertionJSONPathTargetTarget.md new file mode 100644 index 00000000000..7b0dfd8e5c0 --- /dev/null +++ b/api/v1/datadog/docs/SyntheticsAssertionJSONPathTargetTarget.md @@ -0,0 +1,108 @@ +# SyntheticsAssertionJSONPathTargetTarget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JsonPath** | Pointer to **string** | The JSON path to assert. | [optional] +**Operator** | Pointer to **string** | The specific operator to use on the path. | [optional] +**TargetValue** | Pointer to **interface{}** | The path target value to compare to. | [optional] + +## Methods + +### NewSyntheticsAssertionJSONPathTargetTarget + +`func NewSyntheticsAssertionJSONPathTargetTarget() *SyntheticsAssertionJSONPathTargetTarget` + +NewSyntheticsAssertionJSONPathTargetTarget instantiates a new SyntheticsAssertionJSONPathTargetTarget 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 + +### NewSyntheticsAssertionJSONPathTargetTargetWithDefaults + +`func NewSyntheticsAssertionJSONPathTargetTargetWithDefaults() *SyntheticsAssertionJSONPathTargetTarget` + +NewSyntheticsAssertionJSONPathTargetTargetWithDefaults instantiates a new SyntheticsAssertionJSONPathTargetTarget 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 + +### GetJsonPath + +`func (o *SyntheticsAssertionJSONPathTargetTarget) GetJsonPath() string` + +GetJsonPath returns the JsonPath field if non-nil, zero value otherwise. + +### GetJsonPathOk + +`func (o *SyntheticsAssertionJSONPathTargetTarget) GetJsonPathOk() (*string, bool)` + +GetJsonPathOk returns a tuple with the JsonPath field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetJsonPath + +`func (o *SyntheticsAssertionJSONPathTargetTarget) SetJsonPath(v string)` + +SetJsonPath sets JsonPath field to given value. + +### HasJsonPath + +`func (o *SyntheticsAssertionJSONPathTargetTarget) HasJsonPath() bool` + +HasJsonPath returns a boolean if a field has been set. + +### GetOperator + +`func (o *SyntheticsAssertionJSONPathTargetTarget) GetOperator() string` + +GetOperator returns the Operator field if non-nil, zero value otherwise. + +### GetOperatorOk + +`func (o *SyntheticsAssertionJSONPathTargetTarget) GetOperatorOk() (*string, bool)` + +GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperator + +`func (o *SyntheticsAssertionJSONPathTargetTarget) SetOperator(v string)` + +SetOperator sets Operator field to given value. + +### HasOperator + +`func (o *SyntheticsAssertionJSONPathTargetTarget) HasOperator() bool` + +HasOperator returns a boolean if a field has been set. + +### GetTargetValue + +`func (o *SyntheticsAssertionJSONPathTargetTarget) GetTargetValue() interface{}` + +GetTargetValue returns the TargetValue field if non-nil, zero value otherwise. + +### GetTargetValueOk + +`func (o *SyntheticsAssertionJSONPathTargetTarget) GetTargetValueOk() (*interface{}, bool)` + +GetTargetValueOk returns a tuple with the TargetValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTargetValue + +`func (o *SyntheticsAssertionJSONPathTargetTarget) SetTargetValue(v interface{})` + +SetTargetValue sets TargetValue field to given value. + +### HasTargetValue + +`func (o *SyntheticsAssertionJSONPathTargetTarget) HasTargetValue() bool` + +HasTargetValue returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/SyntheticsAssertionTarget.md b/api/v1/datadog/docs/SyntheticsAssertionTarget.md new file mode 100644 index 00000000000..88202fdaae4 --- /dev/null +++ b/api/v1/datadog/docs/SyntheticsAssertionTarget.md @@ -0,0 +1,124 @@ +# SyntheticsAssertionTarget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Operator** | Pointer to [**SyntheticsAssertionOperator**](SyntheticsAssertionOperator.md) | | +**Property** | Pointer to **string** | The associated assertion property. | [optional] +**Target** | Pointer to **interface{}** | Value used by the operator. | [optional] +**Type** | Pointer to [**SyntheticsAssertionType**](SyntheticsAssertionType.md) | | + +## Methods + +### NewSyntheticsAssertionTarget + +`func NewSyntheticsAssertionTarget(operator SyntheticsAssertionOperator, type_ SyntheticsAssertionType, ) *SyntheticsAssertionTarget` + +NewSyntheticsAssertionTarget instantiates a new SyntheticsAssertionTarget 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 + +### NewSyntheticsAssertionTargetWithDefaults + +`func NewSyntheticsAssertionTargetWithDefaults() *SyntheticsAssertionTarget` + +NewSyntheticsAssertionTargetWithDefaults instantiates a new SyntheticsAssertionTarget 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 + +### GetOperator + +`func (o *SyntheticsAssertionTarget) GetOperator() SyntheticsAssertionOperator` + +GetOperator returns the Operator field if non-nil, zero value otherwise. + +### GetOperatorOk + +`func (o *SyntheticsAssertionTarget) GetOperatorOk() (*SyntheticsAssertionOperator, bool)` + +GetOperatorOk returns a tuple with the Operator field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOperator + +`func (o *SyntheticsAssertionTarget) SetOperator(v SyntheticsAssertionOperator)` + +SetOperator sets Operator field to given value. + + +### GetProperty + +`func (o *SyntheticsAssertionTarget) GetProperty() string` + +GetProperty returns the Property field if non-nil, zero value otherwise. + +### GetPropertyOk + +`func (o *SyntheticsAssertionTarget) GetPropertyOk() (*string, bool)` + +GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetProperty + +`func (o *SyntheticsAssertionTarget) SetProperty(v string)` + +SetProperty sets Property field to given value. + +### HasProperty + +`func (o *SyntheticsAssertionTarget) HasProperty() bool` + +HasProperty returns a boolean if a field has been set. + +### GetTarget + +`func (o *SyntheticsAssertionTarget) GetTarget() interface{}` + +GetTarget returns the Target field if non-nil, zero value otherwise. + +### GetTargetOk + +`func (o *SyntheticsAssertionTarget) GetTargetOk() (*interface{}, bool)` + +GetTargetOk returns a tuple with the Target field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTarget + +`func (o *SyntheticsAssertionTarget) SetTarget(v interface{})` + +SetTarget sets Target field to given value. + +### HasTarget + +`func (o *SyntheticsAssertionTarget) HasTarget() bool` + +HasTarget returns a boolean if a field has been set. + +### GetType + +`func (o *SyntheticsAssertionTarget) GetType() SyntheticsAssertionType` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *SyntheticsAssertionTarget) GetTypeOk() (*SyntheticsAssertionType, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *SyntheticsAssertionTarget) SetType(v SyntheticsAssertionType)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/model_synthetics_assertion.go b/api/v1/datadog/model_synthetics_assertion.go index 62c83af7e0a..4a334e0c579 100644 --- a/api/v1/datadog/model_synthetics_assertion.go +++ b/api/v1/datadog/model_synthetics_assertion.go @@ -10,164 +10,93 @@ package datadog import ( "encoding/json" + "fmt" ) -// SyntheticsAssertion Object describing the assertions type, their associated operator, which property they apply , and upon which target. +// SyntheticsAssertion - Object describing the assertions type, their associated operator, which property they apply, and upon which target. type SyntheticsAssertion struct { - Operator SyntheticsAssertionOperator `json:"operator"` - // The associated assertion property. - Property *string `json:"property,omitempty"` - // Target to apply the assertion to. It can be a string, a number, or a Date. - Target *interface{} `json:"target,omitempty"` - Type SyntheticsAssertionType `json:"type"` -} - -// NewSyntheticsAssertion instantiates a new SyntheticsAssertion 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 NewSyntheticsAssertion(operator SyntheticsAssertionOperator, type_ SyntheticsAssertionType) *SyntheticsAssertion { - this := SyntheticsAssertion{} - this.Operator = operator - this.Type = type_ - return &this -} - -// NewSyntheticsAssertionWithDefaults instantiates a new SyntheticsAssertion 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 NewSyntheticsAssertionWithDefaults() *SyntheticsAssertion { - this := SyntheticsAssertion{} - return &this -} - -// GetOperator returns the Operator field value -func (o *SyntheticsAssertion) GetOperator() SyntheticsAssertionOperator { - if o == nil { - var ret SyntheticsAssertionOperator - return ret - } - - return o.Operator -} - -// GetOperatorOk returns a tuple with the Operator field value -// and a boolean to check if the value has been set. -func (o *SyntheticsAssertion) GetOperatorOk() (*SyntheticsAssertionOperator, bool) { - if o == nil { - return nil, false - } - return &o.Operator, true -} - -// SetOperator sets field value -func (o *SyntheticsAssertion) SetOperator(v SyntheticsAssertionOperator) { - o.Operator = v -} - -// GetProperty returns the Property field value if set, zero value otherwise. -func (o *SyntheticsAssertion) GetProperty() string { - if o == nil || o.Property == nil { - var ret string - return ret - } - return *o.Property -} - -// GetPropertyOk returns a tuple with the Property field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SyntheticsAssertion) GetPropertyOk() (*string, bool) { - if o == nil || o.Property == nil { - return nil, false + SyntheticsAssertionJSONPathTarget *SyntheticsAssertionJSONPathTarget + SyntheticsAssertionTarget *SyntheticsAssertionTarget +} + +// SyntheticsAssertionJSONPathTargetAsSyntheticsAssertion is a convenience function that returns SyntheticsAssertionJSONPathTarget wrapped in SyntheticsAssertion +func SyntheticsAssertionJSONPathTargetAsSyntheticsAssertion(v *SyntheticsAssertionJSONPathTarget) SyntheticsAssertion { + return SyntheticsAssertion{SyntheticsAssertionJSONPathTarget: v} +} + +// SyntheticsAssertionTargetAsSyntheticsAssertion is a convenience function that returns SyntheticsAssertionTarget wrapped in SyntheticsAssertion +func SyntheticsAssertionTargetAsSyntheticsAssertion(v *SyntheticsAssertionTarget) SyntheticsAssertion { + return SyntheticsAssertion{SyntheticsAssertionTarget: v} +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *SyntheticsAssertion) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into SyntheticsAssertionJSONPathTarget + err = json.Unmarshal(data, &dst.SyntheticsAssertionJSONPathTarget) + if err == nil { + jsonSyntheticsAssertionJSONPathTarget, _ := json.Marshal(dst.SyntheticsAssertionJSONPathTarget) + if string(jsonSyntheticsAssertionJSONPathTarget) == "{}" { // empty struct + dst.SyntheticsAssertionJSONPathTarget = nil + } else { + match++ + } + } else { + dst.SyntheticsAssertionJSONPathTarget = nil } - return o.Property, true -} -// HasProperty returns a boolean if a field has been set. -func (o *SyntheticsAssertion) HasProperty() bool { - if o != nil && o.Property != nil { - return true + // try to unmarshal data into SyntheticsAssertionTarget + err = json.Unmarshal(data, &dst.SyntheticsAssertionTarget) + if err == nil { + jsonSyntheticsAssertionTarget, _ := json.Marshal(dst.SyntheticsAssertionTarget) + if string(jsonSyntheticsAssertionTarget) == "{}" { // empty struct + dst.SyntheticsAssertionTarget = nil + } else { + match++ + } + } else { + dst.SyntheticsAssertionTarget = nil } - return false -} - -// SetProperty gets a reference to the given string and assigns it to the Property field. -func (o *SyntheticsAssertion) SetProperty(v string) { - o.Property = &v -} + if match > 1 { // more than 1 match + // reset to nil + dst.SyntheticsAssertionJSONPathTarget = nil + dst.SyntheticsAssertionTarget = nil -// GetTarget returns the Target field value if set, zero value otherwise. -func (o *SyntheticsAssertion) GetTarget() interface{} { - if o == nil || o.Target == nil { - var ret interface{} - return ret + return fmt.Errorf("Data matches more than one schema in oneOf(SyntheticsAssertion)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("Data failed to match schemas in oneOf(SyntheticsAssertion)") } - return *o.Target } -// GetTargetOk returns a tuple with the Target field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SyntheticsAssertion) GetTargetOk() (*interface{}, bool) { - if o == nil || o.Target == nil { - return nil, false +// Marshal data from the first non-nil pointers in the struct to JSON +func (src SyntheticsAssertion) MarshalJSON() ([]byte, error) { + if src.SyntheticsAssertionJSONPathTarget != nil { + return json.Marshal(&src.SyntheticsAssertionJSONPathTarget) } - return o.Target, true -} -// HasTarget returns a boolean if a field has been set. -func (o *SyntheticsAssertion) HasTarget() bool { - if o != nil && o.Target != nil { - return true + if src.SyntheticsAssertionTarget != nil { + return json.Marshal(&src.SyntheticsAssertionTarget) } - return false -} - -// SetTarget gets a reference to the given interface{} and assigns it to the Target field. -func (o *SyntheticsAssertion) SetTarget(v interface{}) { - o.Target = &v + return nil, nil // no data in oneOf schemas } -// GetType returns the Type field value -func (o *SyntheticsAssertion) GetType() SyntheticsAssertionType { - if o == nil { - var ret SyntheticsAssertionType - return ret +// Get the actual instance +func (obj *SyntheticsAssertion) GetActualInstance() interface{} { + if obj.SyntheticsAssertionJSONPathTarget != nil { + return obj.SyntheticsAssertionJSONPathTarget } - 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 *SyntheticsAssertion) GetTypeOk() (*SyntheticsAssertionType, bool) { - if o == nil { - return nil, false + if obj.SyntheticsAssertionTarget != nil { + return obj.SyntheticsAssertionTarget } - return &o.Type, true -} - -// SetType sets field value -func (o *SyntheticsAssertion) SetType(v SyntheticsAssertionType) { - o.Type = v -} -func (o SyntheticsAssertion) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["operator"] = o.Operator - } - if o.Property != nil { - toSerialize["property"] = o.Property - } - if o.Target != nil { - toSerialize["target"] = o.Target - } - if true { - toSerialize["type"] = o.Type - } - return json.Marshal(toSerialize) + // all schemas are nil + return nil } type NullableSyntheticsAssertion struct { diff --git a/api/v1/datadog/model_synthetics_assertion_json_path_operator.go b/api/v1/datadog/model_synthetics_assertion_json_path_operator.go new file mode 100644 index 00000000000..3e6c7c428f6 --- /dev/null +++ b/api/v1/datadog/model_synthetics_assertion_json_path_operator.go @@ -0,0 +1,80 @@ +/* + * 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" + "fmt" +) + +// SyntheticsAssertionJSONPathOperator Assertion operator to apply. +type SyntheticsAssertionJSONPathOperator string + +// List of SyntheticsAssertionJSONPathOperator +const ( + SYNTHETICSASSERTIONJSONPATHOPERATOR_VALIDATES_JSON_PATH SyntheticsAssertionJSONPathOperator = "validatesJSONPath" +) + +func (v *SyntheticsAssertionJSONPathOperator) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := SyntheticsAssertionJSONPathOperator(value) + for _, existing := range []SyntheticsAssertionJSONPathOperator{"validatesJSONPath"} { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid SyntheticsAssertionJSONPathOperator", *v) +} + +// Ptr returns reference to SyntheticsAssertionJSONPathOperator value +func (v SyntheticsAssertionJSONPathOperator) Ptr() *SyntheticsAssertionJSONPathOperator { + return &v +} + +type NullableSyntheticsAssertionJSONPathOperator struct { + value *SyntheticsAssertionJSONPathOperator + isSet bool +} + +func (v NullableSyntheticsAssertionJSONPathOperator) Get() *SyntheticsAssertionJSONPathOperator { + return v.value +} + +func (v *NullableSyntheticsAssertionJSONPathOperator) Set(val *SyntheticsAssertionJSONPathOperator) { + v.value = val + v.isSet = true +} + +func (v NullableSyntheticsAssertionJSONPathOperator) IsSet() bool { + return v.isSet +} + +func (v *NullableSyntheticsAssertionJSONPathOperator) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyntheticsAssertionJSONPathOperator(val *SyntheticsAssertionJSONPathOperator) *NullableSyntheticsAssertionJSONPathOperator { + return &NullableSyntheticsAssertionJSONPathOperator{value: val, isSet: true} +} + +func (v NullableSyntheticsAssertionJSONPathOperator) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyntheticsAssertionJSONPathOperator) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_synthetics_assertion_json_path_target.go b/api/v1/datadog/model_synthetics_assertion_json_path_target.go new file mode 100644 index 00000000000..9f4c1725649 --- /dev/null +++ b/api/v1/datadog/model_synthetics_assertion_json_path_target.go @@ -0,0 +1,206 @@ +/* + * 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" +) + +// SyntheticsAssertionJSONPathTarget An assertion for the `validatesJSONPath` operator. +type SyntheticsAssertionJSONPathTarget struct { + Operator SyntheticsAssertionJSONPathOperator `json:"operator"` + // The associated assertion property. + Property *string `json:"property,omitempty"` + Target *SyntheticsAssertionJSONPathTargetTarget `json:"target,omitempty"` + Type SyntheticsAssertionType `json:"type"` +} + +// NewSyntheticsAssertionJSONPathTarget instantiates a new SyntheticsAssertionJSONPathTarget 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 NewSyntheticsAssertionJSONPathTarget(operator SyntheticsAssertionJSONPathOperator, type_ SyntheticsAssertionType) *SyntheticsAssertionJSONPathTarget { + this := SyntheticsAssertionJSONPathTarget{} + this.Operator = operator + this.Type = type_ + return &this +} + +// NewSyntheticsAssertionJSONPathTargetWithDefaults instantiates a new SyntheticsAssertionJSONPathTarget 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 NewSyntheticsAssertionJSONPathTargetWithDefaults() *SyntheticsAssertionJSONPathTarget { + this := SyntheticsAssertionJSONPathTarget{} + return &this +} + +// GetOperator returns the Operator field value +func (o *SyntheticsAssertionJSONPathTarget) GetOperator() SyntheticsAssertionJSONPathOperator { + if o == nil { + var ret SyntheticsAssertionJSONPathOperator + return ret + } + + return o.Operator +} + +// GetOperatorOk returns a tuple with the Operator field value +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionJSONPathTarget) GetOperatorOk() (*SyntheticsAssertionJSONPathOperator, bool) { + if o == nil { + return nil, false + } + return &o.Operator, true +} + +// SetOperator sets field value +func (o *SyntheticsAssertionJSONPathTarget) SetOperator(v SyntheticsAssertionJSONPathOperator) { + o.Operator = v +} + +// GetProperty returns the Property field value if set, zero value otherwise. +func (o *SyntheticsAssertionJSONPathTarget) GetProperty() string { + if o == nil || o.Property == nil { + var ret string + return ret + } + return *o.Property +} + +// GetPropertyOk returns a tuple with the Property field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionJSONPathTarget) GetPropertyOk() (*string, bool) { + if o == nil || o.Property == nil { + return nil, false + } + return o.Property, true +} + +// HasProperty returns a boolean if a field has been set. +func (o *SyntheticsAssertionJSONPathTarget) HasProperty() bool { + if o != nil && o.Property != nil { + return true + } + + return false +} + +// SetProperty gets a reference to the given string and assigns it to the Property field. +func (o *SyntheticsAssertionJSONPathTarget) SetProperty(v string) { + o.Property = &v +} + +// GetTarget returns the Target field value if set, zero value otherwise. +func (o *SyntheticsAssertionJSONPathTarget) GetTarget() SyntheticsAssertionJSONPathTargetTarget { + if o == nil || o.Target == nil { + var ret SyntheticsAssertionJSONPathTargetTarget + return ret + } + return *o.Target +} + +// GetTargetOk returns a tuple with the Target field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionJSONPathTarget) GetTargetOk() (*SyntheticsAssertionJSONPathTargetTarget, bool) { + if o == nil || o.Target == nil { + return nil, false + } + return o.Target, true +} + +// HasTarget returns a boolean if a field has been set. +func (o *SyntheticsAssertionJSONPathTarget) HasTarget() bool { + if o != nil && o.Target != nil { + return true + } + + return false +} + +// SetTarget gets a reference to the given SyntheticsAssertionJSONPathTargetTarget and assigns it to the Target field. +func (o *SyntheticsAssertionJSONPathTarget) SetTarget(v SyntheticsAssertionJSONPathTargetTarget) { + o.Target = &v +} + +// GetType returns the Type field value +func (o *SyntheticsAssertionJSONPathTarget) GetType() SyntheticsAssertionType { + if o == nil { + var ret SyntheticsAssertionType + 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 *SyntheticsAssertionJSONPathTarget) GetTypeOk() (*SyntheticsAssertionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SyntheticsAssertionJSONPathTarget) SetType(v SyntheticsAssertionType) { + o.Type = v +} + +func (o SyntheticsAssertionJSONPathTarget) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["operator"] = o.Operator + } + if o.Property != nil { + toSerialize["property"] = o.Property + } + if o.Target != nil { + toSerialize["target"] = o.Target + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableSyntheticsAssertionJSONPathTarget struct { + value *SyntheticsAssertionJSONPathTarget + isSet bool +} + +func (v NullableSyntheticsAssertionJSONPathTarget) Get() *SyntheticsAssertionJSONPathTarget { + return v.value +} + +func (v *NullableSyntheticsAssertionJSONPathTarget) Set(val *SyntheticsAssertionJSONPathTarget) { + v.value = val + v.isSet = true +} + +func (v NullableSyntheticsAssertionJSONPathTarget) IsSet() bool { + return v.isSet +} + +func (v *NullableSyntheticsAssertionJSONPathTarget) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyntheticsAssertionJSONPathTarget(val *SyntheticsAssertionJSONPathTarget) *NullableSyntheticsAssertionJSONPathTarget { + return &NullableSyntheticsAssertionJSONPathTarget{value: val, isSet: true} +} + +func (v NullableSyntheticsAssertionJSONPathTarget) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyntheticsAssertionJSONPathTarget) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_synthetics_assertion_json_path_target_target.go b/api/v1/datadog/model_synthetics_assertion_json_path_target_target.go new file mode 100644 index 00000000000..6d45019958c --- /dev/null +++ b/api/v1/datadog/model_synthetics_assertion_json_path_target_target.go @@ -0,0 +1,186 @@ +/* + * 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" +) + +// SyntheticsAssertionJSONPathTargetTarget Composed target for `validatesJSONPath` operator. +type SyntheticsAssertionJSONPathTargetTarget struct { + // The JSON path to assert. + JsonPath *string `json:"jsonPath,omitempty"` + // The specific operator to use on the path. + Operator *string `json:"operator,omitempty"` + // The path target value to compare to. + TargetValue *interface{} `json:"targetValue,omitempty"` +} + +// NewSyntheticsAssertionJSONPathTargetTarget instantiates a new SyntheticsAssertionJSONPathTargetTarget 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 NewSyntheticsAssertionJSONPathTargetTarget() *SyntheticsAssertionJSONPathTargetTarget { + this := SyntheticsAssertionJSONPathTargetTarget{} + return &this +} + +// NewSyntheticsAssertionJSONPathTargetTargetWithDefaults instantiates a new SyntheticsAssertionJSONPathTargetTarget 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 NewSyntheticsAssertionJSONPathTargetTargetWithDefaults() *SyntheticsAssertionJSONPathTargetTarget { + this := SyntheticsAssertionJSONPathTargetTarget{} + return &this +} + +// GetJsonPath returns the JsonPath field value if set, zero value otherwise. +func (o *SyntheticsAssertionJSONPathTargetTarget) GetJsonPath() string { + if o == nil || o.JsonPath == nil { + var ret string + return ret + } + return *o.JsonPath +} + +// GetJsonPathOk returns a tuple with the JsonPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionJSONPathTargetTarget) GetJsonPathOk() (*string, bool) { + if o == nil || o.JsonPath == nil { + return nil, false + } + return o.JsonPath, true +} + +// HasJsonPath returns a boolean if a field has been set. +func (o *SyntheticsAssertionJSONPathTargetTarget) HasJsonPath() bool { + if o != nil && o.JsonPath != nil { + return true + } + + return false +} + +// SetJsonPath gets a reference to the given string and assigns it to the JsonPath field. +func (o *SyntheticsAssertionJSONPathTargetTarget) SetJsonPath(v string) { + o.JsonPath = &v +} + +// GetOperator returns the Operator field value if set, zero value otherwise. +func (o *SyntheticsAssertionJSONPathTargetTarget) GetOperator() string { + if o == nil || o.Operator == nil { + var ret string + return ret + } + return *o.Operator +} + +// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionJSONPathTargetTarget) GetOperatorOk() (*string, bool) { + if o == nil || o.Operator == nil { + return nil, false + } + return o.Operator, true +} + +// HasOperator returns a boolean if a field has been set. +func (o *SyntheticsAssertionJSONPathTargetTarget) HasOperator() bool { + if o != nil && o.Operator != nil { + return true + } + + return false +} + +// SetOperator gets a reference to the given string and assigns it to the Operator field. +func (o *SyntheticsAssertionJSONPathTargetTarget) SetOperator(v string) { + o.Operator = &v +} + +// GetTargetValue returns the TargetValue field value if set, zero value otherwise. +func (o *SyntheticsAssertionJSONPathTargetTarget) GetTargetValue() interface{} { + if o == nil || o.TargetValue == nil { + var ret interface{} + return ret + } + return *o.TargetValue +} + +// GetTargetValueOk returns a tuple with the TargetValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionJSONPathTargetTarget) GetTargetValueOk() (*interface{}, bool) { + if o == nil || o.TargetValue == nil { + return nil, false + } + return o.TargetValue, true +} + +// HasTargetValue returns a boolean if a field has been set. +func (o *SyntheticsAssertionJSONPathTargetTarget) HasTargetValue() bool { + if o != nil && o.TargetValue != nil { + return true + } + + return false +} + +// SetTargetValue gets a reference to the given interface{} and assigns it to the TargetValue field. +func (o *SyntheticsAssertionJSONPathTargetTarget) SetTargetValue(v interface{}) { + o.TargetValue = &v +} + +func (o SyntheticsAssertionJSONPathTargetTarget) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JsonPath != nil { + toSerialize["jsonPath"] = o.JsonPath + } + if o.Operator != nil { + toSerialize["operator"] = o.Operator + } + if o.TargetValue != nil { + toSerialize["targetValue"] = o.TargetValue + } + return json.Marshal(toSerialize) +} + +type NullableSyntheticsAssertionJSONPathTargetTarget struct { + value *SyntheticsAssertionJSONPathTargetTarget + isSet bool +} + +func (v NullableSyntheticsAssertionJSONPathTargetTarget) Get() *SyntheticsAssertionJSONPathTargetTarget { + return v.value +} + +func (v *NullableSyntheticsAssertionJSONPathTargetTarget) Set(val *SyntheticsAssertionJSONPathTargetTarget) { + v.value = val + v.isSet = true +} + +func (v NullableSyntheticsAssertionJSONPathTargetTarget) IsSet() bool { + return v.isSet +} + +func (v *NullableSyntheticsAssertionJSONPathTargetTarget) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyntheticsAssertionJSONPathTargetTarget(val *SyntheticsAssertionJSONPathTargetTarget) *NullableSyntheticsAssertionJSONPathTargetTarget { + return &NullableSyntheticsAssertionJSONPathTargetTarget{value: val, isSet: true} +} + +func (v NullableSyntheticsAssertionJSONPathTargetTarget) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyntheticsAssertionJSONPathTargetTarget) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_synthetics_assertion_operator.go b/api/v1/datadog/model_synthetics_assertion_operator.go index 1dc9c79c060..8c13bdba1b8 100644 --- a/api/v1/datadog/model_synthetics_assertion_operator.go +++ b/api/v1/datadog/model_synthetics_assertion_operator.go @@ -23,10 +23,12 @@ const ( SYNTHETICSASSERTIONOPERATOR_IS SyntheticsAssertionOperator = "is" SYNTHETICSASSERTIONOPERATOR_IS_NOT SyntheticsAssertionOperator = "isNot" SYNTHETICSASSERTIONOPERATOR_LESS_THAN SyntheticsAssertionOperator = "lessThan" + SYNTHETICSASSERTIONOPERATOR_MORE_THAN SyntheticsAssertionOperator = "moreThan" SYNTHETICSASSERTIONOPERATOR_MATCHES SyntheticsAssertionOperator = "matches" SYNTHETICSASSERTIONOPERATOR_DOES_NOT_MATCH SyntheticsAssertionOperator = "doesNotMatch" SYNTHETICSASSERTIONOPERATOR_VALIDATES SyntheticsAssertionOperator = "validates" SYNTHETICSASSERTIONOPERATOR_IS_IN_MORE_DAYS_THAN SyntheticsAssertionOperator = "isInMoreThan" + SYNTHETICSASSERTIONOPERATOR_IS_IN_LESS_DAYS_THAN SyntheticsAssertionOperator = "isInLessThan" ) func (v *SyntheticsAssertionOperator) UnmarshalJSON(src []byte) error { @@ -36,7 +38,7 @@ func (v *SyntheticsAssertionOperator) UnmarshalJSON(src []byte) error { return err } enumTypeValue := SyntheticsAssertionOperator(value) - for _, existing := range []SyntheticsAssertionOperator{"contains", "doesNotContain", "is", "isNot", "lessThan", "matches", "doesNotMatch", "validates", "isInMoreThan"} { + for _, existing := range []SyntheticsAssertionOperator{"contains", "doesNotContain", "is", "isNot", "lessThan", "moreThan", "matches", "doesNotMatch", "validates", "isInMoreThan", "isInLessThan"} { if existing == enumTypeValue { *v = enumTypeValue return nil diff --git a/api/v1/datadog/model_synthetics_assertion_target.go b/api/v1/datadog/model_synthetics_assertion_target.go new file mode 100644 index 00000000000..1b47c3fee82 --- /dev/null +++ b/api/v1/datadog/model_synthetics_assertion_target.go @@ -0,0 +1,207 @@ +/* + * 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" +) + +// SyntheticsAssertionTarget An assertion which uses a simple target. +type SyntheticsAssertionTarget struct { + Operator SyntheticsAssertionOperator `json:"operator"` + // The associated assertion property. + Property *string `json:"property,omitempty"` + // Value used by the operator. + Target *interface{} `json:"target,omitempty"` + Type SyntheticsAssertionType `json:"type"` +} + +// NewSyntheticsAssertionTarget instantiates a new SyntheticsAssertionTarget 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 NewSyntheticsAssertionTarget(operator SyntheticsAssertionOperator, type_ SyntheticsAssertionType) *SyntheticsAssertionTarget { + this := SyntheticsAssertionTarget{} + this.Operator = operator + this.Type = type_ + return &this +} + +// NewSyntheticsAssertionTargetWithDefaults instantiates a new SyntheticsAssertionTarget 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 NewSyntheticsAssertionTargetWithDefaults() *SyntheticsAssertionTarget { + this := SyntheticsAssertionTarget{} + return &this +} + +// GetOperator returns the Operator field value +func (o *SyntheticsAssertionTarget) GetOperator() SyntheticsAssertionOperator { + if o == nil { + var ret SyntheticsAssertionOperator + return ret + } + + return o.Operator +} + +// GetOperatorOk returns a tuple with the Operator field value +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionTarget) GetOperatorOk() (*SyntheticsAssertionOperator, bool) { + if o == nil { + return nil, false + } + return &o.Operator, true +} + +// SetOperator sets field value +func (o *SyntheticsAssertionTarget) SetOperator(v SyntheticsAssertionOperator) { + o.Operator = v +} + +// GetProperty returns the Property field value if set, zero value otherwise. +func (o *SyntheticsAssertionTarget) GetProperty() string { + if o == nil || o.Property == nil { + var ret string + return ret + } + return *o.Property +} + +// GetPropertyOk returns a tuple with the Property field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionTarget) GetPropertyOk() (*string, bool) { + if o == nil || o.Property == nil { + return nil, false + } + return o.Property, true +} + +// HasProperty returns a boolean if a field has been set. +func (o *SyntheticsAssertionTarget) HasProperty() bool { + if o != nil && o.Property != nil { + return true + } + + return false +} + +// SetProperty gets a reference to the given string and assigns it to the Property field. +func (o *SyntheticsAssertionTarget) SetProperty(v string) { + o.Property = &v +} + +// GetTarget returns the Target field value if set, zero value otherwise. +func (o *SyntheticsAssertionTarget) GetTarget() interface{} { + if o == nil || o.Target == nil { + var ret interface{} + return ret + } + return *o.Target +} + +// GetTargetOk returns a tuple with the Target field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsAssertionTarget) GetTargetOk() (*interface{}, bool) { + if o == nil || o.Target == nil { + return nil, false + } + return o.Target, true +} + +// HasTarget returns a boolean if a field has been set. +func (o *SyntheticsAssertionTarget) HasTarget() bool { + if o != nil && o.Target != nil { + return true + } + + return false +} + +// SetTarget gets a reference to the given interface{} and assigns it to the Target field. +func (o *SyntheticsAssertionTarget) SetTarget(v interface{}) { + o.Target = &v +} + +// GetType returns the Type field value +func (o *SyntheticsAssertionTarget) GetType() SyntheticsAssertionType { + if o == nil { + var ret SyntheticsAssertionType + 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 *SyntheticsAssertionTarget) GetTypeOk() (*SyntheticsAssertionType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *SyntheticsAssertionTarget) SetType(v SyntheticsAssertionType) { + o.Type = v +} + +func (o SyntheticsAssertionTarget) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["operator"] = o.Operator + } + if o.Property != nil { + toSerialize["property"] = o.Property + } + if o.Target != nil { + toSerialize["target"] = o.Target + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableSyntheticsAssertionTarget struct { + value *SyntheticsAssertionTarget + isSet bool +} + +func (v NullableSyntheticsAssertionTarget) Get() *SyntheticsAssertionTarget { + return v.value +} + +func (v *NullableSyntheticsAssertionTarget) Set(val *SyntheticsAssertionTarget) { + v.value = val + v.isSet = true +} + +func (v NullableSyntheticsAssertionTarget) IsSet() bool { + return v.isSet +} + +func (v *NullableSyntheticsAssertionTarget) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSyntheticsAssertionTarget(val *SyntheticsAssertionTarget) *NullableSyntheticsAssertionTarget { + return &NullableSyntheticsAssertionTarget{value: val, isSet: true} +} + +func (v NullableSyntheticsAssertionTarget) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSyntheticsAssertionTarget) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/tests/api/v1/datadog/api_synthetics_test.go b/tests/api/v1/datadog/api_synthetics_test.go index 0d2c96fe126..7138e4e6099 100644 --- a/tests/api/v1/datadog/api_synthetics_test.go +++ b/tests/api/v1/datadog/api_synthetics_test.go @@ -24,22 +24,31 @@ import ( var targetTextHTML interface{} = "text/html" var target2000 interface{} = 2000 +var targetValue0 interface{} = "0" func getTestSyntheticsAPI(ctx context.Context, t *testing.T) datadog.SyntheticsTestDetails { + assertionTextHTML := datadog.NewSyntheticsAssertionTarget(datadog.SYNTHETICSASSERTIONOPERATOR_IS, datadog.SYNTHETICSASSERTIONTYPE_HEADER) + assertionTextHTML.Property = datadog.PtrString("content-type") + assertionTextHTML.Target = &targetTextHTML + + assertion2000 := datadog.NewSyntheticsAssertionTarget(datadog.SYNTHETICSASSERTIONOPERATOR_LESS_THAN, datadog.SYNTHETICSASSERTIONTYPE_RESPONSE_TIME) + assertion2000.Target = &target2000 + + targetJSONPath := datadog.NewSyntheticsAssertionJSONPathTarget(datadog.SYNTHETICSASSERTIONJSONPATHOPERATOR_VALIDATES_JSON_PATH, datadog.SYNTHETICSASSERTIONTYPE_BODY) + targetJSONPath.SetTarget( + datadog.SyntheticsAssertionJSONPathTargetTarget{ + JsonPath: datadog.PtrString("topKey"), + Operator: datadog.PtrString("isNot"), + TargetValue: &targetValue0, + }, + ) + return datadog.SyntheticsTestDetails{ Config: &datadog.SyntheticsTestConfig{ Assertions: []datadog.SyntheticsAssertion{ - { - Operator: datadog.SYNTHETICSASSERTIONOPERATOR_IS, - Property: datadog.PtrString("content-type"), - Target: &targetTextHTML, - Type: datadog.SYNTHETICSASSERTIONTYPE_HEADER, - }, - { - Operator: datadog.SYNTHETICSASSERTIONOPERATOR_LESS_THAN, - Target: &target2000, - Type: datadog.SYNTHETICSASSERTIONTYPE_RESPONSE_TIME, - }, + datadog.SyntheticsAssertionTargetAsSyntheticsAssertion(assertionTextHTML), + datadog.SyntheticsAssertionTargetAsSyntheticsAssertion(assertion2000), + datadog.SyntheticsAssertionJSONPathTargetAsSyntheticsAssertion(targetJSONPath), }, Request: datadog.SyntheticsTestRequest{ Headers: &map[string]string{"testingGoClient": "true"}, @@ -136,6 +145,34 @@ func TestSyntheticsAPITestLifecycle(t *testing.T) { assert.Equal(200, httpresp.StatusCode) assert.Equal(updatedName, synt.GetName()) + config := synt.GetConfig() + + assert.Equal(3, len(config.GetAssertions())) + + for _, assertion := range config.GetAssertions() { + if assertion.SyntheticsAssertionJSONPathTarget != nil { + assert.Equal(datadog.SYNTHETICSASSERTIONTYPE_BODY, assertion.SyntheticsAssertionJSONPathTarget.Type) + assert.Equal(datadog.SYNTHETICSASSERTIONJSONPATHOPERATOR_VALIDATES_JSON_PATH, assertion.SyntheticsAssertionJSONPathTarget.Operator) + target := assertion.SyntheticsAssertionJSONPathTarget.GetTarget() + assert.Equal("0", target.GetTargetValue().(string)) + assert.Equal("isNot", target.GetOperator()) + assert.Equal("topKey", target.GetJsonPath()) + } else if assertion.SyntheticsAssertionTarget != nil { + if assertion.SyntheticsAssertionTarget.Type == datadog.SYNTHETICSASSERTIONTYPE_HEADER { + assert.Equal(datadog.SYNTHETICSASSERTIONOPERATOR_IS, assertion.SyntheticsAssertionTarget.Operator) + assert.Equal("content-type", assertion.SyntheticsAssertionTarget.GetProperty()) + assert.Equal("text/html", assertion.SyntheticsAssertionTarget.GetTarget().(string)) + } else if assertion.SyntheticsAssertionTarget.Type == datadog.SYNTHETICSASSERTIONTYPE_RESPONSE_TIME { + assert.Equal(datadog.SYNTHETICSASSERTIONOPERATOR_LESS_THAN, assertion.SyntheticsAssertionTarget.Operator) + assert.Equal(float64(2000), assertion.SyntheticsAssertionTarget.GetTarget().(float64)) + } else { + assert.Fail("Unexpected type") + } + } else { + assert.Fail("Unexpected target") + } + } + // NOTE: API tests are started by default, so we have to stop it first // Stop API test var pauseStatus bool diff --git a/tests/api/v1/datadog/cassettes/TestSyntheticsAPITestLifecycle.freeze b/tests/api/v1/datadog/cassettes/TestSyntheticsAPITestLifecycle.freeze index 4e936b0244a..10d5452953b 100644 --- a/tests/api/v1/datadog/cassettes/TestSyntheticsAPITestLifecycle.freeze +++ b/tests/api/v1/datadog/cassettes/TestSyntheticsAPITestLifecycle.freeze @@ -1 +1 @@ -2020-05-12T15:33:27.177319+02:00 \ No newline at end of file +2020-06-29T09:53:52.549447+02:00 \ No newline at end of file diff --git a/tests/api/v1/datadog/cassettes/TestSyntheticsAPITestLifecycle.yaml b/tests/api/v1/datadog/cassettes/TestSyntheticsAPITestLifecycle.yaml index 9e7a274bc4c..d4b0b17cd93 100644 --- a/tests/api/v1/datadog/cassettes/TestSyntheticsAPITestLifecycle.yaml +++ b/tests/api/v1/datadog/cassettes/TestSyntheticsAPITestLifecycle.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"config":{"assertions":[{"operator":"is","property":"content-type","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"}],"request":{"headers":{"testingGoClient":"true"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"Go client testing Synthetics API test - this is message","name":"go-TestSyntheticsAPITestLifecycle-local-1589290407","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":10,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"} + {"config":{"assertions":[{"operator":"is","property":"content-type","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"request":{"headers":{"testingGoClient":"true"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"Go client testing Synthetics API test - this is message","name":"go-TestSyntheticsAPITestLifecycle-local-1593417232","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":10,"retry":{"count":3,"interval":10},"tick_every":60},"subtype":"http","tags":["testing:api"],"type":"api"} form: {} headers: Accept: @@ -13,35 +13,33 @@ interactions: Dd-Operation-Id: - CreateTest User-Agent: - - datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "9154522957646948539" + - "4405411112000139508" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "2209688827063432418" + - "6123165661227686595" url: https://api.datadoghq.com/api/v1/synthetics/tests method: POST response: - body: '{"status":"live","public_id":"q84-qfr-vfh","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"Go - client testing Synthetics API test - this is message","deleted_at":null,"name":"go-TestSyntheticsAPITestLifecycle-local-1589290407","monitor_id":18411415,"type":"api","created_at":"2020-05-12T13:33:27.847190+00:00","modified_at":"2020-05-12T13:33:27.847190+00:00","subtype":"http","config":{"request":{"url":"https://datadoghq.com","headers":{"testingGoClient":"true"},"method":"GET","timeout":10},"assertions":[{"operator":"is","property":"content-type","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":10,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"tick_every":60}}' + body: '{"status":"live","public_id":"iww-dbj-m3c","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"Go + client testing Synthetics API test - this is message","deleted_at":null,"name":"go-TestSyntheticsAPITestLifecycle-local-1593417232","monitor_id":19778740,"type":"api","created_at":"2020-06-29T07:53:53.191980+00:00","modified_at":"2020-06-29T07:53:53.191980+00:00","subtype":"http","config":{"request":{"url":"https://datadoghq.com","headers":{"testingGoClient":"true"},"method":"GET","timeout":10},"assertions":[{"operator":"is","property":"content-type","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":10,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"tick_every":60}}' headers: Cache-Control: - no-cache Connection: - keep-alive - Content-Security-Policy: - - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Tue, 12 May 2020 13:33:27 GMT + - Mon, 29 Jun 2020 07:53:53 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-May-2020 13:33:27 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Mon, 06-Jul-2020 07:53:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -50,9 +48,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - OdMYjD4Lcx2EOYJ2NSqLNRIyMqxNYyUQxCcT6zY9ZmZ+zl9yipXz0nuLjH5hVxTY + - e/PzE6y8JJ1tlF66uEI2h0RElcpoaXRe9TzYMeQVIADcqTHrHUqcUgRemfbYKGMv X-Dd-Version: - - "35.2493025" + - "35.2671023" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -62,13 +60,13 @@ interactions: X-Ratelimit-Remaining: - "119" X-Ratelimit-Reset: - - "33" + - "7" status: 200 OK code: 200 duration: "" - request: body: | - {"config":{"assertions":[{"operator":"is","property":"content-type","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"}],"request":{"headers":{"testingGoClient":"true"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"Go client testing Synthetics API test - this is message","name":"go-TestSyntheticsAPITestLifecycle-local-1589290407-updated","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":10,"retry":{"count":3,"interval":10},"tick_every":60},"status":"live","subtype":"http","tags":["testing:api"],"type":"api"} + {"config":{"assertions":[{"operator":"is","property":"content-type","target":"text/html","type":"header"},{"operator":"lessThan","target":2000,"type":"responseTime"},{"operator":"validatesJSONPath","target":{"jsonPath":"topKey","operator":"isNot","targetValue":"0"},"type":"body"}],"request":{"headers":{"testingGoClient":"true"},"method":"GET","timeout":10,"url":"https://datadoghq.com"}},"locations":["aws:us-east-2"],"message":"Go client testing Synthetics API test - this is message","name":"go-TestSyntheticsAPITestLifecycle-local-1593417232-updated","options":{"accept_self_signed":false,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"min_location_failed":10,"retry":{"count":3,"interval":10},"tick_every":60},"status":"live","subtype":"http","tags":["testing:api"],"type":"api"} form: {} headers: Accept: @@ -78,35 +76,33 @@ interactions: Dd-Operation-Id: - UpdateTest User-Agent: - - datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "8010091500725224677" + - "8202690020200583082" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "2209688827063432418" - url: https://api.datadoghq.com/api/v1/synthetics/tests/q84-qfr-vfh + - "6123165661227686595" + url: https://api.datadoghq.com/api/v1/synthetics/tests/iww-dbj-m3c method: PUT response: - body: '{"status":"live","public_id":"q84-qfr-vfh","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"Go - client testing Synthetics API test - this is message","deleted_at":null,"name":"go-TestSyntheticsAPITestLifecycle-local-1589290407-updated","monitor_id":18411415,"type":"api","created_at":"2020-05-12T13:33:27.847190+00:00","modified_at":"2020-05-12T13:33:28.148781+00:00","subtype":"http","config":{"request":{"url":"https://datadoghq.com","headers":{"testingGoClient":"true"},"method":"GET","timeout":10},"assertions":[{"operator":"is","property":"content-type","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":10,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"tick_every":60}}' + body: '{"status":"live","public_id":"iww-dbj-m3c","tags":["testing:api"],"org_id":321813,"locations":["aws:us-east-2"],"message":"Go + client testing Synthetics API test - this is message","deleted_at":null,"name":"go-TestSyntheticsAPITestLifecycle-local-1593417232-updated","monitor_id":19778740,"type":"api","created_at":"2020-06-29T07:53:53.191980+00:00","modified_at":"2020-06-29T07:53:54.130684+00:00","subtype":"http","config":{"request":{"url":"https://datadoghq.com","headers":{"testingGoClient":"true"},"method":"GET","timeout":10},"assertions":[{"operator":"is","property":"content-type","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":10,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"tick_every":60}}' headers: Cache-Control: - no-cache Connection: - keep-alive - Content-Security-Policy: - - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Tue, 12 May 2020 13:33:28 GMT + - Mon, 29 Jun 2020 07:53:54 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-May-2020 13:33:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Mon, 06-Jul-2020 07:53:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -115,9 +111,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - J7vOWsxZd7Grxzg2TIaQpn2nGjrOScgI4Kwzur8V2oOTYInX6xbVT4leinNkGLPk + - jety+2H6BA1H4x31+wzy5BjqI2NDwh54fgbjSYyrLU0p2tWQPCCTKspX7sHO7u1n X-Dd-Version: - - "35.2493033" + - "35.2671023" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -127,7 +123,7 @@ interactions: X-Ratelimit-Remaining: - "499" X-Ratelimit-Reset: - - "32" + - "7" status: 200 OK code: 200 duration: "" @@ -140,37 +136,33 @@ interactions: Dd-Operation-Id: - GetTest User-Agent: - - datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "8257439138103443301" + - "6927800759786079513" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "2209688827063432418" - url: https://api.datadoghq.com/api/v1/synthetics/tests/q84-qfr-vfh + - "6123165661227686595" + url: https://api.datadoghq.com/api/v1/synthetics/tests/iww-dbj-m3c method: GET response: - body: '{"status":"live","public_id":"q84-qfr-vfh","tags":["testing:api"],"locations":["aws:us-east-2"],"message":"Go - client testing Synthetics API test - this is message","modified_by":{"email":"slavek.kabrda@datadoghq.com","handle":"slavek.kabrda@datadoghq.com","id":1379826,"name":"Slavek - Kabrda"},"name":"go-TestSyntheticsAPITestLifecycle-local-1589290407-updated","monitor_id":18411415,"type":"api","created_at":"2020-05-12T13:33:27.847190+00:00","modified_at":"2020-05-12T13:33:28.148781+00:00","created_by":{"email":"slavek.kabrda@datadoghq.com","handle":"slavek.kabrda@datadoghq.com","id":1379826,"name":"Slavek - Kabrda"},"subtype":"http","config":{"request":{"url":"https://datadoghq.com","headers":{"testingGoClient":"true"},"method":"GET","timeout":10},"assertions":[{"operator":"is","property":"content-type","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":10,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"tick_every":60}}' + body: '{"status":"live","public_id":"iww-dbj-m3c","tags":["testing:api"],"locations":["aws:us-east-2"],"message":"Go + client testing Synthetics API test - this is message","name":"go-TestSyntheticsAPITestLifecycle-local-1593417232-updated","monitor_id":19778740,"type":"api","subtype":"http","config":{"request":{"url":"https://datadoghq.com","headers":{"testingGoClient":"true"},"method":"GET","timeout":10},"assertions":[{"operator":"is","property":"content-type","type":"header","target":"text/html"},{"operator":"lessThan","type":"responseTime","target":2000},{"operator":"validatesJSONPath","type":"body","target":{"operator":"isNot","targetValue":"0","jsonPath":"topKey"}}]},"options":{"accept_self_signed":false,"retry":{"count":3,"interval":10},"min_location_failed":10,"allow_insecure":true,"follow_redirects":true,"min_failure_duration":10,"tick_every":60}}' headers: Cache-Control: - no-cache Connection: - keep-alive - Content-Security-Policy: - - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Tue, 12 May 2020 13:33:28 GMT + - Mon, 29 Jun 2020 07:53:54 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-May-2020 13:33:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Mon, 06-Jul-2020 07:53:54 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -179,9 +171,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - vG5kxpR47Wd0uZGIzWkStfMxs3cmVIjKYEHLQf0xQiHS0P2BwlwJHwTESUSKlcdO + - oQ/oy4ezTZ+/WzL4afBMlDjLd5w62e5H15hF5BJChw1Gte+Sq8B8tB7i6vlTiLL0 X-Dd-Version: - - "35.2493033" + - "35.2671023" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -191,7 +183,7 @@ interactions: X-Ratelimit-Remaining: - "999" X-Ratelimit-Reset: - - "32" + - "6" status: 200 OK code: 200 duration: "" @@ -207,14 +199,14 @@ interactions: Dd-Operation-Id: - UpdateTestPauseStatus User-Agent: - - datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "6509420288047180540" + - "1574551554689401044" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "2209688827063432418" - url: https://api.datadoghq.com/api/v1/synthetics/tests/q84-qfr-vfh/status + - "6123165661227686595" + url: https://api.datadoghq.com/api/v1/synthetics/tests/iww-dbj-m3c/status method: PUT response: body: "true" @@ -225,27 +217,25 @@ interactions: - keep-alive Content-Length: - "4" - Content-Security-Policy: - - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Tue, 12 May 2020 13:33:28 GMT + - Mon, 29 Jun 2020 07:53:55 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-May-2020 13:33:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Mon, 06-Jul-2020 07:53:54 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - rxkz+JB0yzarEINDeNWQGs9dk7PLNAMnAw2wV8MNkZOhKDtz+JOpGuIyyBUaWwyF + - CFSDBBie5Okt4N1oWVJNTAqpt778eCo7VQZ0NhVFWw8MHYFUwuA7DURhpFRYY+Wy X-Dd-Version: - - "35.2492943" + - "35.2671023" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -255,7 +245,7 @@ interactions: X-Ratelimit-Remaining: - "118" X-Ratelimit-Reset: - - "32" + - "5" status: 200 OK code: 200 duration: "" @@ -271,14 +261,14 @@ interactions: Dd-Operation-Id: - UpdateTestPauseStatus User-Agent: - - datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "7284767618226982421" + - "5772224754926546506" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "2209688827063432418" - url: https://api.datadoghq.com/api/v1/synthetics/tests/q84-qfr-vfh/status + - "6123165661227686595" + url: https://api.datadoghq.com/api/v1/synthetics/tests/iww-dbj-m3c/status method: PUT response: body: "true" @@ -289,27 +279,25 @@ interactions: - keep-alive Content-Length: - "4" - Content-Security-Policy: - - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Tue, 12 May 2020 13:33:29 GMT + - Mon, 29 Jun 2020 07:53:55 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-May-2020 13:33:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Mon, 06-Jul-2020 07:53:55 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; X-Content-Type-Options: - nosniff X-Dd-Debug: - - fqgAnnBv1js3TBerHAS1jOASlx3n1xB+hOOrFOLO2ZaBfZ3rktA3gzUaBetB5haL + - jety+2H6BA1H4x31+wzy5BjqI2NDwh54fgbjSYyrLU0p2tWQPCCTKspX7sHO7u1n X-Dd-Version: - - "35.2493025" + - "35.2671023" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -319,7 +307,7 @@ interactions: X-Ratelimit-Remaining: - "117" X-Ratelimit-Reset: - - "32" + - "5" status: 200 OK code: 200 duration: "" @@ -332,34 +320,32 @@ interactions: Dd-Operation-Id: - GetAPITestLatestResults User-Agent: - - datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "5571043946899736283" + - "3525458639004183849" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "2209688827063432418" - url: https://api.datadoghq.com/api/v1/synthetics/tests/q84-qfr-vfh/results?from_ts=0&probe_dc=aws%3Aus-east-2&to_ts=1589290407000 + - "6123165661227686595" + url: https://api.datadoghq.com/api/v1/synthetics/tests/iww-dbj-m3c/results?from_ts=0&probe_dc=aws%3Aus-east-2&to_ts=1593417232000 method: GET response: - body: '{"last_timestamp_fetched":1584106409000,"results":[]}' + body: '{"last_timestamp_fetched":1588233236000,"results":[]}' headers: Cache-Control: - no-cache Connection: - keep-alive - Content-Security-Policy: - - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Tue, 12 May 2020 13:33:29 GMT + - Mon, 29 Jun 2020 07:53:56 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-May-2020 13:33:29 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Mon, 06-Jul-2020 07:53:56 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -368,9 +354,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - hABsPq9DIvV7yAEiU7rMxs7UCRuTbRH/kYpwue4a0q9qmwd4SUh9bBZ5SHPkBLc6 + - btzHvL7Rg/f/n1wMP2CFVXsuErrwOO9p2hvsBofLQbxzRkmZbfvXcB18pURNtIOI X-Dd-Version: - - "35.2492943" + - "35.2671023" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -380,13 +366,13 @@ interactions: X-Ratelimit-Remaining: - "999" X-Ratelimit-Reset: - - "31" + - "4" status: 200 OK code: 200 duration: "" - request: body: | - {"public_ids":["q84-qfr-vfh"]} + {"public_ids":["iww-dbj-m3c"]} form: {} headers: Accept: @@ -396,34 +382,32 @@ interactions: Dd-Operation-Id: - DeleteTests User-Agent: - - datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "5897015302469961090" + - "7076234355387258401" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "2209688827063432418" + - "6123165661227686595" url: https://api.datadoghq.com/api/v1/synthetics/tests/delete method: POST response: - body: '{"deleted_tests":[{"deleted_at":"2020-05-12T13:33:29.651895+00:00","public_id":"q84-qfr-vfh"}]}' + body: '{"deleted_tests":[{"deleted_at":"2020-06-29T07:53:56.710460+00:00","public_id":"iww-dbj-m3c"}]}' headers: Cache-Control: - no-cache Connection: - keep-alive - Content-Security-Policy: - - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Tue, 12 May 2020 13:33:29 GMT + - Mon, 29 Jun 2020 07:53:57 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Tue, 19-May-2020 13:33:29 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Mon, 06-Jul-2020 07:53:56 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -432,9 +416,9 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - wFmrQbB6wLDPf1aNlKcgRoMicVhPlX6qIVwwvniX5cF7oyd+90s5trfE73Pzpvml + - 1/ye/L7/S9djtmh0CDbapYOAoYP2Xz5NE904aTai4cgQw/Kmmv343hpHqBIP3PC5 X-Dd-Version: - - "35.2492943" + - "35.2671023" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -444,13 +428,13 @@ interactions: X-Ratelimit-Remaining: - "119" X-Ratelimit-Reset: - - "31" + - "4" status: 200 OK code: 200 duration: "" - request: body: | - {"public_ids":["q84-qfr-vfh"]} + {"public_ids":["iww-dbj-m3c"]} form: {} headers: Accept: @@ -460,13 +444,13 @@ interactions: Dd-Operation-Id: - DeleteTests User-Agent: - - datadog-api-client-go/1.0.0-beta.2 (go go1.14; os darwin; arch amd64) + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.4; os darwin; arch amd64) X-Datadog-Parent-Id: - - "1715361232968291724" + - "6801266270798620243" X-Datadog-Sampling-Priority: - "1" X-Datadog-Trace-Id: - - "2209688827063432418" + - "6123165661227686595" url: https://api.datadoghq.com/api/v1/synthetics/tests/delete method: POST response: @@ -476,12 +460,10 @@ interactions: - no-cache Connection: - keep-alive - Content-Security-Policy: - - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report Content-Type: - application/json Date: - - Tue, 12 May 2020 13:33:29 GMT + - Mon, 29 Jun 2020 07:53:58 GMT Dd-Pool: - dogweb Pragma: @@ -493,7 +475,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Version: - - "35.2492943" + - "35.2671023" X-Frame-Options: - SAMEORIGIN X-Ratelimit-Limit: @@ -503,7 +485,7 @@ interactions: X-Ratelimit-Remaining: - "118" X-Ratelimit-Reset: - - "31" + - "3" status: 404 Not Found code: 404 duration: ""