text: # coding: utf-8
  
  """
      Determined API (Beta)
  
      Determined helps deep learning teams train models more quickly, easily share GPU resources, and effectively collaborate. Determined allows deep learning engineers to focus on building and training models at scale, without needing to worry about DevOps or writing custom code for common tasks like fault tolerance or experiment tracking.  You can think of Determined as a platform that bridges the gap between tools like TensorFlow and PyTorch --- which work great for a single researcher with a single GPU --- to the challenges that arise when doing deep learning at scale, as teams, clusters, and data sets all increase in size.  # noqa: E501
  
      OpenAPI spec version: 0.1
      Contact: community@determined.ai
      Generated by: https://github.com/swagger-api/swagger-codegen.git
  """
  
  
  from __future__ import absolute_import
  
  import re  # noqa: F401
  
  # python 2 and python 3 compatibility library
  import six
  
  from determined._swagger.client.api_client import ApiClient
  
  
  class UsersApi(object):
      """NOTE: This class is auto generated by the swagger code generator program.
  
      Do not edit the class manually.
      Ref: https://github.com/swagger-api/swagger-codegen
      """
  
      def __init__(self, api_client=None):
          if api_client is None:
              api_client = ApiClient()
          self.api_client = api_client
  
      def determined_get_user(self, username, **kwargs):  # noqa: E501
          """Get the requested user.  # noqa: E501
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async_req=True
          >>> thread = api.determined_get_user(username, async_req=True)
          >>> result = thread.get()
  
          :param async_req bool
          :param str username: The username of the user. (required)
          :return: V1GetUserResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('async_req'):
              return self.determined_get_user_with_http_info(username, **kwargs)  # noqa: E501
          else:
              (data) = self.determined_get_user_with_http_info(username, **kwargs)  # noqa: E501
              return data
  
      def determined_get_user_with_http_info(self, username, **kwargs):  # noqa: E501
          """Get the requested user.  # noqa: E501
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async_req=True
          >>> thread = api.determined_get_user_with_http_info(username, async_req=True)
          >>> result = thread.get()
  
          :param async_req bool
          :param str username: The username of the user. (required)
          :return: V1GetUserResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['username']  # noqa: E501
          all_params.append('async_req')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in six.iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method determined_get_user" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'username' is set
          if ('username' not in params or
                  params['username'] is None):
              raise ValueError("Missing the required parameter `username` when calling `determined_get_user`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
          if 'username' in params:
              path_params['username'] = params['username']  # noqa: E501
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/json'])  # noqa: E501
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
              ['application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = ['BearerToken']  # noqa: E501
  
          return self.api_client.call_api(
              '/api/v1/users/{username}', 'GET',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='V1GetUserResponse',  # noqa: E501
              auth_settings=auth_settings,
              async_req=params.get('async_req'),
              _return_http_data_only=params.get('_return_http_data_only'),
              _preload_content=params.get('_preload_content', True),
              _request_timeout=params.get('_request_timeout'),
              collection_formats=collection_formats)
  
      def determined_get_users(self, **kwargs):  # noqa: E501
          """Get a list of users.  # noqa: E501
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async_req=True
          >>> thread = api.determined_get_users(async_req=True)
          >>> result = thread.get()
  
          :param async_req bool
          :return: V1GetUsersResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('async_req'):
              return self.determined_get_users_with_http_info(**kwargs)  # noqa: E501
          else:
              (data) = self.determined_get_users_with_http_info(**kwargs)  # noqa: E501
              return data
  
      def determined_get_users_with_http_info(self, **kwargs):  # noqa: E501
          """Get a list of users.  # noqa: E501
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async_req=True
          >>> thread = api.determined_get_users_with_http_info(async_req=True)
          >>> result = thread.get()
  
          :param async_req bool
          :return: V1GetUsersResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = []  # noqa: E501
          all_params.append('async_req')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in six.iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method determined_get_users" % key
                  )
              params[key] = val
          del params['kwargs']
  
          collection_formats = {}
  
          path_params = {}
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/json'])  # noqa: E501
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
              ['application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = ['BearerToken']  # noqa: E501
  
          return self.api_client.call_api(
              '/api/v1/users', 'GET',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='V1GetUsersResponse',  # noqa: E501
              auth_settings=auth_settings,
              async_req=params.get('async_req'),
              _return_http_data_only=params.get('_return_http_data_only'),
              _preload_content=params.get('_preload_content', True),
              _request_timeout=params.get('_request_timeout'),
              collection_formats=collection_formats)
  
      def determined_post_user(self, body, **kwargs):  # noqa: E501
          """Create a new user.  # noqa: E501
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async_req=True
          >>> thread = api.determined_post_user(body, async_req=True)
          >>> result = thread.get()
  
          :param async_req bool
          :param V1PostUserRequest body: (required)
          :return: V1PostUserResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('async_req'):
              return self.determined_post_user_with_http_info(body, **kwargs)  # noqa: E501
          else:
              (data) = self.determined_post_user_with_http_info(body, **kwargs)  # noqa: E501
              return data
  
      def determined_post_user_with_http_info(self, body, **kwargs):  # noqa: E501
          """Create a new user.  # noqa: E501
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async_req=True
          >>> thread = api.determined_post_user_with_http_info(body, async_req=True)
          >>> result = thread.get()
  
          :param async_req bool
          :param V1PostUserRequest body: (required)
          :return: V1PostUserResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['body']  # noqa: E501
          all_params.append('async_req')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in six.iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method determined_post_user" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'body' is set
          if ('body' not in params or
                  params['body'] is None):
              raise ValueError("Missing the required parameter `body` when calling `determined_post_user`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'body' in params:
              body_params = params['body']
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/json'])  # noqa: E501
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
              ['application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = ['BearerToken']  # noqa: E501
  
          return self.api_client.call_api(
              '/api/v1/users', 'POST',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='V1PostUserResponse',  # noqa: E501
              auth_settings=auth_settings,
              async_req=params.get('async_req'),
              _return_http_data_only=params.get('_return_http_data_only'),
              _preload_content=params.get('_preload_content', True),
              _request_timeout=params.get('_request_timeout'),
              collection_formats=collection_formats)
  
      def determined_set_user_password(self, username, body, **kwargs):  # noqa: E501
          """Set the requested user's password.  # noqa: E501
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async_req=True
          >>> thread = api.determined_set_user_password(username, body, async_req=True)
          >>> result = thread.get()
  
          :param async_req bool
          :param str username: The username of the user. (required)
          :param str body: The password of the user. (required)
          :return: V1SetUserPasswordResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
          kwargs['_return_http_data_only'] = True
          if kwargs.get('async_req'):
              return self.determined_set_user_password_with_http_info(username, body, **kwargs)  # noqa: E501
          else:
              (data) = self.determined_set_user_password_with_http_info(username, body, **kwargs)  # noqa: E501
              return data
  
      def determined_set_user_password_with_http_info(self, username, body, **kwargs):  # noqa: E501
          """Set the requested user's password.  # noqa: E501
  
          This method makes a synchronous HTTP request by default. To make an
          asynchronous HTTP request, please pass async_req=True
          >>> thread = api.determined_set_user_password_with_http_info(username, body, async_req=True)
          >>> result = thread.get()
  
          :param async_req bool
          :param str username: The username of the user. (required)
          :param str body: The password of the user. (required)
          :return: V1SetUserPasswordResponse
                   If the method is called asynchronously,
                   returns the request thread.
          """
  
          all_params = ['username', 'body']  # noqa: E501
          all_params.append('async_req')
          all_params.append('_return_http_data_only')
          all_params.append('_preload_content')
          all_params.append('_request_timeout')
  
          params = locals()
          for key, val in six.iteritems(params['kwargs']):
              if key not in all_params:
                  raise TypeError(
                      "Got an unexpected keyword argument '%s'"
                      " to method determined_set_user_password" % key
                  )
              params[key] = val
          del params['kwargs']
          # verify the required parameter 'username' is set
          if ('username' not in params or
                  params['username'] is None):
              raise ValueError("Missing the required parameter `username` when calling `determined_set_user_password`")  # noqa: E501
          # verify the required parameter 'body' is set
          if ('body' not in params or
                  params['body'] is None):
              raise ValueError("Missing the required parameter `body` when calling `determined_set_user_password`")  # noqa: E501
  
          collection_formats = {}
  
          path_params = {}
          if 'username' in params:
              path_params['username'] = params['username']  # noqa: E501
  
          query_params = []
  
          header_params = {}
  
          form_params = []
          local_var_files = {}
  
          body_params = None
          if 'body' in params:
              body_params = params['body']
          # HTTP header `Accept`
          header_params['Accept'] = self.api_client.select_header_accept(
              ['application/json'])  # noqa: E501
  
          # HTTP header `Content-Type`
          header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
              ['application/json'])  # noqa: E501
  
          # Authentication setting
          auth_settings = ['BearerToken']  # noqa: E501
  
          return self.api_client.call_api(
              '/api/v1/users/{username}/password', 'POST',
              path_params,
              query_params,
              header_params,
              body=body_params,
              post_params=form_params,
              files=local_var_files,
              response_type='V1SetUserPasswordResponse',  # noqa: E501
              auth_settings=auth_settings,
              async_req=params.get('async_req'),
              _return_http_data_only=params.get('_return_http_data_only'),
              _preload_content=params.get('_preload_content', True),
              _request_timeout=params.get('_request_timeout'),
              collection_formats=collection_formats)
  