# 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 ComputersComputerApi(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_computers_computer_object(self, dn, **kwargs): # noqa: E501 """ Get a representation of the Computer 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_computers_computer_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: ComputersComputer """ kwargs['_return_http_data_only'] = True return self.udm_computers_computer_object_with_http_info(dn, **kwargs) # noqa: E501 def udm_computers_computer_object_with_http_info(self, dn, **kwargs): # noqa: E501 """ Get a representation of the Computer 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_computers_computer_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(ComputersComputer, 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_computers_computer_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_computers_computer_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_computers_computer_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_computers_computer_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: "ComputersComputer", 404: "dict(str, object)", } return self.api_client.call_api( '/computers/computer/{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_computers_computer_object_search(self, **kwargs): # noqa: E501 """Search for Computers objects # noqa: E501 Information about the object type and links to search for objects. The found objects are either referenced as HAL links or embedded via HAL embedded resources. # 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_computers_computer_object_search(async_req=True) >>> result = thread.get() :param filter: A LDAP filter which may contain `UDM` property names instead of `LDAP` attribute names. :type filter: str :param position: Position which is used as search base. :type position: str :param scope: The LDAP search scope (sub, base, one). :type scope: str :param query: The values to search for (propertyname and search filter value). Alternatively with `filter` a raw LDAP filter can be given. :type query: dict(str, object) :param hidden: Include hidden/system objects in the response. :type hidden: bool :param properties: The properties which should be returned, if not given all properties are returned. :type properties: list[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: ComputersComputerList """ kwargs['_return_http_data_only'] = True return self.udm_computers_computer_object_search_with_http_info(**kwargs) # noqa: E501 def udm_computers_computer_object_search_with_http_info(self, **kwargs): # noqa: E501 """Search for Computers objects # noqa: E501 Information about the object type and links to search for objects. The found objects are either referenced as HAL links or embedded via HAL embedded resources. # 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_computers_computer_object_search_with_http_info(async_req=True) >>> result = thread.get() :param filter: A LDAP filter which may contain `UDM` property names instead of `LDAP` attribute names. :type filter: str :param position: Position which is used as search base. :type position: str :param scope: The LDAP search scope (sub, base, one). :type scope: str :param query: The values to search for (propertyname and search filter value). Alternatively with `filter` a raw LDAP filter can be given. :type query: dict(str, object) :param hidden: Include hidden/system objects in the response. :type hidden: bool :param properties: The properties which should be returned, if not given all properties are returned. :type properties: list[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(ComputersComputerList, status_code(int), headers(HTTPHeaderDict)) """ local_var_params = locals() all_params = [ 'filter', 'position', 'scope', 'query', 'hidden', 'properties', '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_computers_computer_object_search" % key ) local_var_params[key] = val del local_var_params['kwargs'] if self.api_client.client_side_validation and 'scope' in local_var_params and not re.search(r'^(sub|one|base|base\+one)$', local_var_params['scope']): # noqa: E501 raise ApiValueError("Invalid value for parameter `scope` when calling `udm_computers_computer_object_search`, must conform to the pattern `/^(sub|one|base|base\+one)$/`") # noqa: E501 if self.api_client.client_side_validation and ('properties' in local_var_params and # noqa: E501 len(local_var_params['properties']) < 0): # noqa: E501 raise ApiValueError("Invalid value for parameter `properties` when calling `udm_computers_computer_object_search`, number of items must be greater than or equal to `0`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] if 'filter' in local_var_params and local_var_params['filter'] is not None: # noqa: E501 query_params.append(('filter', local_var_params['filter'])) # noqa: E501 if 'position' in local_var_params and local_var_params['position'] is not None: # noqa: E501 query_params.append(('position', local_var_params['position'])) # noqa: E501 if 'scope' in local_var_params and local_var_params['scope'] is not None: # noqa: E501 query_params.append(('scope', local_var_params['scope'])) # noqa: E501 if 'query' in local_var_params and local_var_params['query'] is not None: # noqa: E501 query_params.append(('query', local_var_params['query'])) # noqa: E501 if 'hidden' in local_var_params and local_var_params['hidden'] is not None: # noqa: E501 query_params.append(('hidden', local_var_params['hidden'])) # noqa: E501 if 'properties' in local_var_params and local_var_params['properties'] is not None: # noqa: E501 query_params.append(('properties', local_var_params['properties'])) # noqa: E501 collection_formats['properties'] = 'multi' # noqa: E501 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: "ComputersComputerList", } return self.api_client.call_api( '/computers/computer/', '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'))