|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Control-M Services |
| 5 | +
|
| 6 | + Provides access to BMC Control-M Services # noqa: E501 |
| 7 | +
|
| 8 | + The version of the OpenAPI document: 9.22.30 |
| 9 | + Contact: customer_support@bmc.com |
| 10 | + Generated by: https://openapi-generator.tech |
| 11 | +""" |
| 12 | + |
| 13 | + |
| 14 | +from __future__ import absolute_import |
| 15 | + |
| 16 | +import re # noqa: F401 |
| 17 | + |
| 18 | +# python 2 and python 3 compatibility library |
| 19 | +import six |
| 20 | + |
| 21 | +from clients.ctm_api_client.api_client import ApiClient |
| 22 | +from clients.ctm_api_client.exceptions import ( # noqa: F401 |
| 23 | + ApiTypeError, |
| 24 | + ApiValueError |
| 25 | +) |
| 26 | + |
| 27 | + |
| 28 | +class UsageApi(object): |
| 29 | + """NOTE: This class is auto generated by OpenAPI Generator |
| 30 | + Ref: https://openapi-generator.tech |
| 31 | +
|
| 32 | + Do not edit the class manually. |
| 33 | + """ |
| 34 | + |
| 35 | + def __init__(self, api_client=None): |
| 36 | + if api_client is None: |
| 37 | + api_client = ApiClient() |
| 38 | + self.api_client = api_client |
| 39 | + |
| 40 | + def get_usage_jobs(self, **kwargs): # noqa: E501 |
| 41 | + """Enables you to get a count of eligible jobs in the current (active) day from New Day onwards # noqa: E501 |
| 42 | +
|
| 43 | + Enables you to get a count of eligible jobs in the current (active) day from New Day onwards # noqa: E501 |
| 44 | + This method makes a synchronous HTTP request by default. To make an |
| 45 | + asynchronous HTTP request, please pass async_req=True |
| 46 | +
|
| 47 | + >>> thread = api.get_usage_jobs(async_req=True) |
| 48 | + >>> result = thread.get() |
| 49 | +
|
| 50 | + :param async_req: Whether to execute the request asynchronously. |
| 51 | + :type async_req: bool, optional |
| 52 | + :param _preload_content: if False, the urllib3.HTTPResponse object will |
| 53 | + be returned without reading/decoding response |
| 54 | + data. Default is True. |
| 55 | + :type _preload_content: bool, optional |
| 56 | + :param _request_timeout: timeout setting for this request. If one |
| 57 | + number provided, it will be total request |
| 58 | + timeout. It can also be a pair (tuple) of |
| 59 | + (connection, read) timeouts. |
| 60 | + :return: Returns the result object. |
| 61 | + If the method is called asynchronously, |
| 62 | + returns the request thread. |
| 63 | + :rtype: object |
| 64 | + """ |
| 65 | + kwargs['_return_http_data_only'] = True |
| 66 | + return self.get_usage_jobs_with_http_info(**kwargs) # noqa: E501 |
| 67 | + |
| 68 | + def get_usage_jobs_with_http_info(self, **kwargs): # noqa: E501 |
| 69 | + """Enables you to get a count of eligible jobs in the current (active) day from New Day onwards # noqa: E501 |
| 70 | +
|
| 71 | + Enables you to get a count of eligible jobs in the current (active) day from New Day onwards # noqa: E501 |
| 72 | + This method makes a synchronous HTTP request by default. To make an |
| 73 | + asynchronous HTTP request, please pass async_req=True |
| 74 | +
|
| 75 | + >>> thread = api.get_usage_jobs_with_http_info(async_req=True) |
| 76 | + >>> result = thread.get() |
| 77 | +
|
| 78 | + :param async_req: Whether to execute the request asynchronously. |
| 79 | + :type async_req: bool, optional |
| 80 | + :param _return_http_data_only: response data without head status code |
| 81 | + and headers |
| 82 | + :type _return_http_data_only: bool, optional |
| 83 | + :param _preload_content: if False, the urllib3.HTTPResponse object will |
| 84 | + be returned without reading/decoding response |
| 85 | + data. Default is True. |
| 86 | + :type _preload_content: bool, optional |
| 87 | + :param _request_timeout: timeout setting for this request. If one |
| 88 | + number provided, it will be total request |
| 89 | + timeout. It can also be a pair (tuple) of |
| 90 | + (connection, read) timeouts. |
| 91 | + :param _request_auth: set to override the auth_settings for an a single |
| 92 | + request; this effectively ignores the authentication |
| 93 | + in the spec for a single request. |
| 94 | + :type _request_auth: dict, optional |
| 95 | + :type _content_type: string, optional: force content-type for the request |
| 96 | + :return: Returns the result object. |
| 97 | + If the method is called asynchronously, |
| 98 | + returns the request thread. |
| 99 | + :rtype: tuple(object, status_code(int), headers(HTTPHeaderDict)) |
| 100 | + """ |
| 101 | + |
| 102 | + local_var_params = locals() |
| 103 | + |
| 104 | + all_params = [ |
| 105 | + ] |
| 106 | + all_params.extend( |
| 107 | + [ |
| 108 | + 'async_req', |
| 109 | + '_return_http_data_only', |
| 110 | + '_preload_content', |
| 111 | + '_request_timeout', |
| 112 | + '_request_auth', |
| 113 | + '_content_type', |
| 114 | + '_headers' |
| 115 | + ] |
| 116 | + ) |
| 117 | + |
| 118 | + for key, val in six.iteritems(local_var_params['kwargs']): |
| 119 | + if key not in all_params: |
| 120 | + raise ApiTypeError( |
| 121 | + "Got an unexpected keyword argument '%s'" |
| 122 | + " to method get_usage_jobs" % key |
| 123 | + ) |
| 124 | + local_var_params[key] = val |
| 125 | + del local_var_params['kwargs'] |
| 126 | + |
| 127 | + collection_formats = {} |
| 128 | + |
| 129 | + path_params = {} |
| 130 | + |
| 131 | + query_params = [] |
| 132 | + |
| 133 | + header_params = dict(local_var_params.get('_headers', {})) |
| 134 | + |
| 135 | + form_params = [] |
| 136 | + local_var_files = {} |
| 137 | + |
| 138 | + body_params = None |
| 139 | + # HTTP header `Accept` |
| 140 | + header_params['Accept'] = self.api_client.select_header_accept( |
| 141 | + ['application/json']) # noqa: E501 |
| 142 | + |
| 143 | + # Authentication setting |
| 144 | + auth_settings = ['ApiKeyAuth', 'Bearer'] # noqa: E501 |
| 145 | + |
| 146 | + response_types_map = { |
| 147 | + 200: "object", |
| 148 | + 403: "ErrorList", |
| 149 | + 500: "ErrorList", |
| 150 | + } |
| 151 | + |
| 152 | + return self.api_client.call_api( |
| 153 | + '/usage/jobs', 'GET', |
| 154 | + path_params, |
| 155 | + query_params, |
| 156 | + header_params, |
| 157 | + body=body_params, |
| 158 | + post_params=form_params, |
| 159 | + files=local_var_files, |
| 160 | + response_types_map=response_types_map, |
| 161 | + auth_settings=auth_settings, |
| 162 | + async_req=local_var_params.get('async_req'), |
| 163 | + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 |
| 164 | + _preload_content=local_var_params.get('_preload_content', True), |
| 165 | + _request_timeout=local_var_params.get('_request_timeout'), |
| 166 | + collection_formats=collection_formats, |
| 167 | + _request_auth=local_var_params.get('_request_auth')) |
0 commit comments