docusign_esign.apis.authentication_api

Docusign eSignature REST API

The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign. # noqa: E501

OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git

  1# coding: utf-8
  2
  3"""
  4    Docusign eSignature REST API
  5
  6    The Docusign eSignature REST API provides you with a powerful, convenient, and simple Web services API for interacting with Docusign.  # noqa: E501
  7
  8    OpenAPI spec version: v2.1
  9    Contact: devcenter@docusign.com
 10    Generated by: https://github.com/swagger-api/swagger-codegen.git
 11"""
 12
 13
 14from __future__ import absolute_import
 15
 16import sys
 17import os
 18import re
 19
 20# python 2 and python 3 compatibility library
 21from six import iteritems
 22
 23from ..client.configuration import Configuration
 24from ..client.api_client import ApiClient
 25
 26
 27class AuthenticationApi(object):
 28    """
 29    NOTE: This class is auto generated by the swagger code generator program.
 30    Do not edit the class manually.
 31    Ref: https://github.com/swagger-api/swagger-codegen
 32    """
 33
 34    def __init__(self, api_client=None):
 35        config = Configuration()
 36        if api_client:
 37            self.api_client = api_client
 38        else:
 39            if not config.api_client:
 40                config.api_client = ApiClient()
 41            self.api_client = config.api_client
 42
 43    def delete_social_login(self, account_id, user_id, **kwargs):
 44        """
 45        Deletes user's social account.
 46        Deletes a social account from a use's account.
 47        This method makes a synchronous HTTP request by default. To make an
 48        asynchronous HTTP request, please define a `callback` function
 49        to be invoked when receiving the response.
 50        >>> def callback_function(response):
 51        >>>     pprint(response)
 52        >>>
 53        >>> thread = api.delete_social_login(account_id, user_id, callback=callback_function)
 54
 55        :param callback function: The callback function
 56            for asynchronous request. (optional)
 57        :param str account_id: The external account number (int) or account ID Guid. (required)
 58        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
 59        :param SocialAccountInformation social_account_information:
 60        :return: None
 61                 If the method is called asynchronously,
 62                 returns the request thread.
 63        """
 64        kwargs['_return_http_data_only'] = True
 65        if kwargs.get('callback'):
 66            return self.delete_social_login_with_http_info(account_id, user_id, **kwargs)
 67        else:
 68            (data) = self.delete_social_login_with_http_info(account_id, user_id, **kwargs)
 69            return data
 70
 71    def delete_social_login_with_http_info(self, account_id, user_id, **kwargs):
 72        """
 73        Deletes user's social account.
 74        Deletes a social account from a use's account.
 75        This method makes a synchronous HTTP request by default. To make an
 76        asynchronous HTTP request, please define a `callback` function
 77        to be invoked when receiving the response.
 78        >>> def callback_function(response):
 79        >>>     pprint(response)
 80        >>>
 81        >>> thread = api.delete_social_login_with_http_info(account_id, user_id, callback=callback_function)
 82
 83        :param callback function: The callback function
 84            for asynchronous request. (optional)
 85        :param str account_id: The external account number (int) or account ID Guid. (required)
 86        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
 87        :param SocialAccountInformation social_account_information:
 88        :return: None
 89                 If the method is called asynchronously,
 90                 returns the request thread.
 91        """
 92
 93        all_params = ['account_id', 'user_id', 'social_account_information']
 94        all_params.append('callback')
 95        all_params.append('_return_http_data_only')
 96        all_params.append('_preload_content')
 97        all_params.append('_request_timeout')
 98
 99        params = locals()
100        for key, val in iteritems(params['kwargs']):
101            if key not in all_params:
102                raise TypeError(
103                    "Got an unexpected keyword argument '%s'"
104                    " to method delete_social_login" % key
105                )
106            params[key] = val
107        del params['kwargs']
108        # verify the required parameter 'account_id' is set
109        if ('account_id' not in params) or (params['account_id'] is None):
110            raise ValueError("Missing the required parameter `account_id` when calling `delete_social_login`")
111        # verify the required parameter 'user_id' is set
112        if ('user_id' not in params) or (params['user_id'] is None):
113            raise ValueError("Missing the required parameter `user_id` when calling `delete_social_login`")
114
115
116        collection_formats = {}
117
118        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
119        path_params = {}
120        if 'account_id' in params:
121            path_params['accountId'] = params['account_id']
122        if 'user_id' in params:
123            path_params['userId'] = params['user_id']
124
125        query_params = {}
126
127        header_params = {}
128
129        form_params = []
130        local_var_files = {}
131
132        body_params = None
133        if 'social_account_information' in params:
134            body_params = params['social_account_information']
135        # HTTP header `Accept`
136        header_params['Accept'] = self.api_client.\
137            select_header_accept(['application/json'])
138
139        # Authentication setting
140        auth_settings = []
141
142        return self.api_client.call_api(resource_path, 'DELETE',
143                                        path_params,
144                                        query_params,
145                                        header_params,
146                                        body=body_params,
147                                        post_params=form_params,
148                                        files=local_var_files,
149                                        response_type=None,
150                                        auth_settings=auth_settings,
151                                        callback=params.get('callback'),
152                                        _return_http_data_only=params.get('_return_http_data_only'),
153                                        _preload_content=params.get('_preload_content', True),
154                                        _request_timeout=params.get('_request_timeout'),
155                                        collection_formats=collection_formats)
156
157    def get_o_auth_token(self, **kwargs):
158        """
159        Creates an authorization token.
160        Creates an OAuth2 authorization server token endpoint.
161        This method makes a synchronous HTTP request by default. To make an
162        asynchronous HTTP request, please define a `callback` function
163        to be invoked when receiving the response.
164        >>> def callback_function(response):
165        >>>     pprint(response)
166        >>>
167        >>> thread = api.get_o_auth_token(callback=callback_function)
168
169        :param callback function: The callback function
170            for asynchronous request. (optional)
171        :return: OauthAccess
172                 If the method is called asynchronously,
173                 returns the request thread.
174        """
175        kwargs['_return_http_data_only'] = True
176        if kwargs.get('callback'):
177            return self.get_o_auth_token_with_http_info(**kwargs)
178        else:
179            (data) = self.get_o_auth_token_with_http_info(**kwargs)
180            return data
181
182    def get_o_auth_token_with_http_info(self, **kwargs):
183        """
184        Creates an authorization token.
185        Creates an OAuth2 authorization server token endpoint.
186        This method makes a synchronous HTTP request by default. To make an
187        asynchronous HTTP request, please define a `callback` function
188        to be invoked when receiving the response.
189        >>> def callback_function(response):
190        >>>     pprint(response)
191        >>>
192        >>> thread = api.get_o_auth_token_with_http_info(callback=callback_function)
193
194        :param callback function: The callback function
195            for asynchronous request. (optional)
196        :return: OauthAccess
197                 If the method is called asynchronously,
198                 returns the request thread.
199        """
200
201        all_params = []
202        all_params.append('callback')
203        all_params.append('_return_http_data_only')
204        all_params.append('_preload_content')
205        all_params.append('_request_timeout')
206
207        params = locals()
208        for key, val in iteritems(params['kwargs']):
209            if key not in all_params:
210                raise TypeError(
211                    "Got an unexpected keyword argument '%s'"
212                    " to method get_o_auth_token" % key
213                )
214            params[key] = val
215        del params['kwargs']
216
217        collection_formats = {}
218
219        resource_path = '/v2.1/oauth2/token'.replace('{format}', 'json')
220        path_params = {}
221
222        query_params = {}
223
224        header_params = {}
225
226        form_params = []
227        local_var_files = {}
228
229        body_params = None
230        # HTTP header `Accept`
231        header_params['Accept'] = self.api_client.\
232            select_header_accept(['application/json'])
233
234        # Authentication setting
235        auth_settings = []
236
237        return self.api_client.call_api(resource_path, 'POST',
238                                        path_params,
239                                        query_params,
240                                        header_params,
241                                        body=body_params,
242                                        post_params=form_params,
243                                        files=local_var_files,
244                                        response_type='OauthAccess',
245                                        auth_settings=auth_settings,
246                                        callback=params.get('callback'),
247                                        _return_http_data_only=params.get('_return_http_data_only'),
248                                        _preload_content=params.get('_preload_content', True),
249                                        _request_timeout=params.get('_request_timeout'),
250                                        collection_formats=collection_formats)
251
252    def list_social_logins(self, account_id, user_id, **kwargs):
253        """
254        Gets a list of a user's social accounts.
255        Retrieves a list of social accounts linked to a user's account.
256        This method makes a synchronous HTTP request by default. To make an
257        asynchronous HTTP request, please define a `callback` function
258        to be invoked when receiving the response.
259        >>> def callback_function(response):
260        >>>     pprint(response)
261        >>>
262        >>> thread = api.list_social_logins(account_id, user_id, callback=callback_function)
263
264        :param callback function: The callback function
265            for asynchronous request. (optional)
266        :param str account_id: The external account number (int) or account ID Guid. (required)
267        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
268        :return: UserSocialIdResult
269                 If the method is called asynchronously,
270                 returns the request thread.
271        """
272        kwargs['_return_http_data_only'] = True
273        if kwargs.get('callback'):
274            return self.list_social_logins_with_http_info(account_id, user_id, **kwargs)
275        else:
276            (data) = self.list_social_logins_with_http_info(account_id, user_id, **kwargs)
277            return data
278
279    def list_social_logins_with_http_info(self, account_id, user_id, **kwargs):
280        """
281        Gets a list of a user's social accounts.
282        Retrieves a list of social accounts linked to a user's account.
283        This method makes a synchronous HTTP request by default. To make an
284        asynchronous HTTP request, please define a `callback` function
285        to be invoked when receiving the response.
286        >>> def callback_function(response):
287        >>>     pprint(response)
288        >>>
289        >>> thread = api.list_social_logins_with_http_info(account_id, user_id, callback=callback_function)
290
291        :param callback function: The callback function
292            for asynchronous request. (optional)
293        :param str account_id: The external account number (int) or account ID Guid. (required)
294        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
295        :return: UserSocialIdResult
296                 If the method is called asynchronously,
297                 returns the request thread.
298        """
299
300        all_params = ['account_id', 'user_id']
301        all_params.append('callback')
302        all_params.append('_return_http_data_only')
303        all_params.append('_preload_content')
304        all_params.append('_request_timeout')
305
306        params = locals()
307        for key, val in iteritems(params['kwargs']):
308            if key not in all_params:
309                raise TypeError(
310                    "Got an unexpected keyword argument '%s'"
311                    " to method list_social_logins" % key
312                )
313            params[key] = val
314        del params['kwargs']
315        # verify the required parameter 'account_id' is set
316        if ('account_id' not in params) or (params['account_id'] is None):
317            raise ValueError("Missing the required parameter `account_id` when calling `list_social_logins`")
318        # verify the required parameter 'user_id' is set
319        if ('user_id' not in params) or (params['user_id'] is None):
320            raise ValueError("Missing the required parameter `user_id` when calling `list_social_logins`")
321
322
323        collection_formats = {}
324
325        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
326        path_params = {}
327        if 'account_id' in params:
328            path_params['accountId'] = params['account_id']
329        if 'user_id' in params:
330            path_params['userId'] = params['user_id']
331
332        query_params = {}
333
334        header_params = {}
335
336        form_params = []
337        local_var_files = {}
338
339        body_params = None
340        # HTTP header `Accept`
341        header_params['Accept'] = self.api_client.\
342            select_header_accept(['application/json'])
343
344        # Authentication setting
345        auth_settings = []
346
347        return self.api_client.call_api(resource_path, 'GET',
348                                        path_params,
349                                        query_params,
350                                        header_params,
351                                        body=body_params,
352                                        post_params=form_params,
353                                        files=local_var_files,
354                                        response_type='UserSocialIdResult',
355                                        auth_settings=auth_settings,
356                                        callback=params.get('callback'),
357                                        _return_http_data_only=params.get('_return_http_data_only'),
358                                        _preload_content=params.get('_preload_content', True),
359                                        _request_timeout=params.get('_request_timeout'),
360                                        collection_formats=collection_formats)
361
362    def login(self, **kwargs):
363        """
364        Gets login information for a specified user.
365        Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.    The `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
366        This method makes a synchronous HTTP request by default. To make an
367        asynchronous HTTP request, please define a `callback` function
368        to be invoked when receiving the response.
369        >>> def callback_function(response):
370        >>>     pprint(response)
371        >>>
372        >>> thread = api.login(callback=callback_function)
373
374        :param callback function: The callback function
375            for asynchronous request. (optional)
376        :param str api_password: When set to **true**, shows the account API password in the response.
377        :param str embed_account_id_guid:
378        :param str include_account_id_guid: When set to **true**, shows the account ID GUID in the response.
379        :param str login_settings: Determines whether login settings are returned in the response.  Valid Values:  * all -  All the login settings are returned.  * none - no login settings are returned.
380        :return: LoginInformation
381                 If the method is called asynchronously,
382                 returns the request thread.
383        """
384        kwargs['_return_http_data_only'] = True
385        if kwargs.get('callback'):
386            return self.login_with_http_info(**kwargs)
387        else:
388            (data) = self.login_with_http_info(**kwargs)
389            return data
390
391    def login_with_http_info(self, **kwargs):
392        """
393        Gets login information for a specified user.
394        Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.    The `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
395        This method makes a synchronous HTTP request by default. To make an
396        asynchronous HTTP request, please define a `callback` function
397        to be invoked when receiving the response.
398        >>> def callback_function(response):
399        >>>     pprint(response)
400        >>>
401        >>> thread = api.login_with_http_info(callback=callback_function)
402
403        :param callback function: The callback function
404            for asynchronous request. (optional)
405        :param str api_password: When set to **true**, shows the account API password in the response.
406        :param str embed_account_id_guid:
407        :param str include_account_id_guid: When set to **true**, shows the account ID GUID in the response.
408        :param str login_settings: Determines whether login settings are returned in the response.  Valid Values:  * all -  All the login settings are returned.  * none - no login settings are returned.
409        :return: LoginInformation
410                 If the method is called asynchronously,
411                 returns the request thread.
412        """
413
414        all_params = ['api_password', 'embed_account_id_guid', 'include_account_id_guid', 'login_settings']
415        all_params.append('callback')
416        all_params.append('_return_http_data_only')
417        all_params.append('_preload_content')
418        all_params.append('_request_timeout')
419
420        params = locals()
421        for key, val in iteritems(params['kwargs']):
422            if key not in all_params:
423                raise TypeError(
424                    "Got an unexpected keyword argument '%s'"
425                    " to method login" % key
426                )
427            params[key] = val
428        del params['kwargs']
429
430
431        collection_formats = {}
432
433        resource_path = '/v2.1/login_information'.replace('{format}', 'json')
434        path_params = {}
435
436        query_params = {}
437        if 'api_password' in params:
438            query_params['api_password'] = params['api_password']
439        if 'embed_account_id_guid' in params:
440            query_params['embed_account_id_guid'] = params['embed_account_id_guid']
441        if 'include_account_id_guid' in params:
442            query_params['include_account_id_guid'] = params['include_account_id_guid']
443        if 'login_settings' in params:
444            query_params['login_settings'] = params['login_settings']
445
446        header_params = {}
447
448        form_params = []
449        local_var_files = {}
450
451        body_params = None
452        # HTTP header `Accept`
453        header_params['Accept'] = self.api_client.\
454            select_header_accept(['application/json'])
455
456        # Authentication setting
457        auth_settings = []
458
459        return self.api_client.call_api(resource_path, 'GET',
460                                        path_params,
461                                        query_params,
462                                        header_params,
463                                        body=body_params,
464                                        post_params=form_params,
465                                        files=local_var_files,
466                                        response_type='LoginInformation',
467                                        auth_settings=auth_settings,
468                                        callback=params.get('callback'),
469                                        _return_http_data_only=params.get('_return_http_data_only'),
470                                        _preload_content=params.get('_preload_content', True),
471                                        _request_timeout=params.get('_request_timeout'),
472                                        collection_formats=collection_formats)
473
474    def revoke_o_auth_token(self, **kwargs):
475        """
476        Revokes an authorization token.
477        Revokes an OAuth2 authorization server token. After the revocation is complete, a caller must re-authenticate to restore access.
478        This method makes a synchronous HTTP request by default. To make an
479        asynchronous HTTP request, please define a `callback` function
480        to be invoked when receiving the response.
481        >>> def callback_function(response):
482        >>>     pprint(response)
483        >>>
484        >>> thread = api.revoke_o_auth_token(callback=callback_function)
485
486        :param callback function: The callback function
487            for asynchronous request. (optional)
488        :return: None
489                 If the method is called asynchronously,
490                 returns the request thread.
491        """
492        kwargs['_return_http_data_only'] = True
493        if kwargs.get('callback'):
494            return self.revoke_o_auth_token_with_http_info(**kwargs)
495        else:
496            (data) = self.revoke_o_auth_token_with_http_info(**kwargs)
497            return data
498
499    def revoke_o_auth_token_with_http_info(self, **kwargs):
500        """
501        Revokes an authorization token.
502        Revokes an OAuth2 authorization server token. After the revocation is complete, a caller must re-authenticate to restore access.
503        This method makes a synchronous HTTP request by default. To make an
504        asynchronous HTTP request, please define a `callback` function
505        to be invoked when receiving the response.
506        >>> def callback_function(response):
507        >>>     pprint(response)
508        >>>
509        >>> thread = api.revoke_o_auth_token_with_http_info(callback=callback_function)
510
511        :param callback function: The callback function
512            for asynchronous request. (optional)
513        :return: None
514                 If the method is called asynchronously,
515                 returns the request thread.
516        """
517
518        all_params = []
519        all_params.append('callback')
520        all_params.append('_return_http_data_only')
521        all_params.append('_preload_content')
522        all_params.append('_request_timeout')
523
524        params = locals()
525        for key, val in iteritems(params['kwargs']):
526            if key not in all_params:
527                raise TypeError(
528                    "Got an unexpected keyword argument '%s'"
529                    " to method revoke_o_auth_token" % key
530                )
531            params[key] = val
532        del params['kwargs']
533
534        collection_formats = {}
535
536        resource_path = '/v2.1/oauth2/revoke'.replace('{format}', 'json')
537        path_params = {}
538
539        query_params = {}
540
541        header_params = {}
542
543        form_params = []
544        local_var_files = {}
545
546        body_params = None
547        # HTTP header `Accept`
548        header_params['Accept'] = self.api_client.\
549            select_header_accept(['application/json'])
550
551        # Authentication setting
552        auth_settings = []
553
554        return self.api_client.call_api(resource_path, 'POST',
555                                        path_params,
556                                        query_params,
557                                        header_params,
558                                        body=body_params,
559                                        post_params=form_params,
560                                        files=local_var_files,
561                                        response_type=None,
562                                        auth_settings=auth_settings,
563                                        callback=params.get('callback'),
564                                        _return_http_data_only=params.get('_return_http_data_only'),
565                                        _preload_content=params.get('_preload_content', True),
566                                        _request_timeout=params.get('_request_timeout'),
567                                        collection_formats=collection_formats)
568
569    def update_password(self, login_part, **kwargs):
570        """
571        Updates the password for a specified user.
572        Updates the password for a specified user.
573        This method makes a synchronous HTTP request by default. To make an
574        asynchronous HTTP request, please define a `callback` function
575        to be invoked when receiving the response.
576        >>> def callback_function(response):
577        >>>     pprint(response)
578        >>>
579        >>> thread = api.update_password(login_part, callback=callback_function)
580
581        :param callback function: The callback function
582            for asynchronous request. (optional)
583        :param str login_part: Currently, only the value **password** is supported. (required)
584        :param UserPasswordInformation user_password_information:
585        :return: None
586                 If the method is called asynchronously,
587                 returns the request thread.
588        """
589        kwargs['_return_http_data_only'] = True
590        if kwargs.get('callback'):
591            return self.update_password_with_http_info(login_part, **kwargs)
592        else:
593            (data) = self.update_password_with_http_info(login_part, **kwargs)
594            return data
595
596    def update_password_with_http_info(self, login_part, **kwargs):
597        """
598        Updates the password for a specified user.
599        Updates the password for a specified user.
600        This method makes a synchronous HTTP request by default. To make an
601        asynchronous HTTP request, please define a `callback` function
602        to be invoked when receiving the response.
603        >>> def callback_function(response):
604        >>>     pprint(response)
605        >>>
606        >>> thread = api.update_password_with_http_info(login_part, callback=callback_function)
607
608        :param callback function: The callback function
609            for asynchronous request. (optional)
610        :param str login_part: Currently, only the value **password** is supported. (required)
611        :param UserPasswordInformation user_password_information:
612        :return: None
613                 If the method is called asynchronously,
614                 returns the request thread.
615        """
616
617        all_params = ['login_part', 'user_password_information']
618        all_params.append('callback')
619        all_params.append('_return_http_data_only')
620        all_params.append('_preload_content')
621        all_params.append('_request_timeout')
622
623        params = locals()
624        for key, val in iteritems(params['kwargs']):
625            if key not in all_params:
626                raise TypeError(
627                    "Got an unexpected keyword argument '%s'"
628                    " to method update_password" % key
629                )
630            params[key] = val
631        del params['kwargs']
632        # verify the required parameter 'login_part' is set
633        if ('login_part' not in params) or (params['login_part'] is None):
634            raise ValueError("Missing the required parameter `login_part` when calling `update_password`")
635
636
637        collection_formats = {}
638
639        resource_path = '/v2.1/login_information/{loginPart}'.replace('{format}', 'json')
640        path_params = {}
641        if 'login_part' in params:
642            path_params['loginPart'] = params['login_part']
643
644        query_params = {}
645
646        header_params = {}
647
648        form_params = []
649        local_var_files = {}
650
651        body_params = None
652        if 'user_password_information' in params:
653            body_params = params['user_password_information']
654        # HTTP header `Accept`
655        header_params['Accept'] = self.api_client.\
656            select_header_accept(['application/json'])
657
658        # Authentication setting
659        auth_settings = []
660
661        return self.api_client.call_api(resource_path, 'PUT',
662                                        path_params,
663                                        query_params,
664                                        header_params,
665                                        body=body_params,
666                                        post_params=form_params,
667                                        files=local_var_files,
668                                        response_type=None,
669                                        auth_settings=auth_settings,
670                                        callback=params.get('callback'),
671                                        _return_http_data_only=params.get('_return_http_data_only'),
672                                        _preload_content=params.get('_preload_content', True),
673                                        _request_timeout=params.get('_request_timeout'),
674                                        collection_formats=collection_formats)
675
676    def update_social_login(self, account_id, user_id, **kwargs):
677        """
678        Adds social account for a user.
679        Adds a new social account to a user's account.
680        This method makes a synchronous HTTP request by default. To make an
681        asynchronous HTTP request, please define a `callback` function
682        to be invoked when receiving the response.
683        >>> def callback_function(response):
684        >>>     pprint(response)
685        >>>
686        >>> thread = api.update_social_login(account_id, user_id, callback=callback_function)
687
688        :param callback function: The callback function
689            for asynchronous request. (optional)
690        :param str account_id: The external account number (int) or account ID Guid. (required)
691        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
692        :param SocialAccountInformation social_account_information:
693        :return: None
694                 If the method is called asynchronously,
695                 returns the request thread.
696        """
697        kwargs['_return_http_data_only'] = True
698        if kwargs.get('callback'):
699            return self.update_social_login_with_http_info(account_id, user_id, **kwargs)
700        else:
701            (data) = self.update_social_login_with_http_info(account_id, user_id, **kwargs)
702            return data
703
704    def update_social_login_with_http_info(self, account_id, user_id, **kwargs):
705        """
706        Adds social account for a user.
707        Adds a new social account to a user's account.
708        This method makes a synchronous HTTP request by default. To make an
709        asynchronous HTTP request, please define a `callback` function
710        to be invoked when receiving the response.
711        >>> def callback_function(response):
712        >>>     pprint(response)
713        >>>
714        >>> thread = api.update_social_login_with_http_info(account_id, user_id, callback=callback_function)
715
716        :param callback function: The callback function
717            for asynchronous request. (optional)
718        :param str account_id: The external account number (int) or account ID Guid. (required)
719        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
720        :param SocialAccountInformation social_account_information:
721        :return: None
722                 If the method is called asynchronously,
723                 returns the request thread.
724        """
725
726        all_params = ['account_id', 'user_id', 'social_account_information']
727        all_params.append('callback')
728        all_params.append('_return_http_data_only')
729        all_params.append('_preload_content')
730        all_params.append('_request_timeout')
731
732        params = locals()
733        for key, val in iteritems(params['kwargs']):
734            if key not in all_params:
735                raise TypeError(
736                    "Got an unexpected keyword argument '%s'"
737                    " to method update_social_login" % key
738                )
739            params[key] = val
740        del params['kwargs']
741        # verify the required parameter 'account_id' is set
742        if ('account_id' not in params) or (params['account_id'] is None):
743            raise ValueError("Missing the required parameter `account_id` when calling `update_social_login`")
744        # verify the required parameter 'user_id' is set
745        if ('user_id' not in params) or (params['user_id'] is None):
746            raise ValueError("Missing the required parameter `user_id` when calling `update_social_login`")
747
748
749        collection_formats = {}
750
751        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
752        path_params = {}
753        if 'account_id' in params:
754            path_params['accountId'] = params['account_id']
755        if 'user_id' in params:
756            path_params['userId'] = params['user_id']
757
758        query_params = {}
759
760        header_params = {}
761
762        form_params = []
763        local_var_files = {}
764
765        body_params = None
766        if 'social_account_information' in params:
767            body_params = params['social_account_information']
768        # HTTP header `Accept`
769        header_params['Accept'] = self.api_client.\
770            select_header_accept(['application/json'])
771
772        # Authentication setting
773        auth_settings = []
774
775        return self.api_client.call_api(resource_path, 'PUT',
776                                        path_params,
777                                        query_params,
778                                        header_params,
779                                        body=body_params,
780                                        post_params=form_params,
781                                        files=local_var_files,
782                                        response_type=None,
783                                        auth_settings=auth_settings,
784                                        callback=params.get('callback'),
785                                        _return_http_data_only=params.get('_return_http_data_only'),
786                                        _preload_content=params.get('_preload_content', True),
787                                        _request_timeout=params.get('_request_timeout'),
788                                        collection_formats=collection_formats)
class AuthenticationApi:
 28class AuthenticationApi(object):
 29    """
 30    NOTE: This class is auto generated by the swagger code generator program.
 31    Do not edit the class manually.
 32    Ref: https://github.com/swagger-api/swagger-codegen
 33    """
 34
 35    def __init__(self, api_client=None):
 36        config = Configuration()
 37        if api_client:
 38            self.api_client = api_client
 39        else:
 40            if not config.api_client:
 41                config.api_client = ApiClient()
 42            self.api_client = config.api_client
 43
 44    def delete_social_login(self, account_id, user_id, **kwargs):
 45        """
 46        Deletes user's social account.
 47        Deletes a social account from a use's account.
 48        This method makes a synchronous HTTP request by default. To make an
 49        asynchronous HTTP request, please define a `callback` function
 50        to be invoked when receiving the response.
 51        >>> def callback_function(response):
 52        >>>     pprint(response)
 53        >>>
 54        >>> thread = api.delete_social_login(account_id, user_id, callback=callback_function)
 55
 56        :param callback function: The callback function
 57            for asynchronous request. (optional)
 58        :param str account_id: The external account number (int) or account ID Guid. (required)
 59        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
 60        :param SocialAccountInformation social_account_information:
 61        :return: None
 62                 If the method is called asynchronously,
 63                 returns the request thread.
 64        """
 65        kwargs['_return_http_data_only'] = True
 66        if kwargs.get('callback'):
 67            return self.delete_social_login_with_http_info(account_id, user_id, **kwargs)
 68        else:
 69            (data) = self.delete_social_login_with_http_info(account_id, user_id, **kwargs)
 70            return data
 71
 72    def delete_social_login_with_http_info(self, account_id, user_id, **kwargs):
 73        """
 74        Deletes user's social account.
 75        Deletes a social account from a use's account.
 76        This method makes a synchronous HTTP request by default. To make an
 77        asynchronous HTTP request, please define a `callback` function
 78        to be invoked when receiving the response.
 79        >>> def callback_function(response):
 80        >>>     pprint(response)
 81        >>>
 82        >>> thread = api.delete_social_login_with_http_info(account_id, user_id, callback=callback_function)
 83
 84        :param callback function: The callback function
 85            for asynchronous request. (optional)
 86        :param str account_id: The external account number (int) or account ID Guid. (required)
 87        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
 88        :param SocialAccountInformation social_account_information:
 89        :return: None
 90                 If the method is called asynchronously,
 91                 returns the request thread.
 92        """
 93
 94        all_params = ['account_id', 'user_id', 'social_account_information']
 95        all_params.append('callback')
 96        all_params.append('_return_http_data_only')
 97        all_params.append('_preload_content')
 98        all_params.append('_request_timeout')
 99
100        params = locals()
101        for key, val in iteritems(params['kwargs']):
102            if key not in all_params:
103                raise TypeError(
104                    "Got an unexpected keyword argument '%s'"
105                    " to method delete_social_login" % key
106                )
107            params[key] = val
108        del params['kwargs']
109        # verify the required parameter 'account_id' is set
110        if ('account_id' not in params) or (params['account_id'] is None):
111            raise ValueError("Missing the required parameter `account_id` when calling `delete_social_login`")
112        # verify the required parameter 'user_id' is set
113        if ('user_id' not in params) or (params['user_id'] is None):
114            raise ValueError("Missing the required parameter `user_id` when calling `delete_social_login`")
115
116
117        collection_formats = {}
118
119        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
120        path_params = {}
121        if 'account_id' in params:
122            path_params['accountId'] = params['account_id']
123        if 'user_id' in params:
124            path_params['userId'] = params['user_id']
125
126        query_params = {}
127
128        header_params = {}
129
130        form_params = []
131        local_var_files = {}
132
133        body_params = None
134        if 'social_account_information' in params:
135            body_params = params['social_account_information']
136        # HTTP header `Accept`
137        header_params['Accept'] = self.api_client.\
138            select_header_accept(['application/json'])
139
140        # Authentication setting
141        auth_settings = []
142
143        return self.api_client.call_api(resource_path, 'DELETE',
144                                        path_params,
145                                        query_params,
146                                        header_params,
147                                        body=body_params,
148                                        post_params=form_params,
149                                        files=local_var_files,
150                                        response_type=None,
151                                        auth_settings=auth_settings,
152                                        callback=params.get('callback'),
153                                        _return_http_data_only=params.get('_return_http_data_only'),
154                                        _preload_content=params.get('_preload_content', True),
155                                        _request_timeout=params.get('_request_timeout'),
156                                        collection_formats=collection_formats)
157
158    def get_o_auth_token(self, **kwargs):
159        """
160        Creates an authorization token.
161        Creates an OAuth2 authorization server token endpoint.
162        This method makes a synchronous HTTP request by default. To make an
163        asynchronous HTTP request, please define a `callback` function
164        to be invoked when receiving the response.
165        >>> def callback_function(response):
166        >>>     pprint(response)
167        >>>
168        >>> thread = api.get_o_auth_token(callback=callback_function)
169
170        :param callback function: The callback function
171            for asynchronous request. (optional)
172        :return: OauthAccess
173                 If the method is called asynchronously,
174                 returns the request thread.
175        """
176        kwargs['_return_http_data_only'] = True
177        if kwargs.get('callback'):
178            return self.get_o_auth_token_with_http_info(**kwargs)
179        else:
180            (data) = self.get_o_auth_token_with_http_info(**kwargs)
181            return data
182
183    def get_o_auth_token_with_http_info(self, **kwargs):
184        """
185        Creates an authorization token.
186        Creates an OAuth2 authorization server token endpoint.
187        This method makes a synchronous HTTP request by default. To make an
188        asynchronous HTTP request, please define a `callback` function
189        to be invoked when receiving the response.
190        >>> def callback_function(response):
191        >>>     pprint(response)
192        >>>
193        >>> thread = api.get_o_auth_token_with_http_info(callback=callback_function)
194
195        :param callback function: The callback function
196            for asynchronous request. (optional)
197        :return: OauthAccess
198                 If the method is called asynchronously,
199                 returns the request thread.
200        """
201
202        all_params = []
203        all_params.append('callback')
204        all_params.append('_return_http_data_only')
205        all_params.append('_preload_content')
206        all_params.append('_request_timeout')
207
208        params = locals()
209        for key, val in iteritems(params['kwargs']):
210            if key not in all_params:
211                raise TypeError(
212                    "Got an unexpected keyword argument '%s'"
213                    " to method get_o_auth_token" % key
214                )
215            params[key] = val
216        del params['kwargs']
217
218        collection_formats = {}
219
220        resource_path = '/v2.1/oauth2/token'.replace('{format}', 'json')
221        path_params = {}
222
223        query_params = {}
224
225        header_params = {}
226
227        form_params = []
228        local_var_files = {}
229
230        body_params = None
231        # HTTP header `Accept`
232        header_params['Accept'] = self.api_client.\
233            select_header_accept(['application/json'])
234
235        # Authentication setting
236        auth_settings = []
237
238        return self.api_client.call_api(resource_path, 'POST',
239                                        path_params,
240                                        query_params,
241                                        header_params,
242                                        body=body_params,
243                                        post_params=form_params,
244                                        files=local_var_files,
245                                        response_type='OauthAccess',
246                                        auth_settings=auth_settings,
247                                        callback=params.get('callback'),
248                                        _return_http_data_only=params.get('_return_http_data_only'),
249                                        _preload_content=params.get('_preload_content', True),
250                                        _request_timeout=params.get('_request_timeout'),
251                                        collection_formats=collection_formats)
252
253    def list_social_logins(self, account_id, user_id, **kwargs):
254        """
255        Gets a list of a user's social accounts.
256        Retrieves a list of social accounts linked to a user's account.
257        This method makes a synchronous HTTP request by default. To make an
258        asynchronous HTTP request, please define a `callback` function
259        to be invoked when receiving the response.
260        >>> def callback_function(response):
261        >>>     pprint(response)
262        >>>
263        >>> thread = api.list_social_logins(account_id, user_id, callback=callback_function)
264
265        :param callback function: The callback function
266            for asynchronous request. (optional)
267        :param str account_id: The external account number (int) or account ID Guid. (required)
268        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
269        :return: UserSocialIdResult
270                 If the method is called asynchronously,
271                 returns the request thread.
272        """
273        kwargs['_return_http_data_only'] = True
274        if kwargs.get('callback'):
275            return self.list_social_logins_with_http_info(account_id, user_id, **kwargs)
276        else:
277            (data) = self.list_social_logins_with_http_info(account_id, user_id, **kwargs)
278            return data
279
280    def list_social_logins_with_http_info(self, account_id, user_id, **kwargs):
281        """
282        Gets a list of a user's social accounts.
283        Retrieves a list of social accounts linked to a user's account.
284        This method makes a synchronous HTTP request by default. To make an
285        asynchronous HTTP request, please define a `callback` function
286        to be invoked when receiving the response.
287        >>> def callback_function(response):
288        >>>     pprint(response)
289        >>>
290        >>> thread = api.list_social_logins_with_http_info(account_id, user_id, callback=callback_function)
291
292        :param callback function: The callback function
293            for asynchronous request. (optional)
294        :param str account_id: The external account number (int) or account ID Guid. (required)
295        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
296        :return: UserSocialIdResult
297                 If the method is called asynchronously,
298                 returns the request thread.
299        """
300
301        all_params = ['account_id', 'user_id']
302        all_params.append('callback')
303        all_params.append('_return_http_data_only')
304        all_params.append('_preload_content')
305        all_params.append('_request_timeout')
306
307        params = locals()
308        for key, val in iteritems(params['kwargs']):
309            if key not in all_params:
310                raise TypeError(
311                    "Got an unexpected keyword argument '%s'"
312                    " to method list_social_logins" % key
313                )
314            params[key] = val
315        del params['kwargs']
316        # verify the required parameter 'account_id' is set
317        if ('account_id' not in params) or (params['account_id'] is None):
318            raise ValueError("Missing the required parameter `account_id` when calling `list_social_logins`")
319        # verify the required parameter 'user_id' is set
320        if ('user_id' not in params) or (params['user_id'] is None):
321            raise ValueError("Missing the required parameter `user_id` when calling `list_social_logins`")
322
323
324        collection_formats = {}
325
326        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
327        path_params = {}
328        if 'account_id' in params:
329            path_params['accountId'] = params['account_id']
330        if 'user_id' in params:
331            path_params['userId'] = params['user_id']
332
333        query_params = {}
334
335        header_params = {}
336
337        form_params = []
338        local_var_files = {}
339
340        body_params = None
341        # HTTP header `Accept`
342        header_params['Accept'] = self.api_client.\
343            select_header_accept(['application/json'])
344
345        # Authentication setting
346        auth_settings = []
347
348        return self.api_client.call_api(resource_path, 'GET',
349                                        path_params,
350                                        query_params,
351                                        header_params,
352                                        body=body_params,
353                                        post_params=form_params,
354                                        files=local_var_files,
355                                        response_type='UserSocialIdResult',
356                                        auth_settings=auth_settings,
357                                        callback=params.get('callback'),
358                                        _return_http_data_only=params.get('_return_http_data_only'),
359                                        _preload_content=params.get('_preload_content', True),
360                                        _request_timeout=params.get('_request_timeout'),
361                                        collection_formats=collection_formats)
362
363    def login(self, **kwargs):
364        """
365        Gets login information for a specified user.
366        Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.    The `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
367        This method makes a synchronous HTTP request by default. To make an
368        asynchronous HTTP request, please define a `callback` function
369        to be invoked when receiving the response.
370        >>> def callback_function(response):
371        >>>     pprint(response)
372        >>>
373        >>> thread = api.login(callback=callback_function)
374
375        :param callback function: The callback function
376            for asynchronous request. (optional)
377        :param str api_password: When set to **true**, shows the account API password in the response.
378        :param str embed_account_id_guid:
379        :param str include_account_id_guid: When set to **true**, shows the account ID GUID in the response.
380        :param str login_settings: Determines whether login settings are returned in the response.  Valid Values:  * all -  All the login settings are returned.  * none - no login settings are returned.
381        :return: LoginInformation
382                 If the method is called asynchronously,
383                 returns the request thread.
384        """
385        kwargs['_return_http_data_only'] = True
386        if kwargs.get('callback'):
387            return self.login_with_http_info(**kwargs)
388        else:
389            (data) = self.login_with_http_info(**kwargs)
390            return data
391
392    def login_with_http_info(self, **kwargs):
393        """
394        Gets login information for a specified user.
395        Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.    The `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
396        This method makes a synchronous HTTP request by default. To make an
397        asynchronous HTTP request, please define a `callback` function
398        to be invoked when receiving the response.
399        >>> def callback_function(response):
400        >>>     pprint(response)
401        >>>
402        >>> thread = api.login_with_http_info(callback=callback_function)
403
404        :param callback function: The callback function
405            for asynchronous request. (optional)
406        :param str api_password: When set to **true**, shows the account API password in the response.
407        :param str embed_account_id_guid:
408        :param str include_account_id_guid: When set to **true**, shows the account ID GUID in the response.
409        :param str login_settings: Determines whether login settings are returned in the response.  Valid Values:  * all -  All the login settings are returned.  * none - no login settings are returned.
410        :return: LoginInformation
411                 If the method is called asynchronously,
412                 returns the request thread.
413        """
414
415        all_params = ['api_password', 'embed_account_id_guid', 'include_account_id_guid', 'login_settings']
416        all_params.append('callback')
417        all_params.append('_return_http_data_only')
418        all_params.append('_preload_content')
419        all_params.append('_request_timeout')
420
421        params = locals()
422        for key, val in iteritems(params['kwargs']):
423            if key not in all_params:
424                raise TypeError(
425                    "Got an unexpected keyword argument '%s'"
426                    " to method login" % key
427                )
428            params[key] = val
429        del params['kwargs']
430
431
432        collection_formats = {}
433
434        resource_path = '/v2.1/login_information'.replace('{format}', 'json')
435        path_params = {}
436
437        query_params = {}
438        if 'api_password' in params:
439            query_params['api_password'] = params['api_password']
440        if 'embed_account_id_guid' in params:
441            query_params['embed_account_id_guid'] = params['embed_account_id_guid']
442        if 'include_account_id_guid' in params:
443            query_params['include_account_id_guid'] = params['include_account_id_guid']
444        if 'login_settings' in params:
445            query_params['login_settings'] = params['login_settings']
446
447        header_params = {}
448
449        form_params = []
450        local_var_files = {}
451
452        body_params = None
453        # HTTP header `Accept`
454        header_params['Accept'] = self.api_client.\
455            select_header_accept(['application/json'])
456
457        # Authentication setting
458        auth_settings = []
459
460        return self.api_client.call_api(resource_path, 'GET',
461                                        path_params,
462                                        query_params,
463                                        header_params,
464                                        body=body_params,
465                                        post_params=form_params,
466                                        files=local_var_files,
467                                        response_type='LoginInformation',
468                                        auth_settings=auth_settings,
469                                        callback=params.get('callback'),
470                                        _return_http_data_only=params.get('_return_http_data_only'),
471                                        _preload_content=params.get('_preload_content', True),
472                                        _request_timeout=params.get('_request_timeout'),
473                                        collection_formats=collection_formats)
474
475    def revoke_o_auth_token(self, **kwargs):
476        """
477        Revokes an authorization token.
478        Revokes an OAuth2 authorization server token. After the revocation is complete, a caller must re-authenticate to restore access.
479        This method makes a synchronous HTTP request by default. To make an
480        asynchronous HTTP request, please define a `callback` function
481        to be invoked when receiving the response.
482        >>> def callback_function(response):
483        >>>     pprint(response)
484        >>>
485        >>> thread = api.revoke_o_auth_token(callback=callback_function)
486
487        :param callback function: The callback function
488            for asynchronous request. (optional)
489        :return: None
490                 If the method is called asynchronously,
491                 returns the request thread.
492        """
493        kwargs['_return_http_data_only'] = True
494        if kwargs.get('callback'):
495            return self.revoke_o_auth_token_with_http_info(**kwargs)
496        else:
497            (data) = self.revoke_o_auth_token_with_http_info(**kwargs)
498            return data
499
500    def revoke_o_auth_token_with_http_info(self, **kwargs):
501        """
502        Revokes an authorization token.
503        Revokes an OAuth2 authorization server token. After the revocation is complete, a caller must re-authenticate to restore access.
504        This method makes a synchronous HTTP request by default. To make an
505        asynchronous HTTP request, please define a `callback` function
506        to be invoked when receiving the response.
507        >>> def callback_function(response):
508        >>>     pprint(response)
509        >>>
510        >>> thread = api.revoke_o_auth_token_with_http_info(callback=callback_function)
511
512        :param callback function: The callback function
513            for asynchronous request. (optional)
514        :return: None
515                 If the method is called asynchronously,
516                 returns the request thread.
517        """
518
519        all_params = []
520        all_params.append('callback')
521        all_params.append('_return_http_data_only')
522        all_params.append('_preload_content')
523        all_params.append('_request_timeout')
524
525        params = locals()
526        for key, val in iteritems(params['kwargs']):
527            if key not in all_params:
528                raise TypeError(
529                    "Got an unexpected keyword argument '%s'"
530                    " to method revoke_o_auth_token" % key
531                )
532            params[key] = val
533        del params['kwargs']
534
535        collection_formats = {}
536
537        resource_path = '/v2.1/oauth2/revoke'.replace('{format}', 'json')
538        path_params = {}
539
540        query_params = {}
541
542        header_params = {}
543
544        form_params = []
545        local_var_files = {}
546
547        body_params = None
548        # HTTP header `Accept`
549        header_params['Accept'] = self.api_client.\
550            select_header_accept(['application/json'])
551
552        # Authentication setting
553        auth_settings = []
554
555        return self.api_client.call_api(resource_path, 'POST',
556                                        path_params,
557                                        query_params,
558                                        header_params,
559                                        body=body_params,
560                                        post_params=form_params,
561                                        files=local_var_files,
562                                        response_type=None,
563                                        auth_settings=auth_settings,
564                                        callback=params.get('callback'),
565                                        _return_http_data_only=params.get('_return_http_data_only'),
566                                        _preload_content=params.get('_preload_content', True),
567                                        _request_timeout=params.get('_request_timeout'),
568                                        collection_formats=collection_formats)
569
570    def update_password(self, login_part, **kwargs):
571        """
572        Updates the password for a specified user.
573        Updates the password for a specified user.
574        This method makes a synchronous HTTP request by default. To make an
575        asynchronous HTTP request, please define a `callback` function
576        to be invoked when receiving the response.
577        >>> def callback_function(response):
578        >>>     pprint(response)
579        >>>
580        >>> thread = api.update_password(login_part, callback=callback_function)
581
582        :param callback function: The callback function
583            for asynchronous request. (optional)
584        :param str login_part: Currently, only the value **password** is supported. (required)
585        :param UserPasswordInformation user_password_information:
586        :return: None
587                 If the method is called asynchronously,
588                 returns the request thread.
589        """
590        kwargs['_return_http_data_only'] = True
591        if kwargs.get('callback'):
592            return self.update_password_with_http_info(login_part, **kwargs)
593        else:
594            (data) = self.update_password_with_http_info(login_part, **kwargs)
595            return data
596
597    def update_password_with_http_info(self, login_part, **kwargs):
598        """
599        Updates the password for a specified user.
600        Updates the password for a specified user.
601        This method makes a synchronous HTTP request by default. To make an
602        asynchronous HTTP request, please define a `callback` function
603        to be invoked when receiving the response.
604        >>> def callback_function(response):
605        >>>     pprint(response)
606        >>>
607        >>> thread = api.update_password_with_http_info(login_part, callback=callback_function)
608
609        :param callback function: The callback function
610            for asynchronous request. (optional)
611        :param str login_part: Currently, only the value **password** is supported. (required)
612        :param UserPasswordInformation user_password_information:
613        :return: None
614                 If the method is called asynchronously,
615                 returns the request thread.
616        """
617
618        all_params = ['login_part', 'user_password_information']
619        all_params.append('callback')
620        all_params.append('_return_http_data_only')
621        all_params.append('_preload_content')
622        all_params.append('_request_timeout')
623
624        params = locals()
625        for key, val in iteritems(params['kwargs']):
626            if key not in all_params:
627                raise TypeError(
628                    "Got an unexpected keyword argument '%s'"
629                    " to method update_password" % key
630                )
631            params[key] = val
632        del params['kwargs']
633        # verify the required parameter 'login_part' is set
634        if ('login_part' not in params) or (params['login_part'] is None):
635            raise ValueError("Missing the required parameter `login_part` when calling `update_password`")
636
637
638        collection_formats = {}
639
640        resource_path = '/v2.1/login_information/{loginPart}'.replace('{format}', 'json')
641        path_params = {}
642        if 'login_part' in params:
643            path_params['loginPart'] = params['login_part']
644
645        query_params = {}
646
647        header_params = {}
648
649        form_params = []
650        local_var_files = {}
651
652        body_params = None
653        if 'user_password_information' in params:
654            body_params = params['user_password_information']
655        # HTTP header `Accept`
656        header_params['Accept'] = self.api_client.\
657            select_header_accept(['application/json'])
658
659        # Authentication setting
660        auth_settings = []
661
662        return self.api_client.call_api(resource_path, 'PUT',
663                                        path_params,
664                                        query_params,
665                                        header_params,
666                                        body=body_params,
667                                        post_params=form_params,
668                                        files=local_var_files,
669                                        response_type=None,
670                                        auth_settings=auth_settings,
671                                        callback=params.get('callback'),
672                                        _return_http_data_only=params.get('_return_http_data_only'),
673                                        _preload_content=params.get('_preload_content', True),
674                                        _request_timeout=params.get('_request_timeout'),
675                                        collection_formats=collection_formats)
676
677    def update_social_login(self, account_id, user_id, **kwargs):
678        """
679        Adds social account for a user.
680        Adds a new social account to a user's account.
681        This method makes a synchronous HTTP request by default. To make an
682        asynchronous HTTP request, please define a `callback` function
683        to be invoked when receiving the response.
684        >>> def callback_function(response):
685        >>>     pprint(response)
686        >>>
687        >>> thread = api.update_social_login(account_id, user_id, callback=callback_function)
688
689        :param callback function: The callback function
690            for asynchronous request. (optional)
691        :param str account_id: The external account number (int) or account ID Guid. (required)
692        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
693        :param SocialAccountInformation social_account_information:
694        :return: None
695                 If the method is called asynchronously,
696                 returns the request thread.
697        """
698        kwargs['_return_http_data_only'] = True
699        if kwargs.get('callback'):
700            return self.update_social_login_with_http_info(account_id, user_id, **kwargs)
701        else:
702            (data) = self.update_social_login_with_http_info(account_id, user_id, **kwargs)
703            return data
704
705    def update_social_login_with_http_info(self, account_id, user_id, **kwargs):
706        """
707        Adds social account for a user.
708        Adds a new social account to a user's account.
709        This method makes a synchronous HTTP request by default. To make an
710        asynchronous HTTP request, please define a `callback` function
711        to be invoked when receiving the response.
712        >>> def callback_function(response):
713        >>>     pprint(response)
714        >>>
715        >>> thread = api.update_social_login_with_http_info(account_id, user_id, callback=callback_function)
716
717        :param callback function: The callback function
718            for asynchronous request. (optional)
719        :param str account_id: The external account number (int) or account ID Guid. (required)
720        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
721        :param SocialAccountInformation social_account_information:
722        :return: None
723                 If the method is called asynchronously,
724                 returns the request thread.
725        """
726
727        all_params = ['account_id', 'user_id', 'social_account_information']
728        all_params.append('callback')
729        all_params.append('_return_http_data_only')
730        all_params.append('_preload_content')
731        all_params.append('_request_timeout')
732
733        params = locals()
734        for key, val in iteritems(params['kwargs']):
735            if key not in all_params:
736                raise TypeError(
737                    "Got an unexpected keyword argument '%s'"
738                    " to method update_social_login" % key
739                )
740            params[key] = val
741        del params['kwargs']
742        # verify the required parameter 'account_id' is set
743        if ('account_id' not in params) or (params['account_id'] is None):
744            raise ValueError("Missing the required parameter `account_id` when calling `update_social_login`")
745        # verify the required parameter 'user_id' is set
746        if ('user_id' not in params) or (params['user_id'] is None):
747            raise ValueError("Missing the required parameter `user_id` when calling `update_social_login`")
748
749
750        collection_formats = {}
751
752        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
753        path_params = {}
754        if 'account_id' in params:
755            path_params['accountId'] = params['account_id']
756        if 'user_id' in params:
757            path_params['userId'] = params['user_id']
758
759        query_params = {}
760
761        header_params = {}
762
763        form_params = []
764        local_var_files = {}
765
766        body_params = None
767        if 'social_account_information' in params:
768            body_params = params['social_account_information']
769        # HTTP header `Accept`
770        header_params['Accept'] = self.api_client.\
771            select_header_accept(['application/json'])
772
773        # Authentication setting
774        auth_settings = []
775
776        return self.api_client.call_api(resource_path, 'PUT',
777                                        path_params,
778                                        query_params,
779                                        header_params,
780                                        body=body_params,
781                                        post_params=form_params,
782                                        files=local_var_files,
783                                        response_type=None,
784                                        auth_settings=auth_settings,
785                                        callback=params.get('callback'),
786                                        _return_http_data_only=params.get('_return_http_data_only'),
787                                        _preload_content=params.get('_preload_content', True),
788                                        _request_timeout=params.get('_request_timeout'),
789                                        collection_formats=collection_formats)

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

AuthenticationApi(api_client=None)
35    def __init__(self, api_client=None):
36        config = Configuration()
37        if api_client:
38            self.api_client = api_client
39        else:
40            if not config.api_client:
41                config.api_client = ApiClient()
42            self.api_client = config.api_client
def delete_social_login(self, account_id, user_id, **kwargs)
44    def delete_social_login(self, account_id, user_id, **kwargs):
45        """
46        Deletes user's social account.
47        Deletes a social account from a use's account.
48        This method makes a synchronous HTTP request by default. To make an
49        asynchronous HTTP request, please define a `callback` function
50        to be invoked when receiving the response.
51        >>> def callback_function(response):
52        >>>     pprint(response)
53        >>>
54        >>> thread = api.delete_social_login(account_id, user_id, callback=callback_function)
55
56        :param callback function: The callback function
57            for asynchronous request. (optional)
58        :param str account_id: The external account number (int) or account ID Guid. (required)
59        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
60        :param SocialAccountInformation social_account_information:
61        :return: None
62                 If the method is called asynchronously,
63                 returns the request thread.
64        """
65        kwargs['_return_http_data_only'] = True
66        if kwargs.get('callback'):
67            return self.delete_social_login_with_http_info(account_id, user_id, **kwargs)
68        else:
69            (data) = self.delete_social_login_with_http_info(account_id, user_id, **kwargs)
70            return data

Deletes user's social account. Deletes a social account from a use's account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.delete_social_login(account_id, user_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
  • SocialAccountInformation social_account_information:
Returns

None If the method is called asynchronously, returns the request thread.

def delete_social_login_with_http_info(self, account_id, user_id, **kwargs)
 72    def delete_social_login_with_http_info(self, account_id, user_id, **kwargs):
 73        """
 74        Deletes user's social account.
 75        Deletes a social account from a use's account.
 76        This method makes a synchronous HTTP request by default. To make an
 77        asynchronous HTTP request, please define a `callback` function
 78        to be invoked when receiving the response.
 79        >>> def callback_function(response):
 80        >>>     pprint(response)
 81        >>>
 82        >>> thread = api.delete_social_login_with_http_info(account_id, user_id, callback=callback_function)
 83
 84        :param callback function: The callback function
 85            for asynchronous request. (optional)
 86        :param str account_id: The external account number (int) or account ID Guid. (required)
 87        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
 88        :param SocialAccountInformation social_account_information:
 89        :return: None
 90                 If the method is called asynchronously,
 91                 returns the request thread.
 92        """
 93
 94        all_params = ['account_id', 'user_id', 'social_account_information']
 95        all_params.append('callback')
 96        all_params.append('_return_http_data_only')
 97        all_params.append('_preload_content')
 98        all_params.append('_request_timeout')
 99
100        params = locals()
101        for key, val in iteritems(params['kwargs']):
102            if key not in all_params:
103                raise TypeError(
104                    "Got an unexpected keyword argument '%s'"
105                    " to method delete_social_login" % key
106                )
107            params[key] = val
108        del params['kwargs']
109        # verify the required parameter 'account_id' is set
110        if ('account_id' not in params) or (params['account_id'] is None):
111            raise ValueError("Missing the required parameter `account_id` when calling `delete_social_login`")
112        # verify the required parameter 'user_id' is set
113        if ('user_id' not in params) or (params['user_id'] is None):
114            raise ValueError("Missing the required parameter `user_id` when calling `delete_social_login`")
115
116
117        collection_formats = {}
118
119        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
120        path_params = {}
121        if 'account_id' in params:
122            path_params['accountId'] = params['account_id']
123        if 'user_id' in params:
124            path_params['userId'] = params['user_id']
125
126        query_params = {}
127
128        header_params = {}
129
130        form_params = []
131        local_var_files = {}
132
133        body_params = None
134        if 'social_account_information' in params:
135            body_params = params['social_account_information']
136        # HTTP header `Accept`
137        header_params['Accept'] = self.api_client.\
138            select_header_accept(['application/json'])
139
140        # Authentication setting
141        auth_settings = []
142
143        return self.api_client.call_api(resource_path, 'DELETE',
144                                        path_params,
145                                        query_params,
146                                        header_params,
147                                        body=body_params,
148                                        post_params=form_params,
149                                        files=local_var_files,
150                                        response_type=None,
151                                        auth_settings=auth_settings,
152                                        callback=params.get('callback'),
153                                        _return_http_data_only=params.get('_return_http_data_only'),
154                                        _preload_content=params.get('_preload_content', True),
155                                        _request_timeout=params.get('_request_timeout'),
156                                        collection_formats=collection_formats)

Deletes user's social account. Deletes a social account from a use's account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.delete_social_login_with_http_info(account_id, user_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
  • SocialAccountInformation social_account_information:
Returns

None If the method is called asynchronously, returns the request thread.

def get_o_auth_token(self, **kwargs)
158    def get_o_auth_token(self, **kwargs):
159        """
160        Creates an authorization token.
161        Creates an OAuth2 authorization server token endpoint.
162        This method makes a synchronous HTTP request by default. To make an
163        asynchronous HTTP request, please define a `callback` function
164        to be invoked when receiving the response.
165        >>> def callback_function(response):
166        >>>     pprint(response)
167        >>>
168        >>> thread = api.get_o_auth_token(callback=callback_function)
169
170        :param callback function: The callback function
171            for asynchronous request. (optional)
172        :return: OauthAccess
173                 If the method is called asynchronously,
174                 returns the request thread.
175        """
176        kwargs['_return_http_data_only'] = True
177        if kwargs.get('callback'):
178            return self.get_o_auth_token_with_http_info(**kwargs)
179        else:
180            (data) = self.get_o_auth_token_with_http_info(**kwargs)
181            return data

Creates an authorization token. Creates an OAuth2 authorization server token endpoint. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_o_auth_token(callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
Returns

OauthAccess If the method is called asynchronously, returns the request thread.

def get_o_auth_token_with_http_info(self, **kwargs)
183    def get_o_auth_token_with_http_info(self, **kwargs):
184        """
185        Creates an authorization token.
186        Creates an OAuth2 authorization server token endpoint.
187        This method makes a synchronous HTTP request by default. To make an
188        asynchronous HTTP request, please define a `callback` function
189        to be invoked when receiving the response.
190        >>> def callback_function(response):
191        >>>     pprint(response)
192        >>>
193        >>> thread = api.get_o_auth_token_with_http_info(callback=callback_function)
194
195        :param callback function: The callback function
196            for asynchronous request. (optional)
197        :return: OauthAccess
198                 If the method is called asynchronously,
199                 returns the request thread.
200        """
201
202        all_params = []
203        all_params.append('callback')
204        all_params.append('_return_http_data_only')
205        all_params.append('_preload_content')
206        all_params.append('_request_timeout')
207
208        params = locals()
209        for key, val in iteritems(params['kwargs']):
210            if key not in all_params:
211                raise TypeError(
212                    "Got an unexpected keyword argument '%s'"
213                    " to method get_o_auth_token" % key
214                )
215            params[key] = val
216        del params['kwargs']
217
218        collection_formats = {}
219
220        resource_path = '/v2.1/oauth2/token'.replace('{format}', 'json')
221        path_params = {}
222
223        query_params = {}
224
225        header_params = {}
226
227        form_params = []
228        local_var_files = {}
229
230        body_params = None
231        # HTTP header `Accept`
232        header_params['Accept'] = self.api_client.\
233            select_header_accept(['application/json'])
234
235        # Authentication setting
236        auth_settings = []
237
238        return self.api_client.call_api(resource_path, 'POST',
239                                        path_params,
240                                        query_params,
241                                        header_params,
242                                        body=body_params,
243                                        post_params=form_params,
244                                        files=local_var_files,
245                                        response_type='OauthAccess',
246                                        auth_settings=auth_settings,
247                                        callback=params.get('callback'),
248                                        _return_http_data_only=params.get('_return_http_data_only'),
249                                        _preload_content=params.get('_preload_content', True),
250                                        _request_timeout=params.get('_request_timeout'),
251                                        collection_formats=collection_formats)

Creates an authorization token. Creates an OAuth2 authorization server token endpoint. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.get_o_auth_token_with_http_info(callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
Returns

OauthAccess If the method is called asynchronously, returns the request thread.

def list_social_logins(self, account_id, user_id, **kwargs)
253    def list_social_logins(self, account_id, user_id, **kwargs):
254        """
255        Gets a list of a user's social accounts.
256        Retrieves a list of social accounts linked to a user's account.
257        This method makes a synchronous HTTP request by default. To make an
258        asynchronous HTTP request, please define a `callback` function
259        to be invoked when receiving the response.
260        >>> def callback_function(response):
261        >>>     pprint(response)
262        >>>
263        >>> thread = api.list_social_logins(account_id, user_id, callback=callback_function)
264
265        :param callback function: The callback function
266            for asynchronous request. (optional)
267        :param str account_id: The external account number (int) or account ID Guid. (required)
268        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
269        :return: UserSocialIdResult
270                 If the method is called asynchronously,
271                 returns the request thread.
272        """
273        kwargs['_return_http_data_only'] = True
274        if kwargs.get('callback'):
275            return self.list_social_logins_with_http_info(account_id, user_id, **kwargs)
276        else:
277            (data) = self.list_social_logins_with_http_info(account_id, user_id, **kwargs)
278            return data

Gets a list of a user's social accounts. Retrieves a list of social accounts linked to a user's account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_social_logins(account_id, user_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
Returns

UserSocialIdResult If the method is called asynchronously, returns the request thread.

def list_social_logins_with_http_info(self, account_id, user_id, **kwargs)
280    def list_social_logins_with_http_info(self, account_id, user_id, **kwargs):
281        """
282        Gets a list of a user's social accounts.
283        Retrieves a list of social accounts linked to a user's account.
284        This method makes a synchronous HTTP request by default. To make an
285        asynchronous HTTP request, please define a `callback` function
286        to be invoked when receiving the response.
287        >>> def callback_function(response):
288        >>>     pprint(response)
289        >>>
290        >>> thread = api.list_social_logins_with_http_info(account_id, user_id, callback=callback_function)
291
292        :param callback function: The callback function
293            for asynchronous request. (optional)
294        :param str account_id: The external account number (int) or account ID Guid. (required)
295        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
296        :return: UserSocialIdResult
297                 If the method is called asynchronously,
298                 returns the request thread.
299        """
300
301        all_params = ['account_id', 'user_id']
302        all_params.append('callback')
303        all_params.append('_return_http_data_only')
304        all_params.append('_preload_content')
305        all_params.append('_request_timeout')
306
307        params = locals()
308        for key, val in iteritems(params['kwargs']):
309            if key not in all_params:
310                raise TypeError(
311                    "Got an unexpected keyword argument '%s'"
312                    " to method list_social_logins" % key
313                )
314            params[key] = val
315        del params['kwargs']
316        # verify the required parameter 'account_id' is set
317        if ('account_id' not in params) or (params['account_id'] is None):
318            raise ValueError("Missing the required parameter `account_id` when calling `list_social_logins`")
319        # verify the required parameter 'user_id' is set
320        if ('user_id' not in params) or (params['user_id'] is None):
321            raise ValueError("Missing the required parameter `user_id` when calling `list_social_logins`")
322
323
324        collection_formats = {}
325
326        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
327        path_params = {}
328        if 'account_id' in params:
329            path_params['accountId'] = params['account_id']
330        if 'user_id' in params:
331            path_params['userId'] = params['user_id']
332
333        query_params = {}
334
335        header_params = {}
336
337        form_params = []
338        local_var_files = {}
339
340        body_params = None
341        # HTTP header `Accept`
342        header_params['Accept'] = self.api_client.\
343            select_header_accept(['application/json'])
344
345        # Authentication setting
346        auth_settings = []
347
348        return self.api_client.call_api(resource_path, 'GET',
349                                        path_params,
350                                        query_params,
351                                        header_params,
352                                        body=body_params,
353                                        post_params=form_params,
354                                        files=local_var_files,
355                                        response_type='UserSocialIdResult',
356                                        auth_settings=auth_settings,
357                                        callback=params.get('callback'),
358                                        _return_http_data_only=params.get('_return_http_data_only'),
359                                        _preload_content=params.get('_preload_content', True),
360                                        _request_timeout=params.get('_request_timeout'),
361                                        collection_formats=collection_formats)

Gets a list of a user's social accounts. Retrieves a list of social accounts linked to a user's account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.list_social_logins_with_http_info(account_id, user_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
Returns

UserSocialIdResult If the method is called asynchronously, returns the request thread.

def login(self, **kwargs)
363    def login(self, **kwargs):
364        """
365        Gets login information for a specified user.
366        Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.    The `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
367        This method makes a synchronous HTTP request by default. To make an
368        asynchronous HTTP request, please define a `callback` function
369        to be invoked when receiving the response.
370        >>> def callback_function(response):
371        >>>     pprint(response)
372        >>>
373        >>> thread = api.login(callback=callback_function)
374
375        :param callback function: The callback function
376            for asynchronous request. (optional)
377        :param str api_password: When set to **true**, shows the account API password in the response.
378        :param str embed_account_id_guid:
379        :param str include_account_id_guid: When set to **true**, shows the account ID GUID in the response.
380        :param str login_settings: Determines whether login settings are returned in the response.  Valid Values:  * all -  All the login settings are returned.  * none - no login settings are returned.
381        :return: LoginInformation
382                 If the method is called asynchronously,
383                 returns the request thread.
384        """
385        kwargs['_return_http_data_only'] = True
386        if kwargs.get('callback'):
387            return self.login_with_http_info(**kwargs)
388        else:
389            (data) = self.login_with_http_info(**kwargs)
390            return data

Gets login information for a specified user. Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations. The baseUrl property, returned in the response, is used in all future API calls as the base of the request URL. The baseUrl property contains the DocuSign server, the API version, and the accountId property that is used for the login. This request uses your DocuSign credentials to retrieve the account information. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.login(callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str api_password: When set to true, shows the account API password in the response.
  • str embed_account_id_guid:
  • str include_account_id_guid: When set to true, shows the account ID GUID in the response.
  • str login_settings: Determines whether login settings are returned in the response. Valid Values: * all - All the login settings are returned. * none - no login settings are returned.
Returns

LoginInformation If the method is called asynchronously, returns the request thread.

def login_with_http_info(self, **kwargs)
392    def login_with_http_info(self, **kwargs):
393        """
394        Gets login information for a specified user.
395        Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations.    The `baseUrl` property, returned in the response, is used in all future API calls as the base of the request URL. The `baseUrl` property contains the DocuSign server, the API version, and the `accountId` property that is used for the login. This request uses your DocuSign credentials to retrieve the account information.
396        This method makes a synchronous HTTP request by default. To make an
397        asynchronous HTTP request, please define a `callback` function
398        to be invoked when receiving the response.
399        >>> def callback_function(response):
400        >>>     pprint(response)
401        >>>
402        >>> thread = api.login_with_http_info(callback=callback_function)
403
404        :param callback function: The callback function
405            for asynchronous request. (optional)
406        :param str api_password: When set to **true**, shows the account API password in the response.
407        :param str embed_account_id_guid:
408        :param str include_account_id_guid: When set to **true**, shows the account ID GUID in the response.
409        :param str login_settings: Determines whether login settings are returned in the response.  Valid Values:  * all -  All the login settings are returned.  * none - no login settings are returned.
410        :return: LoginInformation
411                 If the method is called asynchronously,
412                 returns the request thread.
413        """
414
415        all_params = ['api_password', 'embed_account_id_guid', 'include_account_id_guid', 'login_settings']
416        all_params.append('callback')
417        all_params.append('_return_http_data_only')
418        all_params.append('_preload_content')
419        all_params.append('_request_timeout')
420
421        params = locals()
422        for key, val in iteritems(params['kwargs']):
423            if key not in all_params:
424                raise TypeError(
425                    "Got an unexpected keyword argument '%s'"
426                    " to method login" % key
427                )
428            params[key] = val
429        del params['kwargs']
430
431
432        collection_formats = {}
433
434        resource_path = '/v2.1/login_information'.replace('{format}', 'json')
435        path_params = {}
436
437        query_params = {}
438        if 'api_password' in params:
439            query_params['api_password'] = params['api_password']
440        if 'embed_account_id_guid' in params:
441            query_params['embed_account_id_guid'] = params['embed_account_id_guid']
442        if 'include_account_id_guid' in params:
443            query_params['include_account_id_guid'] = params['include_account_id_guid']
444        if 'login_settings' in params:
445            query_params['login_settings'] = params['login_settings']
446
447        header_params = {}
448
449        form_params = []
450        local_var_files = {}
451
452        body_params = None
453        # HTTP header `Accept`
454        header_params['Accept'] = self.api_client.\
455            select_header_accept(['application/json'])
456
457        # Authentication setting
458        auth_settings = []
459
460        return self.api_client.call_api(resource_path, 'GET',
461                                        path_params,
462                                        query_params,
463                                        header_params,
464                                        body=body_params,
465                                        post_params=form_params,
466                                        files=local_var_files,
467                                        response_type='LoginInformation',
468                                        auth_settings=auth_settings,
469                                        callback=params.get('callback'),
470                                        _return_http_data_only=params.get('_return_http_data_only'),
471                                        _preload_content=params.get('_preload_content', True),
472                                        _request_timeout=params.get('_request_timeout'),
473                                        collection_formats=collection_formats)

Gets login information for a specified user. Retrieves login information for a specified user. Each account that is associated with the login credentials is listed. You can use the returned information to determine whether a user is authenticated and select an account to use in future operations. The baseUrl property, returned in the response, is used in all future API calls as the base of the request URL. The baseUrl property contains the DocuSign server, the API version, and the accountId property that is used for the login. This request uses your DocuSign credentials to retrieve the account information. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.login_with_http_info(callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str api_password: When set to true, shows the account API password in the response.
  • str embed_account_id_guid:
  • str include_account_id_guid: When set to true, shows the account ID GUID in the response.
  • str login_settings: Determines whether login settings are returned in the response. Valid Values: * all - All the login settings are returned. * none - no login settings are returned.
Returns

LoginInformation If the method is called asynchronously, returns the request thread.

def revoke_o_auth_token(self, **kwargs)
475    def revoke_o_auth_token(self, **kwargs):
476        """
477        Revokes an authorization token.
478        Revokes an OAuth2 authorization server token. After the revocation is complete, a caller must re-authenticate to restore access.
479        This method makes a synchronous HTTP request by default. To make an
480        asynchronous HTTP request, please define a `callback` function
481        to be invoked when receiving the response.
482        >>> def callback_function(response):
483        >>>     pprint(response)
484        >>>
485        >>> thread = api.revoke_o_auth_token(callback=callback_function)
486
487        :param callback function: The callback function
488            for asynchronous request. (optional)
489        :return: None
490                 If the method is called asynchronously,
491                 returns the request thread.
492        """
493        kwargs['_return_http_data_only'] = True
494        if kwargs.get('callback'):
495            return self.revoke_o_auth_token_with_http_info(**kwargs)
496        else:
497            (data) = self.revoke_o_auth_token_with_http_info(**kwargs)
498            return data

Revokes an authorization token. Revokes an OAuth2 authorization server token. After the revocation is complete, a caller must re-authenticate to restore access. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.revoke_o_auth_token(callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
Returns

None If the method is called asynchronously, returns the request thread.

def revoke_o_auth_token_with_http_info(self, **kwargs)
500    def revoke_o_auth_token_with_http_info(self, **kwargs):
501        """
502        Revokes an authorization token.
503        Revokes an OAuth2 authorization server token. After the revocation is complete, a caller must re-authenticate to restore access.
504        This method makes a synchronous HTTP request by default. To make an
505        asynchronous HTTP request, please define a `callback` function
506        to be invoked when receiving the response.
507        >>> def callback_function(response):
508        >>>     pprint(response)
509        >>>
510        >>> thread = api.revoke_o_auth_token_with_http_info(callback=callback_function)
511
512        :param callback function: The callback function
513            for asynchronous request. (optional)
514        :return: None
515                 If the method is called asynchronously,
516                 returns the request thread.
517        """
518
519        all_params = []
520        all_params.append('callback')
521        all_params.append('_return_http_data_only')
522        all_params.append('_preload_content')
523        all_params.append('_request_timeout')
524
525        params = locals()
526        for key, val in iteritems(params['kwargs']):
527            if key not in all_params:
528                raise TypeError(
529                    "Got an unexpected keyword argument '%s'"
530                    " to method revoke_o_auth_token" % key
531                )
532            params[key] = val
533        del params['kwargs']
534
535        collection_formats = {}
536
537        resource_path = '/v2.1/oauth2/revoke'.replace('{format}', 'json')
538        path_params = {}
539
540        query_params = {}
541
542        header_params = {}
543
544        form_params = []
545        local_var_files = {}
546
547        body_params = None
548        # HTTP header `Accept`
549        header_params['Accept'] = self.api_client.\
550            select_header_accept(['application/json'])
551
552        # Authentication setting
553        auth_settings = []
554
555        return self.api_client.call_api(resource_path, 'POST',
556                                        path_params,
557                                        query_params,
558                                        header_params,
559                                        body=body_params,
560                                        post_params=form_params,
561                                        files=local_var_files,
562                                        response_type=None,
563                                        auth_settings=auth_settings,
564                                        callback=params.get('callback'),
565                                        _return_http_data_only=params.get('_return_http_data_only'),
566                                        _preload_content=params.get('_preload_content', True),
567                                        _request_timeout=params.get('_request_timeout'),
568                                        collection_formats=collection_formats)

Revokes an authorization token. Revokes an OAuth2 authorization server token. After the revocation is complete, a caller must re-authenticate to restore access. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.revoke_o_auth_token_with_http_info(callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
Returns

None If the method is called asynchronously, returns the request thread.

def update_password(self, login_part, **kwargs)
570    def update_password(self, login_part, **kwargs):
571        """
572        Updates the password for a specified user.
573        Updates the password for a specified user.
574        This method makes a synchronous HTTP request by default. To make an
575        asynchronous HTTP request, please define a `callback` function
576        to be invoked when receiving the response.
577        >>> def callback_function(response):
578        >>>     pprint(response)
579        >>>
580        >>> thread = api.update_password(login_part, callback=callback_function)
581
582        :param callback function: The callback function
583            for asynchronous request. (optional)
584        :param str login_part: Currently, only the value **password** is supported. (required)
585        :param UserPasswordInformation user_password_information:
586        :return: None
587                 If the method is called asynchronously,
588                 returns the request thread.
589        """
590        kwargs['_return_http_data_only'] = True
591        if kwargs.get('callback'):
592            return self.update_password_with_http_info(login_part, **kwargs)
593        else:
594            (data) = self.update_password_with_http_info(login_part, **kwargs)
595            return data

Updates the password for a specified user. Updates the password for a specified user. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.update_password(login_part, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str login_part: Currently, only the value password is supported. (required)
  • UserPasswordInformation user_password_information:
Returns

None If the method is called asynchronously, returns the request thread.

def update_password_with_http_info(self, login_part, **kwargs)
597    def update_password_with_http_info(self, login_part, **kwargs):
598        """
599        Updates the password for a specified user.
600        Updates the password for a specified user.
601        This method makes a synchronous HTTP request by default. To make an
602        asynchronous HTTP request, please define a `callback` function
603        to be invoked when receiving the response.
604        >>> def callback_function(response):
605        >>>     pprint(response)
606        >>>
607        >>> thread = api.update_password_with_http_info(login_part, callback=callback_function)
608
609        :param callback function: The callback function
610            for asynchronous request. (optional)
611        :param str login_part: Currently, only the value **password** is supported. (required)
612        :param UserPasswordInformation user_password_information:
613        :return: None
614                 If the method is called asynchronously,
615                 returns the request thread.
616        """
617
618        all_params = ['login_part', 'user_password_information']
619        all_params.append('callback')
620        all_params.append('_return_http_data_only')
621        all_params.append('_preload_content')
622        all_params.append('_request_timeout')
623
624        params = locals()
625        for key, val in iteritems(params['kwargs']):
626            if key not in all_params:
627                raise TypeError(
628                    "Got an unexpected keyword argument '%s'"
629                    " to method update_password" % key
630                )
631            params[key] = val
632        del params['kwargs']
633        # verify the required parameter 'login_part' is set
634        if ('login_part' not in params) or (params['login_part'] is None):
635            raise ValueError("Missing the required parameter `login_part` when calling `update_password`")
636
637
638        collection_formats = {}
639
640        resource_path = '/v2.1/login_information/{loginPart}'.replace('{format}', 'json')
641        path_params = {}
642        if 'login_part' in params:
643            path_params['loginPart'] = params['login_part']
644
645        query_params = {}
646
647        header_params = {}
648
649        form_params = []
650        local_var_files = {}
651
652        body_params = None
653        if 'user_password_information' in params:
654            body_params = params['user_password_information']
655        # HTTP header `Accept`
656        header_params['Accept'] = self.api_client.\
657            select_header_accept(['application/json'])
658
659        # Authentication setting
660        auth_settings = []
661
662        return self.api_client.call_api(resource_path, 'PUT',
663                                        path_params,
664                                        query_params,
665                                        header_params,
666                                        body=body_params,
667                                        post_params=form_params,
668                                        files=local_var_files,
669                                        response_type=None,
670                                        auth_settings=auth_settings,
671                                        callback=params.get('callback'),
672                                        _return_http_data_only=params.get('_return_http_data_only'),
673                                        _preload_content=params.get('_preload_content', True),
674                                        _request_timeout=params.get('_request_timeout'),
675                                        collection_formats=collection_formats)

Updates the password for a specified user. Updates the password for a specified user. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.update_password_with_http_info(login_part, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str login_part: Currently, only the value password is supported. (required)
  • UserPasswordInformation user_password_information:
Returns

None If the method is called asynchronously, returns the request thread.

def update_social_login(self, account_id, user_id, **kwargs)
677    def update_social_login(self, account_id, user_id, **kwargs):
678        """
679        Adds social account for a user.
680        Adds a new social account to a user's account.
681        This method makes a synchronous HTTP request by default. To make an
682        asynchronous HTTP request, please define a `callback` function
683        to be invoked when receiving the response.
684        >>> def callback_function(response):
685        >>>     pprint(response)
686        >>>
687        >>> thread = api.update_social_login(account_id, user_id, callback=callback_function)
688
689        :param callback function: The callback function
690            for asynchronous request. (optional)
691        :param str account_id: The external account number (int) or account ID Guid. (required)
692        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
693        :param SocialAccountInformation social_account_information:
694        :return: None
695                 If the method is called asynchronously,
696                 returns the request thread.
697        """
698        kwargs['_return_http_data_only'] = True
699        if kwargs.get('callback'):
700            return self.update_social_login_with_http_info(account_id, user_id, **kwargs)
701        else:
702            (data) = self.update_social_login_with_http_info(account_id, user_id, **kwargs)
703            return data

Adds social account for a user. Adds a new social account to a user's account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.update_social_login(account_id, user_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
  • SocialAccountInformation social_account_information:
Returns

None If the method is called asynchronously, returns the request thread.

def update_social_login_with_http_info(self, account_id, user_id, **kwargs)
705    def update_social_login_with_http_info(self, account_id, user_id, **kwargs):
706        """
707        Adds social account for a user.
708        Adds a new social account to a user's account.
709        This method makes a synchronous HTTP request by default. To make an
710        asynchronous HTTP request, please define a `callback` function
711        to be invoked when receiving the response.
712        >>> def callback_function(response):
713        >>>     pprint(response)
714        >>>
715        >>> thread = api.update_social_login_with_http_info(account_id, user_id, callback=callback_function)
716
717        :param callback function: The callback function
718            for asynchronous request. (optional)
719        :param str account_id: The external account number (int) or account ID Guid. (required)
720        :param str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
721        :param SocialAccountInformation social_account_information:
722        :return: None
723                 If the method is called asynchronously,
724                 returns the request thread.
725        """
726
727        all_params = ['account_id', 'user_id', 'social_account_information']
728        all_params.append('callback')
729        all_params.append('_return_http_data_only')
730        all_params.append('_preload_content')
731        all_params.append('_request_timeout')
732
733        params = locals()
734        for key, val in iteritems(params['kwargs']):
735            if key not in all_params:
736                raise TypeError(
737                    "Got an unexpected keyword argument '%s'"
738                    " to method update_social_login" % key
739                )
740            params[key] = val
741        del params['kwargs']
742        # verify the required parameter 'account_id' is set
743        if ('account_id' not in params) or (params['account_id'] is None):
744            raise ValueError("Missing the required parameter `account_id` when calling `update_social_login`")
745        # verify the required parameter 'user_id' is set
746        if ('user_id' not in params) or (params['user_id'] is None):
747            raise ValueError("Missing the required parameter `user_id` when calling `update_social_login`")
748
749
750        collection_formats = {}
751
752        resource_path = '/v2.1/accounts/{accountId}/users/{userId}/social'.replace('{format}', 'json')
753        path_params = {}
754        if 'account_id' in params:
755            path_params['accountId'] = params['account_id']
756        if 'user_id' in params:
757            path_params['userId'] = params['user_id']
758
759        query_params = {}
760
761        header_params = {}
762
763        form_params = []
764        local_var_files = {}
765
766        body_params = None
767        if 'social_account_information' in params:
768            body_params = params['social_account_information']
769        # HTTP header `Accept`
770        header_params['Accept'] = self.api_client.\
771            select_header_accept(['application/json'])
772
773        # Authentication setting
774        auth_settings = []
775
776        return self.api_client.call_api(resource_path, 'PUT',
777                                        path_params,
778                                        query_params,
779                                        header_params,
780                                        body=body_params,
781                                        post_params=form_params,
782                                        files=local_var_files,
783                                        response_type=None,
784                                        auth_settings=auth_settings,
785                                        callback=params.get('callback'),
786                                        _return_http_data_only=params.get('_return_http_data_only'),
787                                        _preload_content=params.get('_preload_content', True),
788                                        _request_timeout=params.get('_request_timeout'),
789                                        collection_formats=collection_formats)

Adds social account for a user. Adds a new social account to a user's account. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a callback function to be invoked when receiving the response.

>>> def callback_function(response):
>>>     pprint(response)
>>>
>>> thread = api.update_social_login_with_http_info(account_id, user_id, callback=callback_function)
Parameters
  • callback function: The callback function for asynchronous request. (optional)
  • str account_id: The external account number (int) or account ID Guid. (required)
  • str user_id: The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required)
  • SocialAccountInformation social_account_information:
Returns

None If the method is called asynchronously, returns the request thread.