From e64efcf965d49bfd51f0f057344e06ef525350d9 Mon Sep 17 00:00:00 2001 From: wf-jenkins Date: Wed, 8 May 2024 08:16:20 -0700 Subject: [PATCH] Autogenerated Update v2.222.2. --- .swagger-codegen/config.json | 2 +- .swagger-codegen/config.jsone | 2 +- README.md | 3 +- docs/AlertApi.md | 57 ++++++++++++++++ setup.py | 2 +- wavefront_api_client/api/alert_api.py | 95 +++++++++++++++++++++++++++ wavefront_api_client/api_client.py | 2 +- wavefront_api_client/configuration.py | 2 +- 8 files changed, 159 insertions(+), 6 deletions(-) diff --git a/.swagger-codegen/config.json b/.swagger-codegen/config.json index be9cc73..7a7ebc7 100644 --- a/.swagger-codegen/config.json +++ b/.swagger-codegen/config.json @@ -3,5 +3,5 @@ "gitUserId": "wavefrontHQ", "packageName": "wavefront_api_client", "packageUrl": "https://github.com/wavefrontHQ/python-client", - "packageVersion": "2.220.3" + "packageVersion": "2.222.2" } diff --git a/.swagger-codegen/config.jsone b/.swagger-codegen/config.jsone index 2891ac8..be9cc73 100644 --- a/.swagger-codegen/config.jsone +++ b/.swagger-codegen/config.jsone @@ -3,5 +3,5 @@ "gitUserId": "wavefrontHQ", "packageName": "wavefront_api_client", "packageUrl": "https://github.com/wavefrontHQ/python-client", - "packageVersion": "2.219.6" + "packageVersion": "2.220.3" } diff --git a/README.md b/README.md index 4d571b5..3f461c2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: v2 -- Package version: 2.220.3 +- Package version: 2.222.2 - Build package: io.swagger.codegen.languages.PythonClientCodegen ## Requirements. @@ -116,6 +116,7 @@ Class | Method | HTTP request | Description *AlertApi* | [**get_alert_tags**](docs/AlertApi.md#get_alert_tags) | **GET** /api/v2/alert/{id}/tag | Get all tags associated with a specific alert *AlertApi* | [**get_alert_version**](docs/AlertApi.md#get_alert_version) | **GET** /api/v2/alert/{id}/history/{version} | Get a specific historical version of a specific alert *AlertApi* | [**get_alerts_summary**](docs/AlertApi.md#get_alerts_summary) | **GET** /api/v2/alert/summary | Count alerts of various statuses for a customer +*AlertApi* | [**get_alerts_with_pagination**](docs/AlertApi.md#get_alerts_with_pagination) | **GET** /api/v2/alert/paginated | Get all alerts for a customer with pagination *AlertApi* | [**get_all_alert**](docs/AlertApi.md#get_all_alert) | **GET** /api/v2/alert | Get all alerts for a customer *AlertApi* | [**hide_alert**](docs/AlertApi.md#hide_alert) | **POST** /api/v2/alert/{id}/uninstall | Hide a specific integration alert *AlertApi* | [**preview_alert_notification**](docs/AlertApi.md#preview_alert_notification) | **POST** /api/v2/alert/preview | Get all the notification preview for a specific alert diff --git a/docs/AlertApi.md b/docs/AlertApi.md index b687e91..566dc76 100644 --- a/docs/AlertApi.md +++ b/docs/AlertApi.md @@ -16,6 +16,7 @@ Method | HTTP request | Description [**get_alert_tags**](AlertApi.md#get_alert_tags) | **GET** /api/v2/alert/{id}/tag | Get all tags associated with a specific alert [**get_alert_version**](AlertApi.md#get_alert_version) | **GET** /api/v2/alert/{id}/history/{version} | Get a specific historical version of a specific alert [**get_alerts_summary**](AlertApi.md#get_alerts_summary) | **GET** /api/v2/alert/summary | Count alerts of various statuses for a customer +[**get_alerts_with_pagination**](AlertApi.md#get_alerts_with_pagination) | **GET** /api/v2/alert/paginated | Get all alerts for a customer with pagination [**get_all_alert**](AlertApi.md#get_all_alert) | **GET** /api/v2/alert | Get all alerts for a customer [**hide_alert**](AlertApi.md#hide_alert) | **POST** /api/v2/alert/{id}/uninstall | Hide a specific integration alert [**preview_alert_notification**](AlertApi.md#preview_alert_notification) | **POST** /api/v2/alert/preview | Get all the notification preview for a specific alert @@ -689,6 +690,62 @@ This endpoint does not need any parameter. [[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) +# **get_alerts_with_pagination** +> ResponseContainerPagedAlert get_alerts_with_pagination(cursor=cursor, limit=limit) + +Get all alerts for a customer with pagination + + + +### Example +```python +from __future__ import print_function +import time +import wavefront_api_client +from wavefront_api_client.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_key +configuration = wavefront_api_client.Configuration() +configuration.api_key['X-AUTH-TOKEN'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-AUTH-TOKEN'] = 'Bearer' + +# create an instance of the API class +api_instance = wavefront_api_client.AlertApi(wavefront_api_client.ApiClient(configuration)) +cursor = 789 # int | (optional) +limit = 100 # int | (optional) (default to 100) + +try: + # Get all alerts for a customer with pagination + api_response = api_instance.get_alerts_with_pagination(cursor=cursor, limit=limit) + pprint(api_response) +except ApiException as e: + print("Exception when calling AlertApi->get_alerts_with_pagination: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **cursor** | **int**| | [optional] + **limit** | **int**| | [optional] [default to 100] + +### Return type + +[**ResponseContainerPagedAlert**](ResponseContainerPagedAlert.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + # **get_all_alert** > ResponseContainerPagedAlert get_all_alert(offset=offset, limit=limit) diff --git a/setup.py b/setup.py index c92c353..9130c6a 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "wavefront-api-client" -VERSION = "2.220.3" +VERSION = "2.222.2" # To install the library, run the following # # python setup.py install diff --git a/wavefront_api_client/api/alert_api.py b/wavefront_api_client/api/alert_api.py index ae3f3f0..41790af 100644 --- a/wavefront_api_client/api/alert_api.py +++ b/wavefront_api_client/api/alert_api.py @@ -1210,6 +1210,101 @@ def get_alerts_summary_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) + def get_alerts_with_pagination(self, **kwargs): # noqa: E501 + """Get all alerts for a customer with pagination # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_alerts_with_pagination(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int cursor: + :param int limit: + :return: ResponseContainerPagedAlert + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.get_alerts_with_pagination_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_alerts_with_pagination_with_http_info(**kwargs) # noqa: E501 + return data + + def get_alerts_with_pagination_with_http_info(self, **kwargs): # noqa: E501 + """Get all alerts for a customer with pagination # noqa: E501 + + # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_alerts_with_pagination_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int cursor: + :param int limit: + :return: ResponseContainerPagedAlert + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['cursor', 'limit'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_alerts_with_pagination" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'cursor' in params: + query_params.append(('cursor', params['cursor'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_key'] # noqa: E501 + + return self.api_client.call_api( + '/api/v2/alert/paginated', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ResponseContainerPagedAlert', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + def get_all_alert(self, **kwargs): # noqa: E501 """Get all alerts for a customer # noqa: E501 diff --git a/wavefront_api_client/api_client.py b/wavefront_api_client/api_client.py index 3b22933..6f4eb6b 100644 --- a/wavefront_api_client/api_client.py +++ b/wavefront_api_client/api_client.py @@ -74,7 +74,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/2.220.3/python' + self.user_agent = 'Swagger-Codegen/2.222.2/python' self.client_side_validation = configuration.client_side_validation def __del__(self): diff --git a/wavefront_api_client/configuration.py b/wavefront_api_client/configuration.py index 8a9c53a..44060d2 100644 --- a/wavefront_api_client/configuration.py +++ b/wavefront_api_client/configuration.py @@ -251,5 +251,5 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v2\n"\ - "SDK Package Version: 2.220.3".\ + "SDK Package Version: 2.222.2".\ format(env=sys.platform, pyversion=sys.version)