Skip to content

Commit

Permalink
Regenerate client from commit 2a54e42 of spec repo (#459)
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 authored May 28, 2021
1 parent 9c045d5 commit 0c71f30
Show file tree
Hide file tree
Showing 10 changed files with 369 additions and 13 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.4.1.dev8",
"regenerated": "2021-05-27 15:02:08.337074",
"spec_repo_commit": "5311d4c"
"regenerated": "2021-05-28 09:09:08.991765",
"spec_repo_commit": "2a54e42"
},
"v2": {
"apigentools_version": "1.4.1.dev8",
"regenerated": "2021-05-27 15:02:36.422686",
"spec_repo_commit": "5311d4c"
"regenerated": "2021-05-28 09:09:36.666979",
"spec_repo_commit": "2a54e42"
}
}
}
2 changes: 2 additions & 0 deletions docs/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ Class | Method | HTTP request | Description
*SyntheticsApi* | [**get_global_variable**](SyntheticsApi.md#get_global_variable) | **GET** /api/v1/synthetics/variables/{variable_id} | Get a global variable
*SyntheticsApi* | [**get_private_location**](SyntheticsApi.md#get_private_location) | **GET** /api/v1/synthetics/private-locations/{location_id} | Get a private location
*SyntheticsApi* | [**get_test**](SyntheticsApi.md#get_test) | **GET** /api/v1/synthetics/tests/{public_id} | Get a test configuration
*SyntheticsApi* | [**list_global_variables**](SyntheticsApi.md#list_global_variables) | **GET** /api/v1/synthetics/variables | Get all global variables
*SyntheticsApi* | [**list_locations**](SyntheticsApi.md#list_locations) | **GET** /api/v1/synthetics/locations | Get all locations (public and private)
*SyntheticsApi* | [**list_tests**](SyntheticsApi.md#list_tests) | **GET** /api/v1/synthetics/tests | Get the list of all tests
*SyntheticsApi* | [**trigger_ci_tests**](SyntheticsApi.md#trigger_ci_tests) | **POST** /api/v1/synthetics/tests/trigger/ci | Trigger tests from CI/CD pipelines
Expand Down Expand Up @@ -691,6 +692,7 @@ Class | Method | HTTP request | Description
- [SyntheticsGlobalVariableParseTestOptionsType](SyntheticsGlobalVariableParseTestOptionsType.md)
- [SyntheticsGlobalVariableParserType](SyntheticsGlobalVariableParserType.md)
- [SyntheticsGlobalVariableValue](SyntheticsGlobalVariableValue.md)
- [SyntheticsListGlobalVariablesResponse](SyntheticsListGlobalVariablesResponse.md)
- [SyntheticsListTestsResponse](SyntheticsListTestsResponse.md)
- [SyntheticsLocation](SyntheticsLocation.md)
- [SyntheticsLocations](SyntheticsLocations.md)
Expand Down
62 changes: 62 additions & 0 deletions docs/v1/SyntheticsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Method | HTTP request | Description
[**get_global_variable**](SyntheticsApi.md#get_global_variable) | **GET** /api/v1/synthetics/variables/{variable_id} | Get a global variable
[**get_private_location**](SyntheticsApi.md#get_private_location) | **GET** /api/v1/synthetics/private-locations/{location_id} | Get a private location
[**get_test**](SyntheticsApi.md#get_test) | **GET** /api/v1/synthetics/tests/{public_id} | Get a test configuration
[**list_global_variables**](SyntheticsApi.md#list_global_variables) | **GET** /api/v1/synthetics/variables | Get all global variables
[**list_locations**](SyntheticsApi.md#list_locations) | **GET** /api/v1/synthetics/locations | Get all locations (public and private)
[**list_tests**](SyntheticsApi.md#list_tests) | **GET** /api/v1/synthetics/tests | Get the list of all tests
[**trigger_ci_tests**](SyntheticsApi.md#trigger_ci_tests) | **POST** /api/v1/synthetics/tests/trigger/ci | Trigger tests from CI/CD pipelines
Expand Down Expand Up @@ -1466,6 +1467,67 @@ Name | Type | Description | Notes

[[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)

# **list_global_variables**
> SyntheticsListGlobalVariablesResponse list_global_variables()
Get all global variables

Get the list of all Synthetics global variables.

### Example

* Api Key Authentication (apiKeyAuth):
* Api Key Authentication (appKeyAuth):
```python
import os
from dateutil.parser import parse as dateutil_parser
from datadog_api_client.v1 import ApiClient, ApiException, Configuration
from datadog_api_client.v1.api import synthetics_api
from datadog_api_client.v1.models import *
from pprint import pprint
# See configuration.py for a list of all supported configuration parameters.
configuration = Configuration()

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = synthetics_api.SyntheticsApi(api_client)

# example, this endpoint has no required or optional parameters
try:
# Get all global variables
api_response = api_instance.list_global_variables()
pprint(api_response)
except ApiException as e:
print("Exception when calling SyntheticsApi->list_global_variables: %s\n" % e)
```


### Parameters
This endpoint does not need any parameter.

### Return type

[**SyntheticsListGlobalVariablesResponse**](SyntheticsListGlobalVariablesResponse.md)

### Authorization

[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | - |
**403** | Forbidden | - |

[[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)

# **list_locations**
> SyntheticsLocations list_locations()
Expand Down
12 changes: 12 additions & 0 deletions docs/v1/SyntheticsListGlobalVariablesResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SyntheticsListGlobalVariablesResponse

Object containing an array of Synthetic global variables.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**variables** | [**[SyntheticsGlobalVariable]**](SyntheticsGlobalVariable.md) | Array of Synthetic global variables. | [optional]

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


66 changes: 66 additions & 0 deletions src/datadog_api_client/v1/api/synthetics_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
SyntheticsGetBrowserTestLatestResultsResponse,
)
from datadog_api_client.v1.model.synthetics_global_variable import SyntheticsGlobalVariable
from datadog_api_client.v1.model.synthetics_list_global_variables_response import SyntheticsListGlobalVariablesResponse
from datadog_api_client.v1.model.synthetics_list_tests_response import SyntheticsListTestsResponse
from datadog_api_client.v1.model.synthetics_locations import SyntheticsLocations
from datadog_api_client.v1.model.synthetics_private_location import SyntheticsPrivateLocation
Expand Down Expand Up @@ -767,6 +768,31 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._list_global_variables_endpoint = _Endpoint(
settings={
"response_type": (SyntheticsListGlobalVariablesResponse,),
"auth": ["apiKeyAuth", "appKeyAuth"],
"endpoint_path": "/api/v1/synthetics/variables",
"operation_id": "list_global_variables",
"http_method": "GET",
"servers": None,
},
params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
root_map={
"validations": {},
"allowed_values": {},
"openapi_types": {},
"attribute_map": {},
"location_map": {},
"collection_format_map": {},
},
headers_map={
"accept": ["application/json"],
"content_type": [],
},
api_client=api_client,
)

self._list_locations_endpoint = _Endpoint(
settings={
"response_type": (SyntheticsLocations,),
Expand Down Expand Up @@ -1764,6 +1790,46 @@ def get_test(self, public_id, **kwargs):
kwargs["public_id"] = public_id
return self._get_test_endpoint.call_with_http_info(**kwargs)

def list_global_variables(self, **kwargs):
"""Get all global variables # noqa: E501
Get the list of all Synthetics global variables. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_global_variables(async_req=True)
>>> result = thread.get()
Keyword Args:
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
will be returned without reading/decoding response data.
Default is True.
_request_timeout (float/tuple): timeout setting for this request. If one
number provided, it will be total request timeout. It can also
be a pair (tuple) of (connection, read) timeouts.
Default is None.
_check_input_type (bool): specifies if type checking
should be done one the data sent to the server.
Default is True.
_check_return_type (bool): specifies if type checking
should be done one the data received from the server.
Default is True.
_host_index (int/None): specifies the index of the server
that we want to use.
Default is read from the configuration.
async_req (bool): execute request asynchronously
Returns:
SyntheticsListGlobalVariablesResponse
If the method is called asynchronously, returns the request
thread.
"""
kwargs = self._list_global_variables_endpoint.default_arguments(kwargs)
return self._list_global_variables_endpoint.call_with_http_info(**kwargs)

def list_locations(self, **kwargs):
"""Get all locations (public and private) # noqa: E501
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.


import re # noqa: F401
import sys # noqa: F401

from datadog_api_client.v1.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)


def lazy_import():
from datadog_api_client.v1.model.synthetics_global_variable import SyntheticsGlobalVariable

globals()["SyntheticsGlobalVariable"] = SyntheticsGlobalVariable


class SyntheticsListGlobalVariablesResponse(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually.
Attributes:
allowed_values (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
with a capitalized key describing the allowed value and an allowed
value. These dicts store the allowed enum values.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
discriminator_value_class_map (dict): A dict to go from the discriminator
variable value to the discriminator class name.
validations (dict): The key is the tuple path to the attribute
and the for var_name this is (var_name,). The value is a dict
that stores validations for max_length, min_length, max_items,
min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
inclusive_minimum, and regex.
additional_properties_type (tuple): A tuple of classes accepted
as additional properties values.
"""

allowed_values = {}

validations = {}

additional_properties_type = None

_nullable = False

@cached_property
def openapi_types():
"""
This must be a method because a model may have properties that are
of type self, this must run after the class is loaded
Returns
openapi_types (dict): The key is attribute name
and the value is attribute type.
"""
lazy_import()
return {
"variables": ([SyntheticsGlobalVariable],), # noqa: E501
}

@cached_property
def discriminator():
return None

attribute_map = {
"variables": "variables", # noqa: E501
}

_composed_schemas = {}

required_properties = set(
[
"_data_store",
"_check_type",
"_spec_property_naming",
"_path_to_item",
"_configuration",
"_visited_composed_classes",
]
)

@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""SyntheticsListGlobalVariablesResponse - a model defined in OpenAPI
Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
will be type checked and a TypeError will be
raised if the wrong type is input.
Defaults to True
_path_to_item (tuple/list): This is a list of keys or values to
drill down to the model in received_data
when deserializing a response
_spec_property_naming (bool): True if the variable names in the input data
are serialized names, as specified in the OpenAPI document.
False if the variable names in the input data
are pythonic names, e.g. snake case (default)
_configuration (Configuration): the instance to use when
deserializing a file_type parameter.
If passed, type conversion is attempted
If omitted no type conversion is done.
_visited_composed_classes (tuple): This stores a tuple of
classes that we have traveled through so that
if we see that class again we will not use its
discriminator again.
When traveling through a discriminator, the
composed schema that is
is traveled through is added to this set.
For example if Animal has a discriminator
petType and we pass in "Dog", and the class Dog
allOf includes Animal, we move through Animal
once using the discriminator, and pick Dog.
Then in Dog, we will make an instance of the
Animal class but this time we won't travel
through its discriminator because we passed in
_visited_composed_classes = (Animal,)
variables ([SyntheticsGlobalVariable]): Array of Synthetic global variables.. [optional] # noqa: E501
"""

_check_type = kwargs.pop("_check_type", True)
_spec_property_naming = kwargs.pop("_spec_property_naming", False)
_path_to_item = kwargs.pop("_path_to_item", ())
_configuration = kwargs.pop("_configuration", None)
_visited_composed_classes = kwargs.pop("_visited_composed_classes", ())

if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
% (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)

self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

for var_name, var_value in kwargs.items():
if (
var_name not in self.attribute_map
and self._configuration is not None
and self._configuration.discard_unknown_keys
and self.additional_properties_type is None
):
# discard variable.
continue
setattr(self, var_name, var_value)
1 change: 1 addition & 0 deletions src/datadog_api_client/v1/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@
)
from datadog_api_client.v1.model.synthetics_global_variable_parser_type import SyntheticsGlobalVariableParserType
from datadog_api_client.v1.model.synthetics_global_variable_value import SyntheticsGlobalVariableValue
from datadog_api_client.v1.model.synthetics_list_global_variables_response import SyntheticsListGlobalVariablesResponse
from datadog_api_client.v1.model.synthetics_list_tests_response import SyntheticsListTestsResponse
from datadog_api_client.v1.model.synthetics_location import SyntheticsLocation
from datadog_api_client.v1.model.synthetics_locations import SyntheticsLocations
Expand Down
Loading

0 comments on commit 0c71f30

Please sign in to comment.