From c8d3c8e39c4301e8584393bc600255852531ae26 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:28:56 +0000 Subject: [PATCH] Powerpack add support for prefix and available values (#2164) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +++---- .generator/schemas/v2/openapi.yaml | 18 ++++++++++++++ .../v2/model/powerpack_template_variable.py | 24 ++++++++++++++++++- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index aa9d867bd4..80a7d5f79b 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-16 14:02:51.199796", - "spec_repo_commit": "966987f5" + "regenerated": "2024-09-18 14:45:15.242991", + "spec_repo_commit": "bae57ce1" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-09-16 14:02:51.217373", - "spec_repo_commit": "966987f5" + "regenerated": "2024-09-18 14:45:15.259945", + "spec_repo_commit": "bae57ce1" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 56725cba72..1bb007d88c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -16297,6 +16297,18 @@ components: PowerpackTemplateVariable: description: Powerpack template variables. properties: + available_values: + description: The list of values that the template variable drop-down is + limited to. + example: + - my-host + - host1 + - host2 + items: + description: Template variable value. + type: string + nullable: true + type: array defaults: description: One or many template variable default values within the saved view, which are unioned together using `OR` if more than one is specified. @@ -16309,6 +16321,12 @@ components: description: The name of the variable. example: datacenter type: string + prefix: + description: The tag prefix associated with the variable. Only tags with + this prefix appear in the variable drop-down. + example: host + nullable: true + type: string required: - name type: object diff --git a/src/datadog_api_client/v2/model/powerpack_template_variable.py b/src/datadog_api_client/v2/model/powerpack_template_variable.py index baf7493a6f..31acb4f785 100644 --- a/src/datadog_api_client/v2/model/powerpack_template_variable.py +++ b/src/datadog_api_client/v2/model/powerpack_template_variable.py @@ -8,6 +8,7 @@ from datadog_api_client.model_utils import ( ModelNormal, cached_property, + none_type, unset, UnsetType, ) @@ -17,27 +18,48 @@ class PowerpackTemplateVariable(ModelNormal): @cached_property def openapi_types(_): return { + "available_values": ([str], none_type), "defaults": ([str],), "name": (str,), + "prefix": (str, none_type), } attribute_map = { + "available_values": "available_values", "defaults": "defaults", "name": "name", + "prefix": "prefix", } - def __init__(self_, name: str, defaults: Union[List[str], UnsetType] = unset, **kwargs): + def __init__( + self_, + name: str, + available_values: Union[List[str], none_type, UnsetType] = unset, + defaults: Union[List[str], UnsetType] = unset, + prefix: Union[str, none_type, UnsetType] = unset, + **kwargs, + ): """ Powerpack template variables. + :param available_values: The list of values that the template variable drop-down is limited to. + :type available_values: [str], none_type, optional + :param defaults: One or many template variable default values within the saved view, which are unioned together using ``OR`` if more than one is specified. :type defaults: [str], optional :param name: The name of the variable. :type name: str + + :param prefix: The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down. + :type prefix: str, none_type, optional """ + if available_values is not unset: + kwargs["available_values"] = available_values if defaults is not unset: kwargs["defaults"] = defaults + if prefix is not unset: + kwargs["prefix"] = prefix super().__init__(kwargs) self_.name = name