Skip to content
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

Document force_delete_dependencies for synthetics test deletion #1869

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-02 18:17:49.729268",
"spec_repo_commit": "464f0cec"
"regenerated": "2024-07-02 18:50:31.571748",
"spec_repo_commit": "fae9d797"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-02 18:17:49.747072",
"spec_repo_commit": "464f0cec"
"regenerated": "2024-07-02 18:50:31.591802",
"spec_repo_commit": "fae9d797"
}
}
}
7 changes: 7 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14944,6 +14944,13 @@ components:

to delete.'
properties:
force_delete_dependencies:
description: 'Delete the Synthetic test even if it''s referenced by other
resources

(for example, SLOs and composite monitors).'
example: false
type: boolean
public_ids:
description: An array of Synthetic test IDs you want to delete.
example: []
Expand Down
4 changes: 2 additions & 2 deletions features/v1/synthetics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,14 @@ Feature: Synthetics
@generated @skip @team:DataDog/synthetics-ct
Scenario: Delete tests returns "- JSON format is wrong" response
Given new "DeleteTests" request
And body with value {"public_ids": []}
And body with value {"force_delete_dependencies": false, "public_ids": []}
When the request is sent
Then the response status is 400 - JSON format is wrong

@generated @skip @team:DataDog/synthetics-ct
Scenario: Delete tests returns "- Tests to be deleted can't be found" response
Given new "DeleteTests" request
And body with value {"public_ids": []}
And body with value {"force_delete_dependencies": false, "public_ids": []}
When the request is sent
Then the response status is 404 - Tests to be deleted can't be found

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@ module DatadogAPIClient::V1
class SyntheticsDeleteTestsPayload
include BaseGenericModel

# Delete the Synthetic test even if it's referenced by other resources
# (for example, SLOs and composite monitors).
attr_accessor :force_delete_dependencies

# An array of Synthetic test IDs you want to delete.
attr_accessor :public_ids

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'force_delete_dependencies' => :'force_delete_dependencies',
:'public_ids' => :'public_ids'
}
end
Expand All @@ -37,6 +42,7 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'force_delete_dependencies' => :'Boolean',
:'public_ids' => :'Array<String>'
}
end
Expand All @@ -57,6 +63,10 @@ def initialize(attributes = {})
h[k.to_sym] = v
}

if attributes.key?(:'force_delete_dependencies')
self.force_delete_dependencies = attributes[:'force_delete_dependencies']
end

if attributes.key?(:'public_ids')
if (value = attributes[:'public_ids']).is_a?(Array)
self.public_ids = value
Expand All @@ -70,14 +80,15 @@ def initialize(attributes = {})
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
force_delete_dependencies == o.force_delete_dependencies &&
public_ids == o.public_ids
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[public_ids].hash
[force_delete_dependencies, public_ids].hash
end
end
end
Loading