mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-11 00:21:18 +00:00
Merge remote-tracking branch 'origin/master' into 6.0.x
This commit is contained in:
@@ -34,69 +34,7 @@ class UsageApi(object):
|
||||
if api_client is None:
|
||||
api_client = ApiClient()
|
||||
self.api_client = api_client
|
||||
|
||||
def __custom_server(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""Use custom server # noqa: E501
|
||||
|
||||
Use custom server # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.custom_server(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 (int/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:
|
||||
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
|
||||
If the method is called asynchronously, returns the request
|
||||
thread.
|
||||
"""
|
||||
kwargs['async_req'] = kwargs.get(
|
||||
'async_req', False
|
||||
)
|
||||
kwargs['_return_http_data_only'] = kwargs.get(
|
||||
'_return_http_data_only', True
|
||||
)
|
||||
kwargs['_preload_content'] = kwargs.get(
|
||||
'_preload_content', True
|
||||
)
|
||||
kwargs['_request_timeout'] = kwargs.get(
|
||||
'_request_timeout', None
|
||||
)
|
||||
kwargs['_check_input_type'] = kwargs.get(
|
||||
'_check_input_type', True
|
||||
)
|
||||
kwargs['_check_return_type'] = kwargs.get(
|
||||
'_check_return_type', True
|
||||
)
|
||||
kwargs['_host_index'] = kwargs.get('_host_index')
|
||||
return self.call_with_http_info(**kwargs)
|
||||
|
||||
self.custom_server = _Endpoint(
|
||||
self.custom_server_endpoint = _Endpoint(
|
||||
settings={
|
||||
'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},),
|
||||
'auth': [],
|
||||
@@ -185,72 +123,9 @@ class UsageApi(object):
|
||||
],
|
||||
'content_type': [],
|
||||
},
|
||||
api_client=api_client,
|
||||
callable=__custom_server
|
||||
api_client=api_client
|
||||
)
|
||||
|
||||
def __default_server(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""Use default server # noqa: E501
|
||||
|
||||
Use default server # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.default_server(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 (int/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:
|
||||
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
|
||||
If the method is called asynchronously, returns the request
|
||||
thread.
|
||||
"""
|
||||
kwargs['async_req'] = kwargs.get(
|
||||
'async_req', False
|
||||
)
|
||||
kwargs['_return_http_data_only'] = kwargs.get(
|
||||
'_return_http_data_only', True
|
||||
)
|
||||
kwargs['_preload_content'] = kwargs.get(
|
||||
'_preload_content', True
|
||||
)
|
||||
kwargs['_request_timeout'] = kwargs.get(
|
||||
'_request_timeout', None
|
||||
)
|
||||
kwargs['_check_input_type'] = kwargs.get(
|
||||
'_check_input_type', True
|
||||
)
|
||||
kwargs['_check_return_type'] = kwargs.get(
|
||||
'_check_return_type', True
|
||||
)
|
||||
kwargs['_host_index'] = kwargs.get('_host_index')
|
||||
return self.call_with_http_info(**kwargs)
|
||||
|
||||
self.default_server = _Endpoint(
|
||||
self.default_server_endpoint = _Endpoint(
|
||||
settings={
|
||||
'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},),
|
||||
'auth': [],
|
||||
@@ -290,6 +165,128 @@ class UsageApi(object):
|
||||
],
|
||||
'content_type': [],
|
||||
},
|
||||
api_client=api_client,
|
||||
callable=__default_server
|
||||
api_client=api_client
|
||||
)
|
||||
|
||||
def custom_server(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""Use custom server # noqa: E501
|
||||
|
||||
Use custom server # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.custom_server(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 (int/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:
|
||||
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
|
||||
If the method is called asynchronously, returns the request
|
||||
thread.
|
||||
"""
|
||||
kwargs['async_req'] = kwargs.get(
|
||||
'async_req', False
|
||||
)
|
||||
kwargs['_return_http_data_only'] = kwargs.get(
|
||||
'_return_http_data_only', True
|
||||
)
|
||||
kwargs['_preload_content'] = kwargs.get(
|
||||
'_preload_content', True
|
||||
)
|
||||
kwargs['_request_timeout'] = kwargs.get(
|
||||
'_request_timeout', None
|
||||
)
|
||||
kwargs['_check_input_type'] = kwargs.get(
|
||||
'_check_input_type', True
|
||||
)
|
||||
kwargs['_check_return_type'] = kwargs.get(
|
||||
'_check_return_type', True
|
||||
)
|
||||
kwargs['_host_index'] = kwargs.get('_host_index')
|
||||
return self.custom_server_endpoint.call_with_http_info(**kwargs)
|
||||
|
||||
def default_server(
|
||||
self,
|
||||
**kwargs
|
||||
):
|
||||
"""Use default server # noqa: E501
|
||||
|
||||
Use default server # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
|
||||
>>> thread = api.default_server(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 (int/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:
|
||||
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
|
||||
If the method is called asynchronously, returns the request
|
||||
thread.
|
||||
"""
|
||||
kwargs['async_req'] = kwargs.get(
|
||||
'async_req', False
|
||||
)
|
||||
kwargs['_return_http_data_only'] = kwargs.get(
|
||||
'_return_http_data_only', True
|
||||
)
|
||||
kwargs['_preload_content'] = kwargs.get(
|
||||
'_preload_content', True
|
||||
)
|
||||
kwargs['_request_timeout'] = kwargs.get(
|
||||
'_request_timeout', None
|
||||
)
|
||||
kwargs['_check_input_type'] = kwargs.get(
|
||||
'_check_input_type', True
|
||||
)
|
||||
kwargs['_check_return_type'] = kwargs.get(
|
||||
'_check_return_type', True
|
||||
)
|
||||
kwargs['_host_index'] = kwargs.get('_host_index')
|
||||
return self.default_server_endpoint.call_with_http_info(**kwargs)
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
|
||||
from datetime import date, datetime # noqa: F401
|
||||
from copy import deepcopy
|
||||
import inspect
|
||||
import io
|
||||
import os
|
||||
@@ -186,6 +187,26 @@ class OpenApiModel(object):
|
||||
"""get the value of an attribute using dot notation: `instance.attr`"""
|
||||
return self.__getitem__(attr)
|
||||
|
||||
def __copy__(self):
|
||||
cls = self.__class__
|
||||
if self.get("_spec_property_naming", False):
|
||||
return cls._new_from_openapi_data(**self.__dict__)
|
||||
else:
|
||||
return new_cls.__new__(cls, **self.__dict__)
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
cls = self.__class__
|
||||
|
||||
if self.get("_spec_property_naming", False):
|
||||
new_inst = cls._new_from_openapi_data()
|
||||
else:
|
||||
new_inst = cls.__new__(cls)
|
||||
|
||||
for k, v in self.__dict__.items():
|
||||
setattr(new_inst, k, deepcopy(v, memo))
|
||||
return new_inst
|
||||
|
||||
|
||||
def __new__(cls, *args, **kwargs):
|
||||
# this function uses the discriminator to
|
||||
# pick a new schema/class to instantiate because a discriminator
|
||||
@@ -295,8 +316,13 @@ class OpenApiModel(object):
|
||||
self_inst = super(OpenApiModel, cls).__new__(cls)
|
||||
self_inst.__init__(*args, **kwargs)
|
||||
|
||||
new_inst = new_cls.__new__(new_cls, *args, **kwargs)
|
||||
new_inst.__init__(*args, **kwargs)
|
||||
if kwargs.get("_spec_property_naming", False):
|
||||
# when true, implies new is from deserialization
|
||||
new_inst = new_cls._new_from_openapi_data(*args, **kwargs)
|
||||
else:
|
||||
new_inst = new_cls.__new__(new_cls, *args, **kwargs)
|
||||
new_inst.__init__(*args, **kwargs)
|
||||
|
||||
return new_inst
|
||||
|
||||
|
||||
|
||||
@@ -38,14 +38,14 @@ git add .
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=`git remote`
|
||||
git_remote=$(git remote)
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user