646 lines
31 KiB
Python
646 lines
31 KiB
Python
|
# coding: utf-8
|
||
|
|
||
|
"""
|
||
|
Univention Directory Manager REST interface
|
||
|
|
||
|
Schema definition for the objects in the Univention Directory Manager REST interface. # noqa: E501
|
||
|
|
||
|
The version of the OpenAPI document: 1.0.2
|
||
|
Generated by: https://openapi-generator.tech
|
||
|
"""
|
||
|
|
||
|
|
||
|
from __future__ import absolute_import
|
||
|
|
||
|
import re # noqa: F401
|
||
|
|
||
|
# python 2 and python 3 compatibility library
|
||
|
import six
|
||
|
|
||
|
from openapi_client_udm.api_client import ApiClient
|
||
|
from openapi_client_udm.exceptions import ( # noqa: F401
|
||
|
ApiTypeError,
|
||
|
ApiValueError
|
||
|
)
|
||
|
|
||
|
|
||
|
class UsersPasswdApi(object):
|
||
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||
|
Ref: https://openapi-generator.tech
|
||
|
|
||
|
Do not edit the class manually.
|
||
|
"""
|
||
|
|
||
|
def __init__(self, api_client=None):
|
||
|
if api_client is None:
|
||
|
api_client = ApiClient()
|
||
|
self.api_client = api_client
|
||
|
|
||
|
def udm_users_passwd_object(self, dn, **kwargs): # noqa: E501
|
||
|
""" Get a representation of the Password object with all its properties, policies, options, metadata and references. Includes also instructions how to modify, remove or move the object. # noqa: E501
|
||
|
|
||
|
This method makes a synchronous HTTP request by default. To make an
|
||
|
asynchronous HTTP request, please pass async_req=True
|
||
|
|
||
|
>>> thread = api.udm_users_passwd_object(dn, async_req=True)
|
||
|
>>> result = thread.get()
|
||
|
|
||
|
:param dn: The (urlencoded) LDAP Distinguished Name (DN). (required)
|
||
|
:type dn: str
|
||
|
:param user_agent: The user agent.
|
||
|
:type user_agent: str
|
||
|
:param accept_language: The accepted response languages.
|
||
|
:type accept_language: str
|
||
|
:param if_none_match: Use request from cache by using the Etag entity tag if it matches.
|
||
|
:type if_none_match: str
|
||
|
:param if_modified_since: Use request from cache by using the Last-Modified date if it matches.
|
||
|
:type if_modified_since: str
|
||
|
:param x_request_id: A request-ID used for logging and tracing.
|
||
|
:type x_request_id: str
|
||
|
:param async_req: Whether to execute the request asynchronously.
|
||
|
:type async_req: bool, optional
|
||
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||
|
be returned without reading/decoding response
|
||
|
data. Default is True.
|
||
|
:type _preload_content: bool, optional
|
||
|
:param _request_timeout: 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.
|
||
|
:return: Returns the result object.
|
||
|
If the method is called asynchronously,
|
||
|
returns the request thread.
|
||
|
:rtype: UsersPasswd
|
||
|
"""
|
||
|
kwargs['_return_http_data_only'] = True
|
||
|
return self.udm_users_passwd_object_with_http_info(dn, **kwargs) # noqa: E501
|
||
|
|
||
|
def udm_users_passwd_object_with_http_info(self, dn, **kwargs): # noqa: E501
|
||
|
""" Get a representation of the Password object with all its properties, policies, options, metadata and references. Includes also instructions how to modify, remove or move the object. # noqa: E501
|
||
|
|
||
|
This method makes a synchronous HTTP request by default. To make an
|
||
|
asynchronous HTTP request, please pass async_req=True
|
||
|
|
||
|
>>> thread = api.udm_users_passwd_object_with_http_info(dn, async_req=True)
|
||
|
>>> result = thread.get()
|
||
|
|
||
|
:param dn: The (urlencoded) LDAP Distinguished Name (DN). (required)
|
||
|
:type dn: str
|
||
|
:param user_agent: The user agent.
|
||
|
:type user_agent: str
|
||
|
:param accept_language: The accepted response languages.
|
||
|
:type accept_language: str
|
||
|
:param if_none_match: Use request from cache by using the Etag entity tag if it matches.
|
||
|
:type if_none_match: str
|
||
|
:param if_modified_since: Use request from cache by using the Last-Modified date if it matches.
|
||
|
:type if_modified_since: str
|
||
|
:param x_request_id: A request-ID used for logging and tracing.
|
||
|
:type x_request_id: str
|
||
|
:param async_req: Whether to execute the request asynchronously.
|
||
|
:type async_req: bool, optional
|
||
|
:param _return_http_data_only: response data without head status code
|
||
|
and headers
|
||
|
:type _return_http_data_only: bool, optional
|
||
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||
|
be returned without reading/decoding response
|
||
|
data. Default is True.
|
||
|
:type _preload_content: bool, optional
|
||
|
:param _request_timeout: 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.
|
||
|
:param _request_auth: set to override the auth_settings for an a single
|
||
|
request; this effectively ignores the authentication
|
||
|
in the spec for a single request.
|
||
|
:type _request_auth: dict, optional
|
||
|
:type _content_type: string, optional: force content-type for the request
|
||
|
:return: Returns the result object.
|
||
|
If the method is called asynchronously,
|
||
|
returns the request thread.
|
||
|
:rtype: tuple(UsersPasswd, status_code(int), headers(HTTPHeaderDict))
|
||
|
"""
|
||
|
|
||
|
local_var_params = locals()
|
||
|
|
||
|
all_params = [
|
||
|
'dn',
|
||
|
'user_agent',
|
||
|
'accept_language',
|
||
|
'if_none_match',
|
||
|
'if_modified_since',
|
||
|
'x_request_id'
|
||
|
]
|
||
|
all_params.extend(
|
||
|
[
|
||
|
'async_req',
|
||
|
'_return_http_data_only',
|
||
|
'_preload_content',
|
||
|
'_request_timeout',
|
||
|
'_request_auth',
|
||
|
'_content_type',
|
||
|
'_headers'
|
||
|
]
|
||
|
)
|
||
|
|
||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||
|
if key not in all_params:
|
||
|
raise ApiTypeError(
|
||
|
"Got an unexpected keyword argument '%s'"
|
||
|
" to method udm_users_passwd_object" % key
|
||
|
)
|
||
|
local_var_params[key] = val
|
||
|
del local_var_params['kwargs']
|
||
|
# verify the required parameter 'dn' is set
|
||
|
if self.api_client.client_side_validation and ('dn' not in local_var_params or # noqa: E501
|
||
|
local_var_params['dn'] is None): # noqa: E501
|
||
|
raise ApiValueError("Missing the required parameter `dn` when calling `udm_users_passwd_object`") # noqa: E501
|
||
|
|
||
|
if self.api_client.client_side_validation and ('dn' in local_var_params and # noqa: E501
|
||
|
len(local_var_params['dn']) < 3): # noqa: E501
|
||
|
raise ApiValueError("Invalid value for parameter `dn` when calling `udm_users_passwd_object`, length must be greater than or equal to `3`") # noqa: E501
|
||
|
if self.api_client.client_side_validation and 'dn' in local_var_params and not re.search(r'^.+=.+$', local_var_params['dn']): # noqa: E501
|
||
|
raise ApiValueError("Invalid value for parameter `dn` when calling `udm_users_passwd_object`, must conform to the pattern `/^.+=.+$/`") # noqa: E501
|
||
|
collection_formats = {}
|
||
|
|
||
|
path_params = {}
|
||
|
if 'dn' in local_var_params:
|
||
|
path_params['dn'] = local_var_params['dn'] # noqa: E501
|
||
|
|
||
|
query_params = []
|
||
|
|
||
|
header_params = dict(local_var_params.get('_headers', {}))
|
||
|
if 'user_agent' in local_var_params:
|
||
|
header_params['User-Agent'] = local_var_params['user_agent'] # noqa: E501
|
||
|
if 'accept_language' in local_var_params:
|
||
|
header_params['Accept-Language'] = local_var_params['accept_language'] # noqa: E501
|
||
|
if 'if_none_match' in local_var_params:
|
||
|
header_params['If-None-Match'] = local_var_params['if_none_match'] # noqa: E501
|
||
|
if 'if_modified_since' in local_var_params:
|
||
|
header_params['If-Modified-Since'] = local_var_params['if_modified_since'] # noqa: E501
|
||
|
if 'x_request_id' in local_var_params:
|
||
|
header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501
|
||
|
|
||
|
form_params = []
|
||
|
local_var_files = {}
|
||
|
|
||
|
body_params = None
|
||
|
# HTTP header `Accept`
|
||
|
header_params['Accept'] = self.api_client.select_header_accept(
|
||
|
['application/json', 'application/hal+json', 'text/html']) # noqa: E501
|
||
|
|
||
|
# Authentication setting
|
||
|
auth_settings = ['basic'] # noqa: E501
|
||
|
|
||
|
response_types_map = {
|
||
|
400: "dict(str, object)",
|
||
|
401: "dict(str, object)",
|
||
|
403: "dict(str, object)",
|
||
|
422: "EmbeddedError",
|
||
|
500: "EmbeddedError",
|
||
|
503: "dict(str, object)",
|
||
|
502: "dict(str, object)",
|
||
|
504: "dict(str, object)",
|
||
|
200: "UsersPasswd",
|
||
|
404: "dict(str, object)",
|
||
|
}
|
||
|
|
||
|
return self.api_client.call_api(
|
||
|
'/users/passwd/{dn}', 'GET',
|
||
|
path_params,
|
||
|
query_params,
|
||
|
header_params,
|
||
|
body=body_params,
|
||
|
post_params=form_params,
|
||
|
files=local_var_files,
|
||
|
response_types_map=response_types_map,
|
||
|
auth_settings=auth_settings,
|
||
|
async_req=local_var_params.get('async_req'),
|
||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||
|
collection_formats=collection_formats,
|
||
|
_request_auth=local_var_params.get('_request_auth'))
|
||
|
|
||
|
def udm_users_passwd_object_modify(self, dn, users_passwd, **kwargs): # noqa: E501
|
||
|
"""Modify or move an Password object # noqa: E501
|
||
|
|
||
|
This method makes a synchronous HTTP request by default. To make an
|
||
|
asynchronous HTTP request, please pass async_req=True
|
||
|
|
||
|
>>> thread = api.udm_users_passwd_object_modify(dn, users_passwd, async_req=True)
|
||
|
>>> result = thread.get()
|
||
|
|
||
|
:param dn: The (urlencoded) LDAP Distinguished Name (DN). (required)
|
||
|
:type dn: str
|
||
|
:param users_passwd: (required)
|
||
|
:type users_passwd: UsersPasswd
|
||
|
:param if_match: Provide entity tag to make a conditional request to not overwrite any values in a race condition.
|
||
|
:type if_match: str
|
||
|
:param if_unmodified_since: Provide last modified time to make a conditional request to not overwrite any values in a race condition.
|
||
|
:type if_unmodified_since: str
|
||
|
:param user_agent: The user agent.
|
||
|
:type user_agent: str
|
||
|
:param accept_language: The accepted response languages.
|
||
|
:type accept_language: str
|
||
|
:param if_none_match: Use request from cache by using the Etag entity tag if it matches.
|
||
|
:type if_none_match: str
|
||
|
:param if_modified_since: Use request from cache by using the Last-Modified date if it matches.
|
||
|
:type if_modified_since: str
|
||
|
:param x_request_id: A request-ID used for logging and tracing.
|
||
|
:type x_request_id: str
|
||
|
:param async_req: Whether to execute the request asynchronously.
|
||
|
:type async_req: bool, optional
|
||
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||
|
be returned without reading/decoding response
|
||
|
data. Default is True.
|
||
|
:type _preload_content: bool, optional
|
||
|
:param _request_timeout: 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.
|
||
|
:return: Returns the result object.
|
||
|
If the method is called asynchronously,
|
||
|
returns the request thread.
|
||
|
:rtype: InlineResponse201
|
||
|
"""
|
||
|
kwargs['_return_http_data_only'] = True
|
||
|
return self.udm_users_passwd_object_modify_with_http_info(dn, users_passwd, **kwargs) # noqa: E501
|
||
|
|
||
|
def udm_users_passwd_object_modify_with_http_info(self, dn, users_passwd, **kwargs): # noqa: E501
|
||
|
"""Modify or move an Password object # noqa: E501
|
||
|
|
||
|
This method makes a synchronous HTTP request by default. To make an
|
||
|
asynchronous HTTP request, please pass async_req=True
|
||
|
|
||
|
>>> thread = api.udm_users_passwd_object_modify_with_http_info(dn, users_passwd, async_req=True)
|
||
|
>>> result = thread.get()
|
||
|
|
||
|
:param dn: The (urlencoded) LDAP Distinguished Name (DN). (required)
|
||
|
:type dn: str
|
||
|
:param users_passwd: (required)
|
||
|
:type users_passwd: UsersPasswd
|
||
|
:param if_match: Provide entity tag to make a conditional request to not overwrite any values in a race condition.
|
||
|
:type if_match: str
|
||
|
:param if_unmodified_since: Provide last modified time to make a conditional request to not overwrite any values in a race condition.
|
||
|
:type if_unmodified_since: str
|
||
|
:param user_agent: The user agent.
|
||
|
:type user_agent: str
|
||
|
:param accept_language: The accepted response languages.
|
||
|
:type accept_language: str
|
||
|
:param if_none_match: Use request from cache by using the Etag entity tag if it matches.
|
||
|
:type if_none_match: str
|
||
|
:param if_modified_since: Use request from cache by using the Last-Modified date if it matches.
|
||
|
:type if_modified_since: str
|
||
|
:param x_request_id: A request-ID used for logging and tracing.
|
||
|
:type x_request_id: str
|
||
|
:param async_req: Whether to execute the request asynchronously.
|
||
|
:type async_req: bool, optional
|
||
|
:param _return_http_data_only: response data without head status code
|
||
|
and headers
|
||
|
:type _return_http_data_only: bool, optional
|
||
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||
|
be returned without reading/decoding response
|
||
|
data. Default is True.
|
||
|
:type _preload_content: bool, optional
|
||
|
:param _request_timeout: 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.
|
||
|
:param _request_auth: set to override the auth_settings for an a single
|
||
|
request; this effectively ignores the authentication
|
||
|
in the spec for a single request.
|
||
|
:type _request_auth: dict, optional
|
||
|
:type _content_type: string, optional: force content-type for the request
|
||
|
:return: Returns the result object.
|
||
|
If the method is called asynchronously,
|
||
|
returns the request thread.
|
||
|
:rtype: tuple(InlineResponse201, status_code(int), headers(HTTPHeaderDict))
|
||
|
"""
|
||
|
|
||
|
local_var_params = locals()
|
||
|
|
||
|
all_params = [
|
||
|
'dn',
|
||
|
'users_passwd',
|
||
|
'if_match',
|
||
|
'if_unmodified_since',
|
||
|
'user_agent',
|
||
|
'accept_language',
|
||
|
'if_none_match',
|
||
|
'if_modified_since',
|
||
|
'x_request_id'
|
||
|
]
|
||
|
all_params.extend(
|
||
|
[
|
||
|
'async_req',
|
||
|
'_return_http_data_only',
|
||
|
'_preload_content',
|
||
|
'_request_timeout',
|
||
|
'_request_auth',
|
||
|
'_content_type',
|
||
|
'_headers'
|
||
|
]
|
||
|
)
|
||
|
|
||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||
|
if key not in all_params:
|
||
|
raise ApiTypeError(
|
||
|
"Got an unexpected keyword argument '%s'"
|
||
|
" to method udm_users_passwd_object_modify" % key
|
||
|
)
|
||
|
local_var_params[key] = val
|
||
|
del local_var_params['kwargs']
|
||
|
# verify the required parameter 'dn' is set
|
||
|
if self.api_client.client_side_validation and ('dn' not in local_var_params or # noqa: E501
|
||
|
local_var_params['dn'] is None): # noqa: E501
|
||
|
raise ApiValueError("Missing the required parameter `dn` when calling `udm_users_passwd_object_modify`") # noqa: E501
|
||
|
# verify the required parameter 'users_passwd' is set
|
||
|
if self.api_client.client_side_validation and ('users_passwd' not in local_var_params or # noqa: E501
|
||
|
local_var_params['users_passwd'] is None): # noqa: E501
|
||
|
raise ApiValueError("Missing the required parameter `users_passwd` when calling `udm_users_passwd_object_modify`") # noqa: E501
|
||
|
|
||
|
if self.api_client.client_side_validation and ('dn' in local_var_params and # noqa: E501
|
||
|
len(local_var_params['dn']) < 3): # noqa: E501
|
||
|
raise ApiValueError("Invalid value for parameter `dn` when calling `udm_users_passwd_object_modify`, length must be greater than or equal to `3`") # noqa: E501
|
||
|
if self.api_client.client_side_validation and 'dn' in local_var_params and not re.search(r'^.+=.+$', local_var_params['dn']): # noqa: E501
|
||
|
raise ApiValueError("Invalid value for parameter `dn` when calling `udm_users_passwd_object_modify`, must conform to the pattern `/^.+=.+$/`") # noqa: E501
|
||
|
collection_formats = {}
|
||
|
|
||
|
path_params = {}
|
||
|
if 'dn' in local_var_params:
|
||
|
path_params['dn'] = local_var_params['dn'] # noqa: E501
|
||
|
|
||
|
query_params = []
|
||
|
|
||
|
header_params = dict(local_var_params.get('_headers', {}))
|
||
|
if 'if_match' in local_var_params:
|
||
|
header_params['If-Match'] = local_var_params['if_match'] # noqa: E501
|
||
|
if 'if_unmodified_since' in local_var_params:
|
||
|
header_params['If-Unmodified-Since'] = local_var_params['if_unmodified_since'] # noqa: E501
|
||
|
if 'user_agent' in local_var_params:
|
||
|
header_params['User-Agent'] = local_var_params['user_agent'] # noqa: E501
|
||
|
if 'accept_language' in local_var_params:
|
||
|
header_params['Accept-Language'] = local_var_params['accept_language'] # noqa: E501
|
||
|
if 'if_none_match' in local_var_params:
|
||
|
header_params['If-None-Match'] = local_var_params['if_none_match'] # noqa: E501
|
||
|
if 'if_modified_since' in local_var_params:
|
||
|
header_params['If-Modified-Since'] = local_var_params['if_modified_since'] # noqa: E501
|
||
|
if 'x_request_id' in local_var_params:
|
||
|
header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501
|
||
|
|
||
|
form_params = []
|
||
|
local_var_files = {}
|
||
|
|
||
|
body_params = None
|
||
|
if 'users_passwd' in local_var_params:
|
||
|
body_params = local_var_params['users_passwd']
|
||
|
# HTTP header `Accept`
|
||
|
header_params['Accept'] = self.api_client.select_header_accept(
|
||
|
['application/json', 'application/hal+json', 'text/html']) # noqa: E501
|
||
|
|
||
|
# HTTP header `Content-Type`
|
||
|
header_params['Content-Type'] = local_var_params.get('_content_type',
|
||
|
self.api_client.select_header_content_type(
|
||
|
['application/json'],
|
||
|
'PUT', body_params)) # noqa: E501
|
||
|
|
||
|
# Authentication setting
|
||
|
auth_settings = ['basic'] # noqa: E501
|
||
|
|
||
|
response_types_map = {
|
||
|
400: "dict(str, object)",
|
||
|
401: "dict(str, object)",
|
||
|
403: "dict(str, object)",
|
||
|
422: "EmbeddedError",
|
||
|
500: "EmbeddedError",
|
||
|
503: "dict(str, object)",
|
||
|
502: "dict(str, object)",
|
||
|
504: "dict(str, object)",
|
||
|
201: "InlineResponse201",
|
||
|
202: "dict(str, object)",
|
||
|
204: None,
|
||
|
404: "dict(str, object)",
|
||
|
}
|
||
|
|
||
|
return self.api_client.call_api(
|
||
|
'/users/passwd/{dn}', 'PUT',
|
||
|
path_params,
|
||
|
query_params,
|
||
|
header_params,
|
||
|
body=body_params,
|
||
|
post_params=form_params,
|
||
|
files=local_var_files,
|
||
|
response_types_map=response_types_map,
|
||
|
auth_settings=auth_settings,
|
||
|
async_req=local_var_params.get('async_req'),
|
||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||
|
collection_formats=collection_formats,
|
||
|
_request_auth=local_var_params.get('_request_auth'))
|
||
|
|
||
|
def udm_users_passwd_object_update(self, dn, users_passwd, **kwargs): # noqa: E501
|
||
|
"""Modify an Password object (moving is currently not possible) # noqa: E501
|
||
|
|
||
|
This method makes a synchronous HTTP request by default. To make an
|
||
|
asynchronous HTTP request, please pass async_req=True
|
||
|
|
||
|
>>> thread = api.udm_users_passwd_object_update(dn, users_passwd, async_req=True)
|
||
|
>>> result = thread.get()
|
||
|
|
||
|
:param dn: The (urlencoded) LDAP Distinguished Name (DN). (required)
|
||
|
:type dn: str
|
||
|
:param users_passwd: (required)
|
||
|
:type users_passwd: UsersPasswd
|
||
|
:param if_match: Provide entity tag to make a conditional request to not overwrite any values in a race condition.
|
||
|
:type if_match: str
|
||
|
:param if_unmodified_since: Provide last modified time to make a conditional request to not overwrite any values in a race condition.
|
||
|
:type if_unmodified_since: str
|
||
|
:param user_agent: The user agent.
|
||
|
:type user_agent: str
|
||
|
:param accept_language: The accepted response languages.
|
||
|
:type accept_language: str
|
||
|
:param if_none_match: Use request from cache by using the Etag entity tag if it matches.
|
||
|
:type if_none_match: str
|
||
|
:param if_modified_since: Use request from cache by using the Last-Modified date if it matches.
|
||
|
:type if_modified_since: str
|
||
|
:param x_request_id: A request-ID used for logging and tracing.
|
||
|
:type x_request_id: str
|
||
|
:param async_req: Whether to execute the request asynchronously.
|
||
|
:type async_req: bool, optional
|
||
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||
|
be returned without reading/decoding response
|
||
|
data. Default is True.
|
||
|
:type _preload_content: bool, optional
|
||
|
:param _request_timeout: 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.
|
||
|
:return: Returns the result object.
|
||
|
If the method is called asynchronously,
|
||
|
returns the request thread.
|
||
|
:rtype: None
|
||
|
"""
|
||
|
kwargs['_return_http_data_only'] = True
|
||
|
return self.udm_users_passwd_object_update_with_http_info(dn, users_passwd, **kwargs) # noqa: E501
|
||
|
|
||
|
def udm_users_passwd_object_update_with_http_info(self, dn, users_passwd, **kwargs): # noqa: E501
|
||
|
"""Modify an Password object (moving is currently not possible) # noqa: E501
|
||
|
|
||
|
This method makes a synchronous HTTP request by default. To make an
|
||
|
asynchronous HTTP request, please pass async_req=True
|
||
|
|
||
|
>>> thread = api.udm_users_passwd_object_update_with_http_info(dn, users_passwd, async_req=True)
|
||
|
>>> result = thread.get()
|
||
|
|
||
|
:param dn: The (urlencoded) LDAP Distinguished Name (DN). (required)
|
||
|
:type dn: str
|
||
|
:param users_passwd: (required)
|
||
|
:type users_passwd: UsersPasswd
|
||
|
:param if_match: Provide entity tag to make a conditional request to not overwrite any values in a race condition.
|
||
|
:type if_match: str
|
||
|
:param if_unmodified_since: Provide last modified time to make a conditional request to not overwrite any values in a race condition.
|
||
|
:type if_unmodified_since: str
|
||
|
:param user_agent: The user agent.
|
||
|
:type user_agent: str
|
||
|
:param accept_language: The accepted response languages.
|
||
|
:type accept_language: str
|
||
|
:param if_none_match: Use request from cache by using the Etag entity tag if it matches.
|
||
|
:type if_none_match: str
|
||
|
:param if_modified_since: Use request from cache by using the Last-Modified date if it matches.
|
||
|
:type if_modified_since: str
|
||
|
:param x_request_id: A request-ID used for logging and tracing.
|
||
|
:type x_request_id: str
|
||
|
:param async_req: Whether to execute the request asynchronously.
|
||
|
:type async_req: bool, optional
|
||
|
:param _return_http_data_only: response data without head status code
|
||
|
and headers
|
||
|
:type _return_http_data_only: bool, optional
|
||
|
:param _preload_content: if False, the urllib3.HTTPResponse object will
|
||
|
be returned without reading/decoding response
|
||
|
data. Default is True.
|
||
|
:type _preload_content: bool, optional
|
||
|
:param _request_timeout: 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.
|
||
|
:param _request_auth: set to override the auth_settings for an a single
|
||
|
request; this effectively ignores the authentication
|
||
|
in the spec for a single request.
|
||
|
:type _request_auth: dict, optional
|
||
|
:type _content_type: string, optional: force content-type for the request
|
||
|
:return: Returns the result object.
|
||
|
If the method is called asynchronously,
|
||
|
returns the request thread.
|
||
|
:rtype: None
|
||
|
"""
|
||
|
|
||
|
local_var_params = locals()
|
||
|
|
||
|
all_params = [
|
||
|
'dn',
|
||
|
'users_passwd',
|
||
|
'if_match',
|
||
|
'if_unmodified_since',
|
||
|
'user_agent',
|
||
|
'accept_language',
|
||
|
'if_none_match',
|
||
|
'if_modified_since',
|
||
|
'x_request_id'
|
||
|
]
|
||
|
all_params.extend(
|
||
|
[
|
||
|
'async_req',
|
||
|
'_return_http_data_only',
|
||
|
'_preload_content',
|
||
|
'_request_timeout',
|
||
|
'_request_auth',
|
||
|
'_content_type',
|
||
|
'_headers'
|
||
|
]
|
||
|
)
|
||
|
|
||
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||
|
if key not in all_params:
|
||
|
raise ApiTypeError(
|
||
|
"Got an unexpected keyword argument '%s'"
|
||
|
" to method udm_users_passwd_object_update" % key
|
||
|
)
|
||
|
local_var_params[key] = val
|
||
|
del local_var_params['kwargs']
|
||
|
# verify the required parameter 'dn' is set
|
||
|
if self.api_client.client_side_validation and ('dn' not in local_var_params or # noqa: E501
|
||
|
local_var_params['dn'] is None): # noqa: E501
|
||
|
raise ApiValueError("Missing the required parameter `dn` when calling `udm_users_passwd_object_update`") # noqa: E501
|
||
|
# verify the required parameter 'users_passwd' is set
|
||
|
if self.api_client.client_side_validation and ('users_passwd' not in local_var_params or # noqa: E501
|
||
|
local_var_params['users_passwd'] is None): # noqa: E501
|
||
|
raise ApiValueError("Missing the required parameter `users_passwd` when calling `udm_users_passwd_object_update`") # noqa: E501
|
||
|
|
||
|
if self.api_client.client_side_validation and ('dn' in local_var_params and # noqa: E501
|
||
|
len(local_var_params['dn']) < 3): # noqa: E501
|
||
|
raise ApiValueError("Invalid value for parameter `dn` when calling `udm_users_passwd_object_update`, length must be greater than or equal to `3`") # noqa: E501
|
||
|
if self.api_client.client_side_validation and 'dn' in local_var_params and not re.search(r'^.+=.+$', local_var_params['dn']): # noqa: E501
|
||
|
raise ApiValueError("Invalid value for parameter `dn` when calling `udm_users_passwd_object_update`, must conform to the pattern `/^.+=.+$/`") # noqa: E501
|
||
|
collection_formats = {}
|
||
|
|
||
|
path_params = {}
|
||
|
if 'dn' in local_var_params:
|
||
|
path_params['dn'] = local_var_params['dn'] # noqa: E501
|
||
|
|
||
|
query_params = []
|
||
|
|
||
|
header_params = dict(local_var_params.get('_headers', {}))
|
||
|
if 'if_match' in local_var_params:
|
||
|
header_params['If-Match'] = local_var_params['if_match'] # noqa: E501
|
||
|
if 'if_unmodified_since' in local_var_params:
|
||
|
header_params['If-Unmodified-Since'] = local_var_params['if_unmodified_since'] # noqa: E501
|
||
|
if 'user_agent' in local_var_params:
|
||
|
header_params['User-Agent'] = local_var_params['user_agent'] # noqa: E501
|
||
|
if 'accept_language' in local_var_params:
|
||
|
header_params['Accept-Language'] = local_var_params['accept_language'] # noqa: E501
|
||
|
if 'if_none_match' in local_var_params:
|
||
|
header_params['If-None-Match'] = local_var_params['if_none_match'] # noqa: E501
|
||
|
if 'if_modified_since' in local_var_params:
|
||
|
header_params['If-Modified-Since'] = local_var_params['if_modified_since'] # noqa: E501
|
||
|
if 'x_request_id' in local_var_params:
|
||
|
header_params['X-Request-Id'] = local_var_params['x_request_id'] # noqa: E501
|
||
|
|
||
|
form_params = []
|
||
|
local_var_files = {}
|
||
|
|
||
|
body_params = None
|
||
|
if 'users_passwd' in local_var_params:
|
||
|
body_params = local_var_params['users_passwd']
|
||
|
# HTTP header `Accept`
|
||
|
header_params['Accept'] = self.api_client.select_header_accept(
|
||
|
['application/json', 'application/hal+json', 'text/html']) # noqa: E501
|
||
|
|
||
|
# HTTP header `Content-Type`
|
||
|
header_params['Content-Type'] = local_var_params.get('_content_type',
|
||
|
self.api_client.select_header_content_type(
|
||
|
['application/json'],
|
||
|
'PATCH', body_params)) # noqa: E501
|
||
|
|
||
|
# Authentication setting
|
||
|
auth_settings = ['basic'] # noqa: E501
|
||
|
|
||
|
response_types_map = {}
|
||
|
|
||
|
return self.api_client.call_api(
|
||
|
'/users/passwd/{dn}', 'PATCH',
|
||
|
path_params,
|
||
|
query_params,
|
||
|
header_params,
|
||
|
body=body_params,
|
||
|
post_params=form_params,
|
||
|
files=local_var_files,
|
||
|
response_types_map=response_types_map,
|
||
|
auth_settings=auth_settings,
|
||
|
async_req=local_var_params.get('async_req'),
|
||
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||
|
_preload_content=local_var_params.get('_preload_content', True),
|
||
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||
|
collection_formats=collection_formats,
|
||
|
_request_auth=local_var_params.get('_request_auth'))
|