Skip to content

Commit

Permalink
Regenerate client from commit fae9d797 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jul 2, 2024
1 parent 12cf819 commit 692bd99
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
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:51.676161",
"spec_repo_commit": "464f0cec"
"regenerated": "2024-07-02 18:50:24.042736",
"spec_repo_commit": "fae9d797"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-02 18:17:51.694171",
"spec_repo_commit": "464f0cec"
"regenerated": "2024-07-02 18:50:24.060302",
"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
40 changes: 38 additions & 2 deletions api/datadogV1/model_synthetics_delete_tests_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import (
// SyntheticsDeleteTestsPayload A JSON list of the ID or IDs of the Synthetic tests that you want
// to delete.
type SyntheticsDeleteTestsPayload struct {
// Delete the Synthetic test even if it's referenced by other resources
// (for example, SLOs and composite monitors).
ForceDeleteDependencies *bool `json:"force_delete_dependencies,omitempty"`
// An array of Synthetic test IDs you want to delete.
PublicIds []string `json:"public_ids,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand All @@ -35,6 +38,34 @@ func NewSyntheticsDeleteTestsPayloadWithDefaults() *SyntheticsDeleteTestsPayload
return &this
}

// GetForceDeleteDependencies returns the ForceDeleteDependencies field value if set, zero value otherwise.
func (o *SyntheticsDeleteTestsPayload) GetForceDeleteDependencies() bool {
if o == nil || o.ForceDeleteDependencies == nil {
var ret bool
return ret
}
return *o.ForceDeleteDependencies
}

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

// HasForceDeleteDependencies returns a boolean if a field has been set.
func (o *SyntheticsDeleteTestsPayload) HasForceDeleteDependencies() bool {
return o != nil && o.ForceDeleteDependencies != nil
}

// SetForceDeleteDependencies gets a reference to the given bool and assigns it to the ForceDeleteDependencies field.
func (o *SyntheticsDeleteTestsPayload) SetForceDeleteDependencies(v bool) {
o.ForceDeleteDependencies = &v
}

// GetPublicIds returns the PublicIds field value if set, zero value otherwise.
func (o *SyntheticsDeleteTestsPayload) GetPublicIds() []string {
if o == nil || o.PublicIds == nil {
Expand Down Expand Up @@ -69,6 +100,9 @@ func (o SyntheticsDeleteTestsPayload) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.ForceDeleteDependencies != nil {
toSerialize["force_delete_dependencies"] = o.ForceDeleteDependencies
}
if o.PublicIds != nil {
toSerialize["public_ids"] = o.PublicIds
}
Expand All @@ -82,17 +116,19 @@ func (o SyntheticsDeleteTestsPayload) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *SyntheticsDeleteTestsPayload) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
PublicIds []string `json:"public_ids,omitempty"`
ForceDeleteDependencies *bool `json:"force_delete_dependencies,omitempty"`
PublicIds []string `json:"public_ids,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"public_ids"})
datadog.DeleteKeys(additionalProperties, &[]string{"force_delete_dependencies", "public_ids"})
} else {
return err
}
o.ForceDeleteDependencies = all.ForceDeleteDependencies
o.PublicIds = all.PublicIds

if len(additionalProperties) > 0 {
Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/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

0 comments on commit 692bd99

Please sign in to comment.