Skip to content

Make assertion target be int or string #637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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.6",
"regenerated": "2025-05-02 04:31:12.514459",
"spec_repo_commit": "272cce39"
"regenerated": "2025-05-02 14:21:32.705181",
"spec_repo_commit": "022c8d0f"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-05-02 04:31:12.530271",
"spec_repo_commit": "272cce39"
"regenerated": "2025-05-02 14:21:32.723933",
"spec_repo_commit": "022c8d0f"
}
}
}
19 changes: 17 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14222,8 +14222,8 @@ components:
operator:
$ref: '#/components/schemas/SyntheticsAssertionBodyHashOperator'
target:
$ref: '#/components/schemas/SyntheticsAssertionTargetValue'
description: Value used by the operator.
example: 123456
type:
$ref: '#/components/schemas/SyntheticsAssertionBodyHashType'
required:
Expand Down Expand Up @@ -14279,6 +14279,7 @@ components:
description: The specific operator to use on the path.
type: string
targetValue:
$ref: '#/components/schemas/SyntheticsAssertionTargetValue'
description: The path target value to compare to.
type: object
SyntheticsAssertionJSONSchemaMetaSchema:
Expand Down Expand Up @@ -14386,8 +14387,8 @@ components:
description: The associated assertion property.
type: string
target:
$ref: '#/components/schemas/SyntheticsAssertionTargetValue'
description: Value used by the operator.
example: 123456
timingsScope:
$ref: '#/components/schemas/SyntheticsAssertionTimingsScope'
type:
Expand All @@ -14397,6 +14398,19 @@ components:
- operator
- target
type: object
SyntheticsAssertionTargetValue:
description: Value used by the operator in assertions. Can be either a number
or string.
oneOf:
- $ref: '#/components/schemas/SyntheticsAssertionTargetValueNumber'
- $ref: '#/components/schemas/SyntheticsAssertionTargetValueString'
SyntheticsAssertionTargetValueNumber:
description: Numeric value used by the operator in assertions.
format: int64
type: integer
SyntheticsAssertionTargetValueString:
description: String value used by the operator in assertions.
type: string
SyntheticsAssertionTimingsScope:
description: Timings scope for response time assertions.
enum:
Expand Down Expand Up @@ -14481,6 +14495,7 @@ components:
description: The specific operator to use on the path.
type: string
targetValue:
$ref: '#/components/schemas/SyntheticsAssertionTargetValue'
description: The path target value to compare to.
xPath:
description: The X path to assert.
Expand Down
4 changes: 2 additions & 2 deletions examples/v1_synthetics_CreateSyntheticsAPITest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use datadog_api_client::datadogV1::model::SyntheticsAPITestType;
use datadog_api_client::datadogV1::model::SyntheticsAssertion;
use datadog_api_client::datadogV1::model::SyntheticsAssertionOperator;
use datadog_api_client::datadogV1::model::SyntheticsAssertionTarget;
use datadog_api_client::datadogV1::model::SyntheticsAssertionTargetValue;
use datadog_api_client::datadogV1::model::SyntheticsAssertionType;
use datadog_api_client::datadogV1::model::SyntheticsBrowserTestRumSettings;
use datadog_api_client::datadogV1::model::SyntheticsTestCiOptions;
Expand All @@ -21,7 +22,6 @@ use datadog_api_client::datadogV1::model::SyntheticsTestOptionsScheduling;
use datadog_api_client::datadogV1::model::SyntheticsTestOptionsSchedulingTimeframe;
use datadog_api_client::datadogV1::model::SyntheticsTestPauseStatus;
use datadog_api_client::datadogV1::model::SyntheticsTestRequest;
use serde_json::Value;

#[tokio::main]
async fn main() {
Expand All @@ -30,7 +30,7 @@ async fn main() {
.assertions(vec![SyntheticsAssertion::SyntheticsAssertionTarget(
Box::new(SyntheticsAssertionTarget::new(
SyntheticsAssertionOperator::LESS_THAN,
Value::from(1000),
SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(1000),
SyntheticsAssertionType::RESPONSE_TIME,
)),
)])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ use datadog_api_client::datadogV1::model::SyntheticsAPITestType;
use datadog_api_client::datadogV1::model::SyntheticsAssertion;
use datadog_api_client::datadogV1::model::SyntheticsAssertionOperator;
use datadog_api_client::datadogV1::model::SyntheticsAssertionTarget;
use datadog_api_client::datadogV1::model::SyntheticsAssertionTargetValue;
use datadog_api_client::datadogV1::model::SyntheticsAssertionType;
use datadog_api_client::datadogV1::model::SyntheticsTestDetailsSubType;
use datadog_api_client::datadogV1::model::SyntheticsTestOptions;
use datadog_api_client::datadogV1::model::SyntheticsTestRequest;
use datadog_api_client::datadogV1::model::SyntheticsTestRequestPort;
use serde_json::Value;

#[tokio::main]
async fn main() {
Expand All @@ -21,7 +21,7 @@ async fn main() {
.assertions(vec![SyntheticsAssertion::SyntheticsAssertionTarget(
Box::new(SyntheticsAssertionTarget::new(
SyntheticsAssertionOperator::IS_IN_MORE_DAYS_THAN,
Value::from(10),
SyntheticsAssertionTargetValue::SyntheticsAssertionTargetValueNumber(10),
SyntheticsAssertionType::CERTIFICATE,
)),
)])
Expand Down
Loading
Loading