1
1
# coding: utf-8
2
2
"""
3
- Influx API Service
3
+ Influx API Service.
4
4
5
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
5
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
6
6
7
- OpenAPI spec version: 0.1.0
8
- Generated by: https://openapi-generator.tech
7
+ OpenAPI spec version: 0.1.0
8
+ Generated by: https://openapi-generator.tech
9
9
"""
10
10
11
11
from __future__ import absolute_import
28
28
29
29
30
30
class ApiClient (object ):
31
- """Generic API client for OpenAPI client library builds .
31
+ """Generic API client for OpenAPI client library Build .
32
32
33
33
OpenAPI generic API client. This client handles the client-
34
34
server communication, and is invariant across implementations. Specifics of
@@ -64,6 +64,7 @@ class ApiClient(object):
64
64
65
65
def __init__ (self , configuration = None , header_name = None , header_value = None ,
66
66
cookie = None , pool_threads = None ):
67
+ """Initialize generic API client."""
67
68
if configuration is None :
68
69
configuration = Configuration ()
69
70
self .configuration = configuration
@@ -78,6 +79,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
78
79
self .user_agent = 'influxdb-client-python/1.9.0dev'
79
80
80
81
def __del__ (self ):
82
+ """Dispose pools."""
81
83
if self ._pool :
82
84
self ._pool .close ()
83
85
self ._pool .join ()
@@ -87,23 +89,23 @@ def __del__(self):
87
89
88
90
@property
89
91
def pool (self ):
90
- """Create thread pool on first request
91
- avoids instantiating unused threadpool for blocking clients.
92
- """
92
+ """Create thread pool on first request avoids instantiating unused threadpool for blocking clients."""
93
93
if self ._pool is None :
94
94
self ._pool = ThreadPool (self .pool_threads )
95
95
return self ._pool
96
96
97
97
@property
98
98
def user_agent (self ):
99
- """User agent for this API client"""
99
+ """User agent for this API client. """
100
100
return self .default_headers ['User-Agent' ]
101
101
102
102
@user_agent .setter
103
103
def user_agent (self , value ):
104
+ """Set User agent for this API client."""
104
105
self .default_headers ['User-Agent' ] = value
105
106
106
107
def set_default_header (self , header_name , header_value ):
108
+ """Set HTTP header for this API client."""
107
109
self .default_headers [header_name ] = header_value
108
110
109
111
def __call_api (
@@ -186,7 +188,7 @@ def __call_api(
186
188
response_data .getheaders ())
187
189
188
190
def sanitize_for_serialization (self , obj ):
189
- """Builds a JSON POST object.
191
+ """Build a JSON POST object.
190
192
191
193
If obj is None, return None.
192
194
If obj is str, int, long, float, bool, return directly.
@@ -294,7 +296,7 @@ def call_api(self, resource_path, method,
294
296
response_type = None , auth_settings = None , async_req = None ,
295
297
_return_http_data_only = None , collection_formats = None ,
296
298
_preload_content = True , _request_timeout = None ):
297
- """Makes the HTTP request (synchronous) and returns deserialized data.
299
+ """Make the HTTP request (synchronous) and Return deserialized data.
298
300
299
301
To make an async_req request, set the async_req parameter.
300
302
@@ -351,7 +353,7 @@ def call_api(self, resource_path, method,
351
353
def request (self , method , url , query_params = None , headers = None ,
352
354
post_params = None , body = None , _preload_content = True ,
353
355
_request_timeout = None ):
354
- """Makes the HTTP request using RESTClient."""
356
+ """Make the HTTP request using RESTClient."""
355
357
if method == "GET" :
356
358
return self .rest_client .GET (url ,
357
359
query_params = query_params ,
@@ -440,7 +442,7 @@ def parameters_to_tuples(self, params, collection_formats):
440
442
return new_params
441
443
442
444
def prepare_post_parameters (self , post_params = None , files = None ):
443
- """Builds form parameters.
445
+ """Build form parameters.
444
446
445
447
:param post_params: Normal form parameters.
446
448
:param files: File parameters.
@@ -468,7 +470,7 @@ def prepare_post_parameters(self, post_params=None, files=None):
468
470
return params
469
471
470
472
def select_header_accept (self , accepts ):
471
- """Returns `Accept` based on an array of accepts provided.
473
+ """Return `Accept` based on an array of accepts provided.
472
474
473
475
:param accepts: List of headers.
474
476
:return: Accept (e.g. application/json).
@@ -484,7 +486,7 @@ def select_header_accept(self, accepts):
484
486
return ', ' .join (accepts )
485
487
486
488
def select_header_content_type (self , content_types ):
487
- """Returns `Content-Type` based on an array of content_types provided.
489
+ """Return `Content-Type` based on an array of content_types provided.
488
490
489
491
:param content_types: List of content-types.
490
492
:return: Content-Type (e.g. application/json).
@@ -500,7 +502,7 @@ def select_header_content_type(self, content_types):
500
502
return content_types [0 ]
501
503
502
504
def update_params_for_auth (self , headers , querys , auth_settings ):
503
- """Updates header and query params based on authentication setting.
505
+ """Update header and query params based on authentication setting.
504
506
505
507
:param headers: Header parameters dict to be updated.
506
508
:param querys: Query parameters tuple list to be updated.
@@ -524,7 +526,7 @@ def update_params_for_auth(self, headers, querys, auth_settings):
524
526
)
525
527
526
528
def __deserialize_file (self , response ):
527
- """Deserializes body to file
529
+ """Deserializes body to file.
528
530
529
531
Saves response body into a file in a temporary folder,
530
532
using the filename from the `Content-Disposition` header if provided.
@@ -615,7 +617,6 @@ def __deserialize_model(self, data, klass):
615
617
:param klass: class literal.
616
618
:return: model object.
617
619
"""
618
-
619
620
if not klass .openapi_types and not hasattr (klass ,
620
621
'get_real_child_model' ):
621
622
return data
0 commit comments