text: # coding: utf-8
  
  # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
  # This product includes software developed at Datadog (https://www.datadoghq.com/).
  # Copyright 2019-Present Datadog, Inc.
  
  
  import re  # noqa: F401
  import sys  # noqa: F401
  
  from datadog_api_client.v1.api_client import ApiClient, Endpoint
  from datadog_api_client.v1.model_utils import (  # noqa: F401
      check_allowed_values,
      check_validations,
      date,
      datetime,
      file_type,
      none_type,
      validate_and_convert_types
  )
  from datadog_api_client.v1.model.api_error_response import APIErrorResponse
  from datadog_api_client.v1.model.user import User
  from datadog_api_client.v1.model.user_disable_response import UserDisableResponse
  from datadog_api_client.v1.model.user_list_response import UserListResponse
  from datadog_api_client.v1.model.user_response import UserResponse
  
  
  class UsersApi(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 __create_user(
              self,
              body,
              **kwargs
          ):
              """Create a user  # noqa: E501
  
              Create a user for your organization.  **Note**: Users can only be created with the admin access role if application keys belong to administrators.  # noqa: E501
              This method makes a synchronous HTTP request by default. To make an
              asynchronous HTTP request, please pass async_req=True
  
              >>> thread = api.create_user(body, async_req=True)
              >>> result = thread.get()
  
              Args:
                  body (User): User object that needs to be created.
  
              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 (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:
                  UserResponse
                      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')
              kwargs['body'] = \
                  body
              return self.call_with_http_info(**kwargs)
  
          self.create_user = Endpoint(
              settings={
                  'response_type': (UserResponse,),
                  'auth': [
                      'apiKeyAuth',
                      'appKeyAuth'
                  ],
                  'endpoint_path': '/api/v1/user',
                  'operation_id': 'create_user',
                  'http_method': 'POST',
                  'servers': None,
              },
              params_map={
                  'all': [
                      'body',
                  ],
                  'required': [
                      'body',
                  ],
                  'nullable': [
                  ],
                  'enum': [
                  ],
                  'validation': [
                  ]
              },
              root_map={
                  'validations': {
                  },
                  'allowed_values': {
                  },
                  'openapi_types': {
                      'body':
                          (User,),
                  },
                  'attribute_map': {
                  },
                  'location_map': {
                      'body': 'body',
                  },
                  'collection_format_map': {
                  }
              },
              headers_map={
                  'accept': [
                      'application/json'
                  ],
                  'content_type': [
                      'application/json'
                  ]
              },
              api_client=api_client,
              callable=__create_user
          )
  
          def __disable_user(
              self,
              user_handle,
              **kwargs
          ):
              """Disable a user  # noqa: E501
  
              Delete a user from an organization.  **Note**: This endpoint can only be used with application keys belonging to administrators.  # noqa: E501
              This method makes a synchronous HTTP request by default. To make an
              asynchronous HTTP request, please pass async_req=True
  
              >>> thread = api.disable_user(user_handle, async_req=True)
              >>> result = thread.get()
  
              Args:
                  user_handle (str): The handle of the user.
  
              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 (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:
                  UserDisableResponse
                      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')
              kwargs['user_handle'] = \
                  user_handle
              return self.call_with_http_info(**kwargs)
  
          self.disable_user = Endpoint(
              settings={
                  'response_type': (UserDisableResponse,),
                  'auth': [
                      'apiKeyAuth',
                      'appKeyAuth'
                  ],
                  'endpoint_path': '/api/v1/user/{user_handle}',
                  'operation_id': 'disable_user',
                  'http_method': 'DELETE',
                  'servers': None,
              },
              params_map={
                  'all': [
                      'user_handle',
                  ],
                  'required': [
                      'user_handle',
                  ],
                  'nullable': [
                  ],
                  'enum': [
                  ],
                  'validation': [
                  ]
              },
              root_map={
                  'validations': {
                  },
                  'allowed_values': {
                  },
                  'openapi_types': {
                      'user_handle':
                          (str,),
                  },
                  'attribute_map': {
                      'user_handle': 'user_handle',
                  },
                  'location_map': {
                      'user_handle': 'path',
                  },
                  'collection_format_map': {
                  }
              },
              headers_map={
                  'accept': [
                      'application/json'
                  ],
                  'content_type': [],
              },
              api_client=api_client,
              callable=__disable_user
          )
  
          def __get_user(
              self,
              user_handle,
              **kwargs
          ):
              """Get user details  # noqa: E501
  
              Get a user's details.  # 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_user(user_handle, async_req=True)
              >>> result = thread.get()
  
              Args:
                  user_handle (str): The ID of the user.
  
              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 (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:
                  UserResponse
                      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')
              kwargs['user_handle'] = \
                  user_handle
              return self.call_with_http_info(**kwargs)
  
          self.get_user = Endpoint(
              settings={
                  'response_type': (UserResponse,),
                  'auth': [
                      'apiKeyAuth',
                      'appKeyAuth'
                  ],
                  'endpoint_path': '/api/v1/user/{user_handle}',
                  'operation_id': 'get_user',
                  'http_method': 'GET',
                  'servers': None,
              },
              params_map={
                  'all': [
                      'user_handle',
                  ],
                  'required': [
                      'user_handle',
                  ],
                  'nullable': [
                  ],
                  'enum': [
                  ],
                  'validation': [
                  ]
              },
              root_map={
                  'validations': {
                  },
                  'allowed_values': {
                  },
                  'openapi_types': {
                      'user_handle':
                          (str,),
                  },
                  'attribute_map': {
                      'user_handle': 'user_handle',
                  },
                  'location_map': {
                      'user_handle': 'path',
                  },
                  'collection_format_map': {
                  }
              },
              headers_map={
                  'accept': [
                      'application/json'
                  ],
                  'content_type': [],
              },
              api_client=api_client,
              callable=__get_user
          )
  
          def __list_users(
              self,
              **kwargs
          ):
              """List all users  # noqa: E501
  
              List all users for your organization.  # 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_users(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 (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:
                  UserListResponse
                      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.list_users = Endpoint(
              settings={
                  'response_type': (UserListResponse,),
                  'auth': [
                      'apiKeyAuth',
                      'appKeyAuth'
                  ],
                  'endpoint_path': '/api/v1/user',
                  'operation_id': 'list_users',
                  'http_method': 'GET',
                  'servers': None,
              },
              params_map={
                  'all': [
                  ],
                  'required': [],
                  'nullable': [
                  ],
                  'enum': [
                  ],
                  'validation': [
                  ]
              },
              root_map={
                  'validations': {
                  },
                  'allowed_values': {
                  },
                  'openapi_types': {
                  },
                  'attribute_map': {
                  },
                  'location_map': {
                  },
                  'collection_format_map': {
                  }
              },
              headers_map={
                  'accept': [
                      'application/json'
                  ],
                  'content_type': [],
              },
              api_client=api_client,
              callable=__list_users
          )
  
          def __update_user(
              self,
              user_handle,
              body,
              **kwargs
          ):
              """Update a user  # noqa: E501
  
              Update a user information.  **Note**: It can only be used with application keys belonging to administrators.  # noqa: E501
              This method makes a synchronous HTTP request by default. To make an
              asynchronous HTTP request, please pass async_req=True
  
              >>> thread = api.update_user(user_handle, body, async_req=True)
              >>> result = thread.get()
  
              Args:
                  user_handle (str): The ID of the user.
                  body (User): Description of the update.
  
              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 (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:
                  UserResponse
                      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')
              kwargs['user_handle'] = \
                  user_handle
              kwargs['body'] = \
                  body
              return self.call_with_http_info(**kwargs)
  
          self.update_user = Endpoint(
              settings={
                  'response_type': (UserResponse,),
                  'auth': [
                      'apiKeyAuth',
                      'appKeyAuth'
                  ],
                  'endpoint_path': '/api/v1/user/{user_handle}',
                  'operation_id': 'update_user',
                  'http_method': 'PUT',
                  'servers': None,
              },
              params_map={
                  'all': [
                      'user_handle',
                      'body',
                  ],
                  'required': [
                      'user_handle',
                      'body',
                  ],
                  'nullable': [
                  ],
                  'enum': [
                  ],
                  'validation': [
                  ]
              },
              root_map={
                  'validations': {
                  },
                  'allowed_values': {
                  },
                  'openapi_types': {
                      'user_handle':
                          (str,),
                      'body':
                          (User,),
                  },
                  'attribute_map': {
                      'user_handle': 'user_handle',
                  },
                  'location_map': {
                      'user_handle': 'path',
                      'body': 'body',
                  },
                  'collection_format_map': {
                  }
              },
              headers_map={
                  'accept': [
                      'application/json'
                  ],
                  'content_type': [
                      'application/json'
                  ]
              },
              api_client=api_client,
              callable=__update_user
          )
  