Skip to content
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
7 changes: 4 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19700,11 +19700,12 @@ components:
- id
type: object
DeploymentRulesOptions:
description: Options for deployment rule response representing either faulty
deployment detection or monitor options.
oneOf:
anyOf:
- $ref: '#/components/schemas/DeploymentRuleOptionsFaultyDeploymentDetection'
- $ref: '#/components/schemas/DeploymentRuleOptionsMonitor'
description: Options for deployment rule response representing either faulty
deployment detection or monitor options. The actual type is determined by
the parent's 'type' field.
DetachCaseRequest:
description: Request for detaching security findings from their case.
properties:
Expand Down
21 changes: 0 additions & 21 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7746,20 +7746,6 @@ datadog\_api\_client.v2.model.deployment\_rule\_data\_type module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.deployment\_rule\_options\_faulty\_deployment\_detection module
---------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection
:members:
:show-inheritance:

datadog\_api\_client.v2.model.deployment\_rule\_options\_monitor module
-----------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.deployment_rule_options_monitor
:members:
:show-inheritance:

datadog\_api\_client.v2.model.deployment\_rule\_response module
---------------------------------------------------------------

Expand Down Expand Up @@ -7802,13 +7788,6 @@ datadog\_api\_client.v2.model.deployment\_rule\_response\_data\_attributes\_upda
:members:
:show-inheritance:

datadog\_api\_client.v2.model.deployment\_rules\_options module
---------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.deployment_rules_options
:members:
:show-inheritance:

datadog\_api\_client.v2.model.detach\_case\_request module
----------------------------------------------------------

Expand Down
8 changes: 2 additions & 6 deletions examples/v2/deployment-gates/CreateDeploymentRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
CreateDeploymentRuleParamsDataAttributes,
)
from datadog_api_client.v2.model.deployment_rule_data_type import DeploymentRuleDataType
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection import (
DeploymentRuleOptionsFaultyDeploymentDetection,
)
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions

# there is a valid "deployment_gate" in the system
DEPLOYMENT_GATE_DATA_ID = environ["DEPLOYMENT_GATE_DATA_ID"]
Expand All @@ -23,9 +21,7 @@
attributes=CreateDeploymentRuleParamsDataAttributes(
dry_run=False,
name="My deployment rule",
options=DeploymentRuleOptionsFaultyDeploymentDetection(
excluded_resources=[],
),
options=DeploymentRulesOptions([("excluded_resources", "[]")]),
type="faulty_deployment_detection",
),
type=DeploymentRuleDataType.DEPLOYMENT_RULE,
Expand Down
8 changes: 2 additions & 6 deletions examples/v2/deployment-gates/UpdateDeploymentRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.deployment_gates_api import DeploymentGatesApi
from datadog_api_client.v2.model.deployment_rule_data_type import DeploymentRuleDataType
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection import (
DeploymentRuleOptionsFaultyDeploymentDetection,
)
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions
from datadog_api_client.v2.model.update_deployment_rule_params import UpdateDeploymentRuleParams
from datadog_api_client.v2.model.update_deployment_rule_params_data import UpdateDeploymentRuleParamsData
from datadog_api_client.v2.model.update_deployment_rule_params_data_attributes import (
Expand All @@ -26,9 +24,7 @@
attributes=UpdateDeploymentRuleParamsDataAttributes(
dry_run=False,
name="Updated deployment rule",
options=DeploymentRuleOptionsFaultyDeploymentDetection(
excluded_resources=[],
),
options=DeploymentRulesOptions([("excluded_resources", "[]")]),
),
type=DeploymentRuleDataType.DEPLOYMENT_RULE,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,38 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union, TYPE_CHECKING
from typing import Any, Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
date,
datetime,
none_type,
unset,
UnsetType,
UUID,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection import (
DeploymentRuleOptionsFaultyDeploymentDetection,
)
from datadog_api_client.v2.model.deployment_rule_options_monitor import DeploymentRuleOptionsMonitor


class CreateDeploymentRuleParamsDataAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions

return {
"dry_run": (bool,),
"name": (str,),
"options": (DeploymentRulesOptions,),
"options": (
bool,
date,
datetime,
dict,
float,
int,
list,
str,
UUID,
none_type,
),
"type": (str,),
}

Expand All @@ -40,16 +45,7 @@ def openapi_types(_):
"type": "type",
}

def __init__(
self_,
name: str,
options: Union[
DeploymentRulesOptions, DeploymentRuleOptionsFaultyDeploymentDetection, DeploymentRuleOptionsMonitor
],
type: str,
dry_run: Union[bool, UnsetType] = unset,
**kwargs,
):
def __init__(self_, name: str, options: Any, type: str, dry_run: Union[bool, UnsetType] = unset, **kwargs):
"""
Parameters for creating a deployment rule.

Expand All @@ -59,8 +55,8 @@ def __init__(
:param name: The name of the deployment rule.
:type name: str

:param options: Options for deployment rule response representing either faulty deployment detection or monitor options.
:type options: DeploymentRulesOptions
:param options: Options for deployment rule response representing either faulty deployment detection or monitor options. The actual type is determined by the parent's 'type' field.
:type options: bool, date, datetime, dict, float, int, list, str, UUID, none_type

:param type: The type of the deployment rule (faulty_deployment_detection or monitor).
:type type: str
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,30 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union, TYPE_CHECKING
from typing import Any, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
date,
datetime,
none_type,
unset,
UnsetType,
UUID,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_created_by import (
DeploymentRuleResponseDataAttributesCreatedBy,
)
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_type import (
DeploymentRuleResponseDataAttributesType,
)
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_updated_by import (
DeploymentRuleResponseDataAttributesUpdatedBy,
)
from datadog_api_client.v2.model.deployment_rule_options_faulty_deployment_detection import (
DeploymentRuleOptionsFaultyDeploymentDetection,
)
from datadog_api_client.v2.model.deployment_rule_options_monitor import DeploymentRuleOptionsMonitor


class DeploymentRuleResponseDataAttributes(ModelNormal):
Expand All @@ -37,7 +35,6 @@ def openapi_types(_):
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_created_by import (
DeploymentRuleResponseDataAttributesCreatedBy,
)
from datadog_api_client.v2.model.deployment_rules_options import DeploymentRulesOptions
from datadog_api_client.v2.model.deployment_rule_response_data_attributes_type import (
DeploymentRuleResponseDataAttributesType,
)
Expand All @@ -51,7 +48,18 @@ def openapi_types(_):
"dry_run": (bool,),
"gate_id": (str,),
"name": (str,),
"options": (DeploymentRulesOptions,),
"options": (
bool,
date,
datetime,
dict,
float,
int,
list,
str,
UUID,
none_type,
),
"type": (DeploymentRuleResponseDataAttributesType,),
"updated_at": (datetime,),
"updated_by": (DeploymentRuleResponseDataAttributesUpdatedBy,),
Expand All @@ -76,9 +84,7 @@ def __init__(
dry_run: bool,
gate_id: str,
name: str,
options: Union[
DeploymentRulesOptions, DeploymentRuleOptionsFaultyDeploymentDetection, DeploymentRuleOptionsMonitor
],
options: Any,
type: DeploymentRuleResponseDataAttributesType,
updated_at: Union[datetime, UnsetType] = unset,
updated_by: Union[DeploymentRuleResponseDataAttributesUpdatedBy, UnsetType] = unset,
Expand All @@ -102,8 +108,8 @@ def __init__(
:param name: The name of the deployment rule.
:type name: str

:param options: Options for deployment rule response representing either faulty deployment detection or monitor options.
:type options: DeploymentRulesOptions
:param options: Options for deployment rule response representing either faulty deployment detection or monitor options. The actual type is determined by the parent's 'type' field.
:type options: bool, date, datetime, dict, float, int, list, str, UUID, none_type

:param type: The type of the deployment rule.
:type type: DeploymentRuleResponseDataAttributesType
Expand Down
Loading