|
| 1 | +# coding: utf-8 |
| 2 | +from __future__ import absolute_import |
| 3 | + |
| 4 | +import re # noqa: F401 |
| 5 | + |
| 6 | +# python 2 and python 3 compatibility library |
| 7 | +import six |
| 8 | + |
| 9 | +from cloudtower.api_client import ApiClient |
| 10 | +from cloudtower.exceptions import ( # noqa: F401 |
| 11 | + ApiTypeError, |
| 12 | + ApiValueError |
| 13 | +) |
| 14 | + |
| 15 | + |
| 16 | +class InternalApi(object): |
| 17 | + """NOTE: This class is auto generated by OpenAPI Generator |
| 18 | + Ref: https://openapi-generator.tech |
| 19 | +
|
| 20 | + Do not edit the class manually. |
| 21 | + """ |
| 22 | + |
| 23 | + def __init__(self, api_client=None): |
| 24 | + if api_client is None: |
| 25 | + api_client = ApiClient() |
| 26 | + self.api_client = api_client |
| 27 | + |
| 28 | + def get_resource_changes(self, **kwargs): # noqa: E501 |
| 29 | + """get_resource_changes # noqa: E501 |
| 30 | +
|
| 31 | + This method makes a synchronous HTTP request by default. To make an |
| 32 | + asynchronous HTTP request, please pass async_req=True |
| 33 | +
|
| 34 | + >>> thread = api.get_resource_changes(async_req=True) |
| 35 | + >>> result = thread.get() |
| 36 | +
|
| 37 | + :param action: |
| 38 | + :type action: str |
| 39 | + :param resource_type: |
| 40 | + :type resource_type: str |
| 41 | + :param resource_id: |
| 42 | + :type resource_id: str |
| 43 | + :param start_revision: |
| 44 | + :type start_revision: str |
| 45 | + :param limit: |
| 46 | + :type limit: int |
| 47 | + :param async_req: Whether to execute the request asynchronously. |
| 48 | + :type async_req: bool, optional |
| 49 | + :param _preload_content: if False, the urllib3.HTTPResponse object will |
| 50 | + be returned without reading/decoding response |
| 51 | + data. Default is True. |
| 52 | + :type _preload_content: bool, optional |
| 53 | + :param _request_timeout: timeout setting for this request. If one |
| 54 | + number provided, it will be total request |
| 55 | + timeout. It can also be a pair (tuple) of |
| 56 | + (connection, read) timeouts. |
| 57 | + :return: Returns the result object. |
| 58 | + If the method is called asynchronously, |
| 59 | + returns the request thread. |
| 60 | + :rtype: ResourceChangeResponse |
| 61 | + """ |
| 62 | + kwargs['_return_http_data_only'] = True |
| 63 | + return self.get_resource_changes_with_http_info(**kwargs) # noqa: E501 |
| 64 | + |
| 65 | + def get_resource_changes_with_http_info(self, **kwargs): # noqa: E501 |
| 66 | + """get_resource_changes # noqa: E501 |
| 67 | +
|
| 68 | + This method makes a synchronous HTTP request by default. To make an |
| 69 | + asynchronous HTTP request, please pass async_req=True |
| 70 | +
|
| 71 | + >>> thread = api.get_resource_changes_with_http_info(async_req=True) |
| 72 | + >>> result = thread.get() |
| 73 | +
|
| 74 | + :param action: |
| 75 | + :type action: str |
| 76 | + :param resource_type: |
| 77 | + :type resource_type: str |
| 78 | + :param resource_id: |
| 79 | + :type resource_id: str |
| 80 | + :param start_revision: |
| 81 | + :type start_revision: str |
| 82 | + :param limit: |
| 83 | + :type limit: int |
| 84 | + :param async_req: Whether to execute the request asynchronously. |
| 85 | + :type async_req: bool, optional |
| 86 | + :param _return_http_data_only: response data without head status code |
| 87 | + and headers |
| 88 | + :type _return_http_data_only: bool, optional |
| 89 | + :param _preload_content: if False, the urllib3.HTTPResponse object will |
| 90 | + be returned without reading/decoding response |
| 91 | + data. Default is True. |
| 92 | + :type _preload_content: bool, optional |
| 93 | + :param _request_timeout: timeout setting for this request. If one |
| 94 | + number provided, it will be total request |
| 95 | + timeout. It can also be a pair (tuple) of |
| 96 | + (connection, read) timeouts. |
| 97 | + :param _request_auth: set to override the auth_settings for an a single |
| 98 | + request; this effectively ignores the authentication |
| 99 | + in the spec for a single request. |
| 100 | + :type _request_auth: dict, optional |
| 101 | + :type _content_type: string, optional: force content-type for the request |
| 102 | + :return: Returns the result object. |
| 103 | + If the method is called asynchronously, |
| 104 | + returns the request thread. |
| 105 | + :rtype: tuple(ResourceChangeResponse, status_code(int), headers(HTTPHeaderDict)) |
| 106 | + """ |
| 107 | + |
| 108 | + local_var_params = locals() |
| 109 | + |
| 110 | + all_params = [ |
| 111 | + 'action', |
| 112 | + 'resource_type', |
| 113 | + 'resource_id', |
| 114 | + 'start_revision', |
| 115 | + 'limit' |
| 116 | + ] |
| 117 | + all_params.extend( |
| 118 | + [ |
| 119 | + 'async_req', |
| 120 | + '_return_http_data_only', |
| 121 | + '_preload_content', |
| 122 | + '_request_timeout', |
| 123 | + '_request_auth', |
| 124 | + '_content_type', |
| 125 | + '_headers' |
| 126 | + ] |
| 127 | + ) |
| 128 | + |
| 129 | + for key, val in six.iteritems(local_var_params['kwargs']): |
| 130 | + if key not in all_params: |
| 131 | + raise ApiTypeError( |
| 132 | + "Got an unexpected keyword argument '%s'" |
| 133 | + " to method get_resource_changes" % key |
| 134 | + ) |
| 135 | + local_var_params[key] = val |
| 136 | + del local_var_params['kwargs'] |
| 137 | + |
| 138 | + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501 |
| 139 | + raise ApiValueError("Invalid value for parameter `limit` when calling `get_resource_changes`, must be a value less than or equal to `1000`") # noqa: E501 |
| 140 | + if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501 |
| 141 | + raise ApiValueError("Invalid value for parameter `limit` when calling `get_resource_changes`, must be a value greater than or equal to `1`") # noqa: E501 |
| 142 | + collection_formats = {} |
| 143 | + |
| 144 | + path_params = {} |
| 145 | + |
| 146 | + query_params = [] |
| 147 | + if 'action' in local_var_params and local_var_params['action'] is not None: # noqa: E501 |
| 148 | + query_params.append(('action', local_var_params['action'])) # noqa: E501 |
| 149 | + if 'resource_type' in local_var_params and local_var_params['resource_type'] is not None: # noqa: E501 |
| 150 | + query_params.append(('resource_type', local_var_params['resource_type'])) # noqa: E501 |
| 151 | + if 'resource_id' in local_var_params and local_var_params['resource_id'] is not None: # noqa: E501 |
| 152 | + query_params.append(('resource_id', local_var_params['resource_id'])) # noqa: E501 |
| 153 | + if 'start_revision' in local_var_params and local_var_params['start_revision'] is not None: # noqa: E501 |
| 154 | + query_params.append(('start_revision', local_var_params['start_revision'])) # noqa: E501 |
| 155 | + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 |
| 156 | + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 |
| 157 | + |
| 158 | + header_params = dict(local_var_params.get('_headers', {})) |
| 159 | + |
| 160 | + form_params = [] |
| 161 | + local_var_files = {} |
| 162 | + |
| 163 | + body_params = None |
| 164 | + # HTTP header `Accept` |
| 165 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 166 | + ['application/json']) # noqa: E501 |
| 167 | + |
| 168 | + # Authentication setting |
| 169 | + auth_settings = ['Basic'] # noqa: E501 |
| 170 | + |
| 171 | + response_types_map = { |
| 172 | + 200: "ResourceChangeResponse", |
| 173 | + 400: "ErrorBody", |
| 174 | + 404: "ErrorBody", |
| 175 | + 500: "ErrorBody", |
| 176 | + } |
| 177 | + |
| 178 | + return self.api_client.call_api( |
| 179 | + '/resource-changes', 'GET', |
| 180 | + path_params, |
| 181 | + query_params, |
| 182 | + header_params, |
| 183 | + body=body_params, |
| 184 | + post_params=form_params, |
| 185 | + files=local_var_files, |
| 186 | + response_types_map=response_types_map, |
| 187 | + auth_settings=auth_settings, |
| 188 | + async_req=local_var_params.get('async_req'), |
| 189 | + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 |
| 190 | + _preload_content=local_var_params.get('_preload_content', True), |
| 191 | + _request_timeout=local_var_params.get('_request_timeout'), |
| 192 | + collection_formats=collection_formats, |
| 193 | + _request_auth=local_var_params.get('_request_auth')) |
0 commit comments