Skip to content

Commit

Permalink
Powerpack add support for prefix and available values (#2164)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Sep 18, 2024
1 parent 06852c9 commit c8d3c8e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 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-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"
}
}
}
18 changes: 18 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
24 changes: 23 additions & 1 deletion src/datadog_api_client/v2/model/powerpack_template_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
none_type,
unset,
UnsetType,
)
Expand All @@ -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

0 comments on commit c8d3c8e

Please sign in to comment.