-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 5031c4b4 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Jul 30, 2024
1 parent
f33e892
commit af56071
Showing
15 changed files
with
496 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
Update an existing rule returns "Rule updated successfully" response | ||
""" | ||
|
||
from os import environ | ||
from datadog_api_client import ApiClient, Configuration | ||
from datadog_api_client.v2.api.service_scorecards_api import ServiceScorecardsApi | ||
from datadog_api_client.v2.model.rule_attributes import RuleAttributes | ||
from datadog_api_client.v2.model.update_rule_request import UpdateRuleRequest | ||
from datadog_api_client.v2.model.update_rule_request_data import UpdateRuleRequestData | ||
|
||
# there is a valid "create_scorecard_rule" in the system | ||
CREATE_SCORECARD_RULE_DATA_ATTRIBUTES_NAME = environ["CREATE_SCORECARD_RULE_DATA_ATTRIBUTES_NAME"] | ||
CREATE_SCORECARD_RULE_DATA_ATTRIBUTES_SCORECARD_NAME = environ["CREATE_SCORECARD_RULE_DATA_ATTRIBUTES_SCORECARD_NAME"] | ||
CREATE_SCORECARD_RULE_DATA_ID = environ["CREATE_SCORECARD_RULE_DATA_ID"] | ||
|
||
body = UpdateRuleRequest( | ||
data=UpdateRuleRequestData( | ||
attributes=RuleAttributes( | ||
enabled=True, | ||
name=CREATE_SCORECARD_RULE_DATA_ATTRIBUTES_NAME, | ||
scorecard_name=CREATE_SCORECARD_RULE_DATA_ATTRIBUTES_SCORECARD_NAME, | ||
description="Updated description via test", | ||
), | ||
), | ||
) | ||
|
||
configuration = Configuration() | ||
configuration.unstable_operations["update_scorecard_rule"] = True | ||
with ApiClient(configuration) as api_client: | ||
api_instance = ServiceScorecardsApi(api_client) | ||
response = api_instance.update_scorecard_rule(rule_id=CREATE_SCORECARD_RULE_DATA_ID, body=body) | ||
|
||
print(response) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# 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. | ||
from __future__ import annotations | ||
|
||
from typing import Union, TYPE_CHECKING | ||
|
||
from datadog_api_client.model_utils import ( | ||
ModelNormal, | ||
cached_property, | ||
unset, | ||
UnsetType, | ||
) | ||
|
||
|
||
if TYPE_CHECKING: | ||
from datadog_api_client.v2.model.update_rule_request_data import UpdateRuleRequestData | ||
|
||
|
||
class UpdateRuleRequest(ModelNormal): | ||
@cached_property | ||
def openapi_types(_): | ||
from datadog_api_client.v2.model.update_rule_request_data import UpdateRuleRequestData | ||
|
||
return { | ||
"data": (UpdateRuleRequestData,), | ||
} | ||
|
||
attribute_map = { | ||
"data": "data", | ||
} | ||
|
||
def __init__(self_, data: Union[UpdateRuleRequestData, UnsetType] = unset, **kwargs): | ||
""" | ||
Scorecard update rule request. | ||
:param data: Scorecard update rule request data. | ||
:type data: UpdateRuleRequestData, optional | ||
""" | ||
if data is not unset: | ||
kwargs["data"] = data | ||
super().__init__(kwargs) |
53 changes: 53 additions & 0 deletions
53
src/datadog_api_client/v2/model/update_rule_request_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# 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. | ||
from __future__ import annotations | ||
|
||
from typing import Union, TYPE_CHECKING | ||
|
||
from datadog_api_client.model_utils import ( | ||
ModelNormal, | ||
cached_property, | ||
unset, | ||
UnsetType, | ||
) | ||
|
||
|
||
if TYPE_CHECKING: | ||
from datadog_api_client.v2.model.rule_attributes import RuleAttributes | ||
from datadog_api_client.v2.model.rule_type import RuleType | ||
|
||
|
||
class UpdateRuleRequestData(ModelNormal): | ||
@cached_property | ||
def openapi_types(_): | ||
from datadog_api_client.v2.model.rule_attributes import RuleAttributes | ||
from datadog_api_client.v2.model.rule_type import RuleType | ||
|
||
return { | ||
"attributes": (RuleAttributes,), | ||
"type": (RuleType,), | ||
} | ||
|
||
attribute_map = { | ||
"attributes": "attributes", | ||
"type": "type", | ||
} | ||
|
||
def __init__( | ||
self_, attributes: Union[RuleAttributes, UnsetType] = unset, type: Union[RuleType, UnsetType] = unset, **kwargs | ||
): | ||
""" | ||
Scorecard update rule request data. | ||
:param attributes: Details of a rule. | ||
:type attributes: RuleAttributes, optional | ||
:param type: The JSON:API type for scorecard rules. | ||
:type type: RuleType, optional | ||
""" | ||
if attributes is not unset: | ||
kwargs["attributes"] = attributes | ||
if type is not unset: | ||
kwargs["type"] = type | ||
super().__init__(kwargs) |
Oops, something went wrong.