Skip to content

Commit

Permalink
Enable auto-merging for keys routes. (#2108)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec committed Aug 15, 2024
1 parent 1d21c92 commit ad4a270
Show file tree
Hide file tree
Showing 17 changed files with 288 additions and 17 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-08-14 22:02:36.053386",
"spec_repo_commit": "5e33062a"
"regenerated": "2024-08-14 22:32:00.966604",
"spec_repo_commit": "07d72513"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-14 22:02:36.070633",
"spec_repo_commit": "5e33062a"
"regenerated": "2024-08-14 22:32:00.983631",
"spec_repo_commit": "07d72513"
}
}
}
55 changes: 55 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,16 @@ components:
APIKeyCreateAttributes:
description: Attributes used to create an API Key.
properties:
category:
description: The APIKeyCreateAttributes category.
type: string
name:
description: Name of the API key.
example: API Key for submitting metrics
type: string
remote_config_read_enabled:
description: The APIKeyCreateAttributes remote_config_read_enabled.
type: boolean
required:
- name
type: object
Expand Down Expand Up @@ -722,13 +728,20 @@ components:
description: An object related to an API key.
oneOf:
- $ref: '#/components/schemas/User'
- $ref: '#/components/schemas/LeakedKey'
APIKeyUpdateAttributes:
description: Attributes used to update an API Key.
properties:
category:
description: The APIKeyUpdateAttributes category.
type: string
name:
description: Name of the API key.
example: API Key for submitting metrics
type: string
remote_config_read_enabled:
description: The APIKeyUpdateAttributes remote_config_read_enabled.
type: boolean
required:
- name
type: object
Expand Down Expand Up @@ -981,6 +994,7 @@ components:
oneOf:
- $ref: '#/components/schemas/User'
- $ref: '#/components/schemas/Role'
- $ref: '#/components/schemas/LeakedKey'
ApplicationKeyResponseMeta:
description: Additional information related to the application key response.
properties:
Expand Down Expand Up @@ -8461,6 +8475,7 @@ components:
created_at:
description: Creation date of the API key.
example: '2020-11-23T10:00:00.000Z'
format: date-time
readOnly: true
type: string
key:
Expand All @@ -8477,6 +8492,7 @@ components:
modified_at:
description: Date the API key was last modified.
example: '2020-11-23T10:00:00.000Z'
format: date-time
readOnly: true
type: string
name:
Expand Down Expand Up @@ -11140,6 +11156,45 @@ components:
description: Jira project key
type: string
type: object
LeakedKey:
description: The definition of LeakedKey object.
properties:
attributes:
$ref: '#/components/schemas/LeakedKeyAttributes'
id:
description: The LeakedKey id.
example: id
type: string
type:
$ref: '#/components/schemas/LeakedKeyType'
required:
- attributes
- id
- type
type: object
LeakedKeyAttributes:
description: The definition of LeakedKeyAttributes object.
properties:
date:
description: The LeakedKeyAttributes date.
example: '2017-07-21T17:32:28Z'
format: date-time
type: string
leak_source:
description: The LeakedKeyAttributes leak_source.
type: string
required:
- date
type: object
LeakedKeyType:
default: leaked_keys
description: The definition of LeakedKeyType object.
enum:
- leaked_keys
example: leaked_keys
type: string
x-enum-varnames:
- LEAKED_KEYS
ListAPIsResponse:
description: Response for `ListAPIs`.
properties:
Expand Down
21 changes: 21 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4652,6 +4652,27 @@ datadog\_api\_client.v2.model.jsonapi\_error\_response module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.leaked\_key module
------------------------------------------------

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

datadog\_api\_client.v2.model.leaked\_key\_attributes module
------------------------------------------------------------

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

datadog\_api\_client.v2.model.leaked\_key\_type module
------------------------------------------------------

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

datadog\_api\_client.v2.model.list\_apis\_response module
---------------------------------------------------------

Expand Down
25 changes: 24 additions & 1 deletion src/datadog_api_client/v2/model/api_key_create_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,54 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class APIKeyCreateAttributes(ModelNormal):
@cached_property
def openapi_types(_):
return {
"category": (str,),
"name": (str,),
"remote_config_read_enabled": (bool,),
}

attribute_map = {
"category": "category",
"name": "name",
"remote_config_read_enabled": "remote_config_read_enabled",
}

def __init__(self_, name: str, **kwargs):
def __init__(
self_,
name: str,
category: Union[str, UnsetType] = unset,
remote_config_read_enabled: Union[bool, UnsetType] = unset,
**kwargs,
):
"""
Attributes used to create an API Key.
:param category: The APIKeyCreateAttributes category.
:type category: str, optional
:param name: Name of the API key.
:type name: str
:param remote_config_read_enabled: The APIKeyCreateAttributes remote_config_read_enabled.
:type remote_config_read_enabled: bool, optional
"""
if category is not unset:
kwargs["category"] = category
if remote_config_read_enabled is not unset:
kwargs["remote_config_read_enabled"] = remote_config_read_enabled
super().__init__(kwargs)

self_.name = name
3 changes: 2 additions & 1 deletion src/datadog_api_client/v2/model/api_key_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from datadog_api_client.v2.model.full_api_key import FullAPIKey
from datadog_api_client.v2.model.api_key_response_included_item import APIKeyResponseIncludedItem
from datadog_api_client.v2.model.user import User
from datadog_api_client.v2.model.leaked_key import LeakedKey


class APIKeyResponse(ModelNormal):
Expand All @@ -38,7 +39,7 @@ def openapi_types(_):
def __init__(
self_,
data: Union[FullAPIKey, UnsetType] = unset,
included: Union[List[Union[APIKeyResponseIncludedItem, User]], UnsetType] = unset,
included: Union[List[Union[APIKeyResponseIncludedItem, User, LeakedKey]], UnsetType] = unset,
**kwargs,
):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ def _composed_schemas(_):
# classes don't exist yet because their module has not finished
# loading
from datadog_api_client.v2.model.user import User
from datadog_api_client.v2.model.leaked_key import LeakedKey

return {
"oneOf": [
User,
LeakedKey,
],
}
25 changes: 24 additions & 1 deletion src/datadog_api_client/v2/model/api_key_update_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,54 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
unset,
UnsetType,
)


class APIKeyUpdateAttributes(ModelNormal):
@cached_property
def openapi_types(_):
return {
"category": (str,),
"name": (str,),
"remote_config_read_enabled": (bool,),
}

attribute_map = {
"category": "category",
"name": "name",
"remote_config_read_enabled": "remote_config_read_enabled",
}

def __init__(self_, name: str, **kwargs):
def __init__(
self_,
name: str,
category: Union[str, UnsetType] = unset,
remote_config_read_enabled: Union[bool, UnsetType] = unset,
**kwargs,
):
"""
Attributes used to update an API Key.
:param category: The APIKeyUpdateAttributes category.
:type category: str, optional
:param name: Name of the API key.
:type name: str
:param remote_config_read_enabled: The APIKeyUpdateAttributes remote_config_read_enabled.
:type remote_config_read_enabled: bool, optional
"""
if category is not unset:
kwargs["category"] = category
if remote_config_read_enabled is not unset:
kwargs["remote_config_read_enabled"] = remote_config_read_enabled
super().__init__(kwargs)

self_.name = name
3 changes: 2 additions & 1 deletion src/datadog_api_client/v2/model/api_keys_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from datadog_api_client.v2.model.api_key_response_included_item import APIKeyResponseIncludedItem
from datadog_api_client.v2.model.api_keys_response_meta import APIKeysResponseMeta
from datadog_api_client.v2.model.user import User
from datadog_api_client.v2.model.leaked_key import LeakedKey


class APIKeysResponse(ModelNormal):
Expand All @@ -42,7 +43,7 @@ def openapi_types(_):
def __init__(
self_,
data: Union[List[PartialAPIKey], UnsetType] = unset,
included: Union[List[Union[APIKeyResponseIncludedItem, User]], UnsetType] = unset,
included: Union[List[Union[APIKeyResponseIncludedItem, User, LeakedKey]], UnsetType] = unset,
meta: Union[APIKeysResponseMeta, UnsetType] = unset,
**kwargs,
):
Expand Down
3 changes: 2 additions & 1 deletion src/datadog_api_client/v2/model/application_key_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from datadog_api_client.v2.model.application_key_response_included_item import ApplicationKeyResponseIncludedItem
from datadog_api_client.v2.model.user import User
from datadog_api_client.v2.model.role import Role
from datadog_api_client.v2.model.leaked_key import LeakedKey


class ApplicationKeyResponse(ModelNormal):
Expand All @@ -41,7 +42,7 @@ def openapi_types(_):
def __init__(
self_,
data: Union[FullApplicationKey, UnsetType] = unset,
included: Union[List[Union[ApplicationKeyResponseIncludedItem, User, Role]], UnsetType] = unset,
included: Union[List[Union[ApplicationKeyResponseIncludedItem, User, Role, LeakedKey]], UnsetType] = unset,
**kwargs,
):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ def _composed_schemas(_):
# loading
from datadog_api_client.v2.model.user import User
from datadog_api_client.v2.model.role import Role
from datadog_api_client.v2.model.leaked_key import LeakedKey

return {
"oneOf": [
User,
Role,
LeakedKey,
],
}
13 changes: 7 additions & 6 deletions src/datadog_api_client/v2/model/full_api_key_attributes.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,
datetime,
unset,
UnsetType,
)
Expand All @@ -25,10 +26,10 @@ class FullAPIKeyAttributes(ModelNormal):
def openapi_types(_):
return {
"category": (str,),
"created_at": (str,),
"created_at": (datetime,),
"key": (str,),
"last4": (str,),
"modified_at": (str,),
"modified_at": (datetime,),
"name": (str,),
"remote_config_read_enabled": (bool,),
}
Expand All @@ -52,10 +53,10 @@ def openapi_types(_):
def __init__(
self_,
category: Union[str, UnsetType] = unset,
created_at: Union[str, UnsetType] = unset,
created_at: Union[datetime, UnsetType] = unset,
key: Union[str, UnsetType] = unset,
last4: Union[str, UnsetType] = unset,
modified_at: Union[str, UnsetType] = unset,
modified_at: Union[datetime, UnsetType] = unset,
name: Union[str, UnsetType] = unset,
remote_config_read_enabled: Union[bool, UnsetType] = unset,
**kwargs,
Expand All @@ -67,7 +68,7 @@ def __init__(
:type category: str, optional
:param created_at: Creation date of the API key.
:type created_at: str, optional
:type created_at: datetime, optional
:param key: The API key.
:type key: str, optional
Expand All @@ -76,7 +77,7 @@ def __init__(
:type last4: str, optional
:param modified_at: Date the API key was last modified.
:type modified_at: str, optional
:type modified_at: datetime, optional
:param name: Name of the API key.
:type name: str, optional
Expand Down
Loading

0 comments on commit ad4a270

Please sign in to comment.