"""
    University Human Resources API

    This API exposes identity information from the University Human Resources system. The purpose of this API is to give access to basic identity information about staff members for use by downstream systems, therefore the data exposed is limited to basic information about who a staff member is and details of any affiliations they have.  This API uses the following identifiers to link people to person-records held within different systems:  * `person.v1.human-resources.university.identifiers.cam.ac.uk` - the university human resources (uhr) identifier of     this person - also known as the staff number of HRN. * `v1.person.identifiers.cam.ac.uk` - the common registration scheme identifier (CRSid) of     this person.  Additionally this API uses the following identifiers to link people to institutions or entities which a person may have an affiliation to:  * `institution.v1.human-resources.university.identifiers.cam.ac.uk` - the university human resources (uhr) institution     identifier. This encompasses departments within the University HR system     (currently CHRIS). * `institution.v1.student-records.university.identifiers.cam.ac.uk` - the student records institution identifier. This     encompasses colleges within the University Student Records system (currently CamSIS).  Affiliations can be used to indicate an institution that a person holds a position within, with the `status` indicating the job role that is held and the scheme of the affiliation being `institution.v1.human-resources.university.identifiers.cam.ac.uk`. Additionally an affiliation can indicate a staff member's line manager with the scheme being `person.v1.human-resources.university.identifiers.cam.ac.uk` and the status being `report`. A staff member can have multiple institution affiliations and multiple report affiliations.  This API is currently backed by data from CHRIS, exposing a view which is updated hourly.    # noqa: E501

    The version of the OpenAPI document: v1alpha2
    Generated by: https://openapi-generator.tech
"""


import re  # noqa: F401
import sys  # noqa: F401

from identitylib.hr_client.api_client import ApiClient, Endpoint as _Endpoint
from identitylib.hr_client.model_utils import (  # noqa: F401
    check_allowed_values,
    check_validations,
    date,
    datetime,
    file_type,
    none_type,
    validate_and_convert_types
)
from identitylib.hr_client.model.http_exception import HTTPException
from identitylib.hr_client.model.http_validation_error import HTTPValidationError
from identitylib.hr_client.model.paginated_results_staff_member import PaginatedResultsStaffMember
from identitylib.hr_client.model.staff_member import StaffMember


class StaffMembersApi(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
        self.get_v1alpha2_staff_member_staff_identifier_get_endpoint = _Endpoint(
            settings={
                'response_type': (StaffMember,),
                'auth': [
                    'ApiGatewayOAuthClientCredentials'
                ],
                'endpoint_path': '/staff/{identifier}',
                'operation_id': 'get_v1alpha2_staff_member_staff_identifier_get',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'identifier',
                ],
                'required': [
                    'identifier',
                ],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'identifier':
                        (str,),
                },
                'attribute_map': {
                    'identifier': 'identifier',
                },
                'location_map': {
                    'identifier': 'path',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )
        self.list_v1alpha2_staff_staff_get_endpoint = _Endpoint(
            settings={
                'response_type': (PaginatedResultsStaffMember,),
                'auth': [
                    'ApiGatewayOAuthClientCredentials'
                ],
                'endpoint_path': '/staff',
                'operation_id': 'list_v1alpha2_staff_staff_get',
                'http_method': 'GET',
                'servers': None,
            },
            params_map={
                'all': [
                    'affiliation',
                    'cursor',
                    'page_size',
                ],
                'required': [],
                'nullable': [
                ],
                'enum': [
                ],
                'validation': [
                ]
            },
            root_map={
                'validations': {
                },
                'allowed_values': {
                },
                'openapi_types': {
                    'affiliation':
                        (str,),
                    'cursor':
                        (str,),
                    'page_size':
                        (int,),
                },
                'attribute_map': {
                    'affiliation': 'affiliation',
                    'cursor': 'cursor',
                    'page_size': 'page_size',
                },
                'location_map': {
                    'affiliation': 'query',
                    'cursor': 'query',
                    'page_size': 'query',
                },
                'collection_format_map': {
                }
            },
            headers_map={
                'accept': [
                    'application/json'
                ],
                'content_type': [],
            },
            api_client=api_client
        )

    def get_v1alpha2_staff_member_staff_identifier_get(
        self,
        identifier,
        **kwargs
    ):
        """Get a single staff member  # noqa: E501

        Returns a single staff member based on the identifier provided. The identifier can be provided in the format `<value>@<scheme>`, if the scheme is omitted it shall be assumed that the scheme is `person.v1.human-resources.university.identifiers.cam.ac.uk` (also know as the staff number or HRN).  Currently this endpoint only supports querying by `person.v1.human-resources.university.identifiers.cam.ac.uk` and `v1.person.identifiers.cam.ac.uk` identifiers.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.get_v1alpha2_staff_member_staff_identifier_get(identifier, async_req=True)
        >>> result = thread.get()

        Args:
            identifier (str):

        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.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            _request_auths (list): set to override the auth_settings for an a single
                request; this effectively ignores the authentication
                in the spec for a single request.
                Default is None
            async_req (bool): execute request asynchronously

        Returns:
            StaffMember
                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['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['_request_auths'] = kwargs.get('_request_auths', None)
        kwargs['identifier'] = \
            identifier
        return self.get_v1alpha2_staff_member_staff_identifier_get_endpoint.call_with_http_info(**kwargs)

    def list_v1alpha2_staff_staff_get(
        self,
        **kwargs
    ):
        """List staff members  # noqa: E501

        Lists all staff members held within the University Human Resources system, allowing basic filtering by affiliation.  To avoid returning very large responses, this endpoint produces a paged response. Where there are additional results which cannot be returned on a single page, a `next` field will be populated with a url containing the next page of results. These `next` urls should be followed until a page is returned with no `next` field, indicating that there are no further results. The amount of results returned can be customized using the `page_size` query parameter. The maximum amount of results returned is 999.  Staff members can be filtered by affiliation, by providing an `affiliation` query parameter. This affiliation should be provided in the format `<value>@<scheme>`.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True

        >>> thread = api.list_v1alpha2_staff_staff_get(async_req=True)
        >>> result = thread.get()


        Keyword Args:
            affiliation (str): An affiliation to filter by, in the format `<value>@<scheme>`. When included only the staff members with a matching affiliation are returned.. [optional]
            cursor (str): The cursor indicating a unique page of results - this should be auto generated on the `next` and `previous` fields and does not need to be manually added / updated.. [optional]
            page_size (int): The number of results to return per page. This is limited to 999 results, if a number over 999 is provided the results will be capped at 999. Defaults to 200.. [optional]
            _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.
            _spec_property_naming (bool): True if the variable names in the input data
                are serialized names, as specified in the OpenAPI document.
                False if the variable names in the input data
                are pythonic names, e.g. snake case (default)
            _content_type (str/None): force body content-type.
                Default is None and content-type will be predicted by allowed
                content-types and body.
            _host_index (int/None): specifies the index of the server
                that we want to use.
                Default is read from the configuration.
            _request_auths (list): set to override the auth_settings for an a single
                request; this effectively ignores the authentication
                in the spec for a single request.
                Default is None
            async_req (bool): execute request asynchronously

        Returns:
            PaginatedResultsStaffMember
                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['_spec_property_naming'] = kwargs.get(
            '_spec_property_naming', False
        )
        kwargs['_content_type'] = kwargs.get(
            '_content_type')
        kwargs['_host_index'] = kwargs.get('_host_index')
        kwargs['_request_auths'] = kwargs.get('_request_auths', None)
        return self.list_v1alpha2_staff_staff_get_endpoint.call_with_http_info(**kwargs)

