Skip to content

Add is_totp and is_fido to Synthetic global variables #2059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 16, 2024
Merged
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
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-08-14 22:32:00.966604",
"spec_repo_commit": "07d72513"
"regenerated": "2024-08-16 13:40:31.374500",
"spec_repo_commit": "1b56c3ba"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-14 22:32:00.983631",
"spec_repo_commit": "07d72513"
"regenerated": "2024-08-16 13:40:31.392812",
"spec_repo_commit": "1b56c3ba"
}
}
}
57 changes: 55 additions & 2 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15143,6 +15143,12 @@ components:
description: Unique identifier of the global variable.
readOnly: true
type: string
is_fido:
description: Determines if the global variable is a FIDO variable.
type: boolean
is_totp:
description: Determines if the global variable is a TOTP/MFA variable.
type: boolean
name:
description: Name of the global variable. Unique across Synthetic global
variables.
Expand Down Expand Up @@ -15233,6 +15239,53 @@ components:
- JSON_PATH
- REGEX
- X_PATH
SyntheticsGlobalVariableRequest:
description: Details of the global variable to create.
properties:
attributes:
$ref: '#/components/schemas/SyntheticsGlobalVariableAttributes'
description:
description: Description of the global variable.
example: Example description
type: string
id:
description: Unique identifier of the global variable.
readOnly: true
type: string
is_fido:
description: Determines if the global variable is a FIDO variable.
type: boolean
is_totp:
description: Determines if the global variable is a TOTP/MFA variable.
type: boolean
name:
description: Name of the global variable. Unique across Synthetic global
variables.
example: MY_VARIABLE
type: string
parse_test_options:
$ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptions'
parse_test_public_id:
description: A Synthetic test ID to use as a test to generate the variable
value.
example: abc-def-123
type: string
tags:
description: Tags of the global variable.
example:
- team:front
- test:workflow-1
items:
description: Tag name.
type: string
type: array
value:
$ref: '#/components/schemas/SyntheticsGlobalVariableValue'
required:
- description
- name
- tags
type: object
SyntheticsGlobalVariableTOTPParameters:
description: Parameters for the TOTP/MFA variable
properties:
Expand Down Expand Up @@ -31194,7 +31247,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsGlobalVariable'
$ref: '#/components/schemas/SyntheticsGlobalVariableRequest'
description: Details of the global variable to create.
required: true
responses:
Expand Down Expand Up @@ -31328,7 +31381,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/SyntheticsGlobalVariable'
$ref: '#/components/schemas/SyntheticsGlobalVariableRequest'
description: Details of the global variable to update.
required: true
responses:
Expand Down
7 changes: 7 additions & 0 deletions docs/datadog_api_client.v1.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4400,6 +4400,13 @@ datadog\_api\_client.v1.model.synthetics\_global\_variable\_parser\_type module
:members:
:show-inheritance:

datadog\_api\_client.v1.model.synthetics\_global\_variable\_request module
--------------------------------------------------------------------------

.. automodule:: datadog_api_client.v1.model.synthetics_global_variable_request
:members:
:show-inheritance:

datadog\_api\_client.v1.model.synthetics\_global\_variable\_totp\_parameters module
-----------------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions examples/v1/synthetics/CreateGlobalVariable.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_global_variable import SyntheticsGlobalVariable
from datadog_api_client.v1.model.synthetics_global_variable_attributes import SyntheticsGlobalVariableAttributes
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options import (
SyntheticsGlobalVariableParseTestOptions,
Expand All @@ -13,11 +12,12 @@
SyntheticsGlobalVariableParseTestOptionsType,
)
from datadog_api_client.v1.model.synthetics_global_variable_parser_type import SyntheticsGlobalVariableParserType
from datadog_api_client.v1.model.synthetics_global_variable_request import SyntheticsGlobalVariableRequest
from datadog_api_client.v1.model.synthetics_global_variable_value import SyntheticsGlobalVariableValue
from datadog_api_client.v1.model.synthetics_restricted_roles import SyntheticsRestrictedRoles
from datadog_api_client.v1.model.synthetics_variable_parser import SyntheticsVariableParser

body = SyntheticsGlobalVariable(
body = SyntheticsGlobalVariableRequest(
attributes=SyntheticsGlobalVariableAttributes(
restricted_roles=SyntheticsRestrictedRoles(
[
Expand Down
16 changes: 3 additions & 13 deletions examples/v1/synthetics/CreateGlobalVariable_1068962881.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,25 @@
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_global_variable import SyntheticsGlobalVariable
from datadog_api_client.v1.model.synthetics_global_variable_options import SyntheticsGlobalVariableOptions
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options import (
SyntheticsGlobalVariableParseTestOptions,
)
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options_type import (
SyntheticsGlobalVariableParseTestOptionsType,
)
from datadog_api_client.v1.model.synthetics_global_variable_totp_parameters import (
SyntheticsGlobalVariableTOTPParameters,
)
from datadog_api_client.v1.model.synthetics_global_variable_request import SyntheticsGlobalVariableRequest
from datadog_api_client.v1.model.synthetics_global_variable_value import SyntheticsGlobalVariableValue

# there is a valid "synthetics_api_test_multi_step" in the system
SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID = environ["SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID"]

body = SyntheticsGlobalVariable(
body = SyntheticsGlobalVariableRequest(
description="",
name="GLOBAL_VARIABLE_PAYLOAD_EXAMPLESYNTHETIC",
name="GLOBAL_VARIABLE_FROM_TEST_PAYLOAD_EXAMPLESYNTHETIC",
tags=[],
value=SyntheticsGlobalVariableValue(
secure=False,
value="",
options=SyntheticsGlobalVariableOptions(
totp_parameters=SyntheticsGlobalVariableTOTPParameters(
digits=6,
refresh_interval=30,
),
),
),
parse_test_public_id=SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID,
parse_test_options=SyntheticsGlobalVariableParseTestOptions(
Expand Down
21 changes: 21 additions & 0 deletions examples/v1/synthetics/CreateGlobalVariable_3298562511.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""
Create a FIDO global variable returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_global_variable_request import SyntheticsGlobalVariableRequest

body = SyntheticsGlobalVariableRequest(
description="",
is_fido=True,
name="GLOBAL_VARIABLE_FIDO_PAYLOAD_EXAMPLESYNTHETIC",
tags=[],
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = SyntheticsApi(api_client)
response = api_instance.create_global_variable(body=body)

print(response)
36 changes: 36 additions & 0 deletions examples/v1/synthetics/CreateGlobalVariable_3397718516.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""
Create a TOTP global variable returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_global_variable_options import SyntheticsGlobalVariableOptions
from datadog_api_client.v1.model.synthetics_global_variable_request import SyntheticsGlobalVariableRequest
from datadog_api_client.v1.model.synthetics_global_variable_totp_parameters import (
SyntheticsGlobalVariableTOTPParameters,
)
from datadog_api_client.v1.model.synthetics_global_variable_value import SyntheticsGlobalVariableValue

body = SyntheticsGlobalVariableRequest(
description="",
is_totp=True,
name="GLOBAL_VARIABLE_TOTP_PAYLOAD_EXAMPLESYNTHETIC",
tags=[],
value=SyntheticsGlobalVariableValue(
secure=False,
value="",
options=SyntheticsGlobalVariableOptions(
totp_parameters=SyntheticsGlobalVariableTOTPParameters(
digits=6,
refresh_interval=30,
),
),
),
)

configuration = Configuration()
with ApiClient(configuration) as api_client:
api_instance = SyntheticsApi(api_client)
response = api_instance.create_global_variable(body=body)

print(response)
4 changes: 2 additions & 2 deletions examples/v1/synthetics/EditGlobalVariable.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v1.api.synthetics_api import SyntheticsApi
from datadog_api_client.v1.model.synthetics_global_variable import SyntheticsGlobalVariable
from datadog_api_client.v1.model.synthetics_global_variable_attributes import SyntheticsGlobalVariableAttributes
from datadog_api_client.v1.model.synthetics_global_variable_parse_test_options import (
SyntheticsGlobalVariableParseTestOptions,
Expand All @@ -13,11 +12,12 @@
SyntheticsGlobalVariableParseTestOptionsType,
)
from datadog_api_client.v1.model.synthetics_global_variable_parser_type import SyntheticsGlobalVariableParserType
from datadog_api_client.v1.model.synthetics_global_variable_request import SyntheticsGlobalVariableRequest
from datadog_api_client.v1.model.synthetics_global_variable_value import SyntheticsGlobalVariableValue
from datadog_api_client.v1.model.synthetics_restricted_roles import SyntheticsRestrictedRoles
from datadog_api_client.v1.model.synthetics_variable_parser import SyntheticsVariableParser

body = SyntheticsGlobalVariable(
body = SyntheticsGlobalVariableRequest(
attributes=SyntheticsGlobalVariableAttributes(
restricted_roles=SyntheticsRestrictedRoles(
[
Expand Down
13 changes: 7 additions & 6 deletions src/datadog_api_client/v1/api/synthetics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
)
from datadog_api_client.v1.model.synthetics_list_global_variables_response import SyntheticsListGlobalVariablesResponse
from datadog_api_client.v1.model.synthetics_global_variable import SyntheticsGlobalVariable
from datadog_api_client.v1.model.synthetics_global_variable_request import SyntheticsGlobalVariableRequest


class SyntheticsApi:
Expand Down Expand Up @@ -73,7 +74,7 @@ def __init__(self, api_client=None):
params_map={
"body": {
"required": True,
"openapi_types": (SyntheticsGlobalVariable,),
"openapi_types": (SyntheticsGlobalVariableRequest,),
"location": "body",
},
},
Expand Down Expand Up @@ -225,7 +226,7 @@ def __init__(self, api_client=None):
},
"body": {
"required": True,
"openapi_types": (SyntheticsGlobalVariable,),
"openapi_types": (SyntheticsGlobalVariableRequest,),
"location": "body",
},
},
Expand Down Expand Up @@ -754,14 +755,14 @@ def __init__(self, api_client=None):

def create_global_variable(
self,
body: SyntheticsGlobalVariable,
body: SyntheticsGlobalVariableRequest,
) -> SyntheticsGlobalVariable:
"""Create a global variable.

Create a Synthetic global variable.

:param body: Details of the global variable to create.
:type body: SyntheticsGlobalVariable
:type body: SyntheticsGlobalVariableRequest
:rtype: SyntheticsGlobalVariable
"""
kwargs: Dict[str, Any] = {}
Expand Down Expand Up @@ -874,7 +875,7 @@ def delete_tests(
def edit_global_variable(
self,
variable_id: str,
body: SyntheticsGlobalVariable,
body: SyntheticsGlobalVariableRequest,
) -> SyntheticsGlobalVariable:
"""Edit a global variable.

Expand All @@ -883,7 +884,7 @@ def edit_global_variable(
:param variable_id: The ID of the global variable.
:type variable_id: str
:param body: Details of the global variable to update.
:type body: SyntheticsGlobalVariable
:type body: SyntheticsGlobalVariableRequest
:rtype: SyntheticsGlobalVariable
"""
kwargs: Dict[str, Any] = {}
Expand Down
16 changes: 16 additions & 0 deletions src/datadog_api_client/v1/model/synthetics_global_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ def openapi_types(_):
"attributes": (SyntheticsGlobalVariableAttributes,),
"description": (str,),
"id": (str,),
"is_fido": (bool,),
"is_totp": (bool,),
"name": (str,),
"parse_test_options": (SyntheticsGlobalVariableParseTestOptions,),
"parse_test_public_id": (str,),
Expand All @@ -45,6 +47,8 @@ def openapi_types(_):
"attributes": "attributes",
"description": "description",
"id": "id",
"is_fido": "is_fido",
"is_totp": "is_totp",
"name": "name",
"parse_test_options": "parse_test_options",
"parse_test_public_id": "parse_test_public_id",
Expand All @@ -63,6 +67,8 @@ def __init__(
value: SyntheticsGlobalVariableValue,
attributes: Union[SyntheticsGlobalVariableAttributes, UnsetType] = unset,
id: Union[str, UnsetType] = unset,
is_fido: Union[bool, UnsetType] = unset,
is_totp: Union[bool, UnsetType] = unset,
parse_test_options: Union[SyntheticsGlobalVariableParseTestOptions, UnsetType] = unset,
parse_test_public_id: Union[str, UnsetType] = unset,
**kwargs,
Expand All @@ -79,6 +85,12 @@ def __init__(
:param id: Unique identifier of the global variable.
:type id: str, optional

:param is_fido: Determines if the global variable is a FIDO variable.
:type is_fido: bool, optional

:param is_totp: Determines if the global variable is a TOTP/MFA variable.
:type is_totp: bool, optional

:param name: Name of the global variable. Unique across Synthetic global variables.
:type name: str

Expand All @@ -98,6 +110,10 @@ def __init__(
kwargs["attributes"] = attributes
if id is not unset:
kwargs["id"] = id
if is_fido is not unset:
kwargs["is_fido"] = is_fido
if is_totp is not unset:
kwargs["is_totp"] = is_totp
if parse_test_options is not unset:
kwargs["parse_test_options"] = parse_test_options
if parse_test_public_id is not unset:
Expand Down
Loading
Loading