Skip to content

Commit f9e87a2

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 25d711e of spec repo
1 parent f300097 commit f9e87a2

File tree

7 files changed

+244
-4
lines changed

7 files changed

+244
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.4.1.dev8",
7-
"regenerated": "2021-06-30 10:01:20.266133",
8-
"spec_repo_commit": "d33e517"
7+
"regenerated": "2021-06-30 14:37:44.195999",
8+
"spec_repo_commit": "25d711e"
99
},
1010
"v2": {
1111
"apigentools_version": "1.4.1.dev8",
12-
"regenerated": "2021-06-30 10:01:43.040834",
13-
"spec_repo_commit": "d33e517"
12+
"regenerated": "2021-06-30 14:38:10.050394",
13+
"spec_repo_commit": "25d711e"
1414
}
1515
}
1616
}

docs/v2/KeyManagementApi.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Method | HTTP request | Description
1010
[**delete_application_key**](KeyManagementApi.md#delete_application_key) | **DELETE** /api/v2/application_keys/{app_key_id} | Delete an application key
1111
[**delete_current_user_application_key**](KeyManagementApi.md#delete_current_user_application_key) | **DELETE** /api/v2/current_user/application_keys/{app_key_id} | Delete an application key owned by current user
1212
[**get_api_key**](KeyManagementApi.md#get_api_key) | **GET** /api/v2/api_keys/{api_key_id} | Get API key
13+
[**get_application_key**](KeyManagementApi.md#get_application_key) | **GET** /api/v2/application_keys/{app_key_id} | Get an application key
1314
[**get_current_user_application_key**](KeyManagementApi.md#get_current_user_application_key) | **GET** /api/v2/current_user/application_keys/{app_key_id} | Get one application key owned by current user
1415
[**list_api_keys**](KeyManagementApi.md#list_api_keys) | **GET** /api/v2/api_keys | Get all API keys
1516
[**list_application_keys**](KeyManagementApi.md#list_application_keys) | **GET** /api/v2/application_keys | Get all application keys
@@ -425,6 +426,82 @@ Name | Type | Description | Notes
425426

426427
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
427428

429+
# **get_application_key**
430+
> ApplicationKeyResponse get_application_key(app_key_id)
431+
432+
Get an application key for your org.
433+
434+
### Example
435+
436+
* Api Key Authentication (apiKeyAuth):
437+
* Api Key Authentication (appKeyAuth):
438+
```python
439+
import os
440+
from dateutil.parser import parse as dateutil_parser
441+
from datadog_api_client.v2 import ApiClient, ApiException, Configuration
442+
from datadog_api_client.v2.api import key_management_api
443+
from datadog_api_client.v2.models import *
444+
from pprint import pprint
445+
# See configuration.py for a list of all supported configuration parameters.
446+
configuration = Configuration()
447+
448+
# Enter a context with an instance of the API client
449+
with ApiClient(configuration) as api_client:
450+
# Create an instance of the API class
451+
api_instance = key_management_api.KeyManagementApi(api_client)
452+
app_key_id = "app_key_id_example" # str | The ID of the application key.
453+
include = "owned_by" # str | Resource path for related resources to include in the response. Only `owned_by` is supported. (optional)
454+
455+
# example passing only required values which don't have defaults set
456+
try:
457+
# Get an application key
458+
api_response = api_instance.get_application_key(app_key_id)
459+
pprint(api_response)
460+
except ApiException as e:
461+
print("Exception when calling KeyManagementApi->get_application_key: %s\n" % e)
462+
463+
# example passing only required values which don't have defaults set
464+
# and optional values
465+
try:
466+
# Get an application key
467+
api_response = api_instance.get_application_key(app_key_id, include=include)
468+
pprint(api_response)
469+
except ApiException as e:
470+
print("Exception when calling KeyManagementApi->get_application_key: %s\n" % e)
471+
```
472+
473+
474+
### Parameters
475+
476+
Name | Type | Description | Notes
477+
------------- | ------------- | ------------- | -------------
478+
**app_key_id** | **str**| The ID of the application key. |
479+
**include** | **str**| Resource path for related resources to include in the response. Only `owned_by` is supported. | [optional]
480+
481+
### Return type
482+
483+
[**ApplicationKeyResponse**](ApplicationKeyResponse.md)
484+
485+
### Authorization
486+
487+
[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth)
488+
489+
### HTTP request headers
490+
491+
- **Content-Type**: Not defined
492+
- **Accept**: application/json
493+
494+
495+
### HTTP response details
496+
| Status code | Description | Response headers |
497+
|-------------|-------------|------------------|
498+
**200** | OK | - |
499+
**400** | Bad Request | - |
500+
**403** | Forbidden | - |
501+
**404** | Not Found | - |
502+
503+
[[Back to top]](#) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to Model list]](README.md#documentation-for-models) [[Back to README]](README.md)
504+
428505
# **get_current_user_application_key**
429506
> ApplicationKeyResponse get_current_user_application_key(app_key_id)
430507

docs/v2/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Class | Method | HTTP request | Description
116116
*KeyManagementApi* | [**delete_application_key**](KeyManagementApi.md#delete_application_key) | **DELETE** /api/v2/application_keys/{app_key_id} | Delete an application key
117117
*KeyManagementApi* | [**delete_current_user_application_key**](KeyManagementApi.md#delete_current_user_application_key) | **DELETE** /api/v2/current_user/application_keys/{app_key_id} | Delete an application key owned by current user
118118
*KeyManagementApi* | [**get_api_key**](KeyManagementApi.md#get_api_key) | **GET** /api/v2/api_keys/{api_key_id} | Get API key
119+
*KeyManagementApi* | [**get_application_key**](KeyManagementApi.md#get_application_key) | **GET** /api/v2/application_keys/{app_key_id} | Get an application key
119120
*KeyManagementApi* | [**get_current_user_application_key**](KeyManagementApi.md#get_current_user_application_key) | **GET** /api/v2/current_user/application_keys/{app_key_id} | Get one application key owned by current user
120121
*KeyManagementApi* | [**list_api_keys**](KeyManagementApi.md#list_api_keys) | **GET** /api/v2/api_keys | Get all API keys
121122
*KeyManagementApi* | [**list_application_keys**](KeyManagementApi.md#list_application_keys) | **GET** /api/v2/application_keys | Get all application keys

src/datadog_api_client/v2/api/key_management_api.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,51 @@ def __init__(self, api_client=None):
281281
api_client=api_client,
282282
)
283283

284+
self._get_application_key_endpoint = _Endpoint(
285+
settings={
286+
"response_type": (ApplicationKeyResponse,),
287+
"auth": ["apiKeyAuth", "appKeyAuth"],
288+
"endpoint_path": "/api/v2/application_keys/{app_key_id}",
289+
"operation_id": "get_application_key",
290+
"http_method": "GET",
291+
"servers": None,
292+
},
293+
params_map={
294+
"all": [
295+
"app_key_id",
296+
"include",
297+
],
298+
"required": [
299+
"app_key_id",
300+
],
301+
"nullable": [],
302+
"enum": [],
303+
"validation": [],
304+
},
305+
root_map={
306+
"validations": {},
307+
"allowed_values": {},
308+
"openapi_types": {
309+
"app_key_id": (str,),
310+
"include": (str,),
311+
},
312+
"attribute_map": {
313+
"app_key_id": "app_key_id",
314+
"include": "include",
315+
},
316+
"location_map": {
317+
"app_key_id": "path",
318+
"include": "query",
319+
},
320+
"collection_format_map": {},
321+
},
322+
headers_map={
323+
"accept": ["application/json"],
324+
"content_type": [],
325+
},
326+
api_client=api_client,
327+
)
328+
284329
self._get_current_user_application_key_endpoint = _Endpoint(
285330
settings={
286331
"response_type": (ApplicationKeyResponse,),
@@ -896,6 +941,50 @@ def get_api_key(self, api_key_id, **kwargs):
896941
kwargs["api_key_id"] = api_key_id
897942
return self._get_api_key_endpoint.call_with_http_info(**kwargs)
898943

944+
def get_application_key(self, app_key_id, **kwargs):
945+
"""Get an application key # noqa: E501
946+
947+
Get an application key for your org. # noqa: E501
948+
This method makes a synchronous HTTP request by default. To make an
949+
asynchronous HTTP request, please pass async_req=True
950+
951+
>>> thread = api.get_application_key(app_key_id, async_req=True)
952+
>>> result = thread.get()
953+
954+
Args:
955+
app_key_id (str): The ID of the application key.
956+
957+
Keyword Args:
958+
include (str): Resource path for related resources to include in the response. Only `owned_by` is supported.. [optional]
959+
_return_http_data_only (bool): response data without head status
960+
code and headers. Default is True.
961+
_preload_content (bool): if False, the urllib3.HTTPResponse object
962+
will be returned without reading/decoding response data.
963+
Default is True.
964+
_request_timeout (float/tuple): timeout setting for this request. If one
965+
number provided, it will be total request timeout. It can also
966+
be a pair (tuple) of (connection, read) timeouts.
967+
Default is None.
968+
_check_input_type (bool): specifies if type checking
969+
should be done one the data sent to the server.
970+
Default is True.
971+
_check_return_type (bool): specifies if type checking
972+
should be done one the data received from the server.
973+
Default is True.
974+
_host_index (int/None): specifies the index of the server
975+
that we want to use.
976+
Default is read from the configuration.
977+
async_req (bool): execute request asynchronously
978+
979+
Returns:
980+
ApplicationKeyResponse
981+
If the method is called asynchronously, returns the request
982+
thread.
983+
"""
984+
kwargs = self._get_application_key_endpoint.default_arguments(kwargs)
985+
kwargs["app_key_id"] = app_key_id
986+
return self._get_application_key_endpoint.call_with_http_info(**kwargs)
987+
899988
def get_current_user_application_key(self, app_key_id, **kwargs):
900989
"""Get one application key owned by current user # noqa: E501
901990

src/datadog_api_client/v2/openapi.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ components:
102102
required: true
103103
schema:
104104
type: string
105+
ApplicationKeyIncludeParameter:
106+
description: Resource path for related resources to include in the response.
107+
Only `owned_by` is supported.
108+
in: query
109+
name: include
110+
required: false
111+
schema:
112+
example: owned_by
113+
type: string
105114
ApplicationKeysSortParameter:
106115
description: 'Application key attribute used to sort results. Sort order is
107116
ascending
@@ -5307,6 +5316,42 @@ paths:
53075316
x-codegen-request-body-name: body
53085317
x-undo:
53095318
type: idempotent
5319+
get:
5320+
description: Get an application key for your org.
5321+
operationId: GetApplicationKey
5322+
parameters:
5323+
- $ref: '#/components/parameters/ApplicationKeyId'
5324+
- $ref: '#/components/parameters/ApplicationKeyIncludeParameter'
5325+
responses:
5326+
'200':
5327+
content:
5328+
application/json:
5329+
schema:
5330+
$ref: '#/components/schemas/ApplicationKeyResponse'
5331+
description: OK
5332+
'400':
5333+
content:
5334+
application/json:
5335+
schema:
5336+
$ref: '#/components/schemas/APIErrorResponse'
5337+
description: Bad Request
5338+
'403':
5339+
content:
5340+
application/json:
5341+
schema:
5342+
$ref: '#/components/schemas/APIErrorResponse'
5343+
description: Forbidden
5344+
'404':
5345+
content:
5346+
application/json:
5347+
schema:
5348+
$ref: '#/components/schemas/APIErrorResponse'
5349+
description: Not Found
5350+
summary: Get an application key
5351+
tags:
5352+
- Key Management
5353+
x-undo:
5354+
type: safe
53105355
patch:
53115356
description: Edit an application key
53125357
operationId: UpdateApplicationKey

tests/v2/features/key_management.feature

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,28 @@ Feature: Key Management
260260
When the request is sent
261261
Then the response status is 200 OK
262262

263+
@generated @skip
264+
Scenario: Get an application key returns "Bad Request" response
265+
Given new "GetApplicationKey" request
266+
And request contains "app_key_id" parameter from "<PATH>"
267+
When the request is sent
268+
Then the response status is 400 Bad Request
269+
270+
@generated @skip
271+
Scenario: Get an application key returns "Not Found" response
272+
Given new "GetApplicationKey" request
273+
And request contains "app_key_id" parameter from "<PATH>"
274+
When the request is sent
275+
Then the response status is 404 Not Found
276+
277+
@integration-only
278+
Scenario: Get an application key returns "OK" response
279+
Given there is a valid "application_key" in the system
280+
And new "GetApplicationKey" request
281+
And request contains "app_key_id" parameter from "application_key.data.id"
282+
When the request is sent
283+
Then the response status is 200 OK
284+
263285
@integration-only
264286
Scenario: Get one Application key owned by current user returns "OK" response
265287
Given there is a valid "application_key" in the system

tests/v2/features/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
"type": "idempotent"
4949
}
5050
},
51+
"GetApplicationKey": {
52+
"tag": "Key Management",
53+
"undo": {
54+
"type": "safe"
55+
}
56+
},
5157
"UpdateApplicationKey": {
5258
"tag": "Key Management",
5359
"undo": {

0 commit comments

Comments
 (0)