docusign_esign.client.auth.oauth

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
 14import json
 15from pprint import pformat
 16from six import iteritems
 17
 18
 19class OAuth(object):
 20    """
 21        NOTE: This class is auto generated by the swagger code generator program.
 22        Do not edit the class manually.
 23        """
 24    #  create and send envelopes, and obtain links for starting signing sessions.
 25    SCOPE_SIGNATURE = "signature"
 26    #  obtain a refresh token with an extended lifetime.
 27    SCOPE_EXTENDED = "extended"
 28    #  obtain access to the user’s account when the user is not present.
 29    SCOPE_IMPERSONATION = "impersonation"
 30
 31    #  OAuth Base path constants
 32    #  Demo server base path
 33    DEMO_OAUTH_BASE_PATH = "account-d.docusign.com"
 34    #  Production server base path
 35    PRODUCTION_OAUTH_BASE_PATH = "account.docusign.com"
 36    #   JWT Grant Type
 37    GRANT_TYPE_JWT = "urn:ietf:params:oauth:grant-type:jwt-bearer"
 38
 39
 40class OAuthUserInfo(object):
 41
 42    def __init__(self, sub=None, email=None, accounts=None, name=None, given_name=None, family_name=None,
 43                 created=None):
 44
 45        self.swagger_types = {
 46            'sub': 'str',
 47            'email': 'str',
 48            'accounts': 'list[Account]',
 49            'name': 'str',
 50            'given_name': 'str',
 51            'family_name': 'str',
 52            'created': 'str'
 53        }
 54
 55        self.attribute_map = {
 56            'sub': 'sub',
 57            'email': 'email',
 58            'accounts': 'accounts',
 59            'name': 'name',
 60            'given_name': 'given_name',
 61            'family_name': 'family_name',
 62            'created': 'created'
 63        }
 64        self._sub = sub
 65        self._email = email
 66        self._accounts = accounts
 67        self._name = name
 68        self._given_name = given_name
 69        self._family_name = family_name
 70        self._created = created
 71
 72    @property
 73    def sub(self):
 74        return self._sub
 75
 76    @sub.setter
 77    def sub(self, sub):
 78        self._sub = sub
 79
 80    @property
 81    def created(self):
 82        return self._created
 83
 84    @created.setter
 85    def created(self, created):
 86        self._created = created
 87
 88    @property
 89    def email(self):
 90        return self._email
 91
 92    @email.setter
 93    def email(self, email):
 94        self._email = email
 95
 96    @property
 97    def name(self):
 98        return self._name
 99
100    @name.setter
101    def name(self, name):
102        self._name = name
103
104    @property
105    def given_name(self):
106        return self._given_name
107
108    @given_name.setter
109    def given_name(self, given_name):
110        self._given_name = given_name
111
112    @property
113    def family_name(self):
114        return self._family_name
115
116    @family_name.setter
117    def family_name(self, family_name):
118        self._family_name = family_name
119
120    def list(self):
121        return self._accounts
122
123    @property
124    def accounts(self):
125        return self._accounts
126
127    @accounts.setter
128    def accounts(self, accounts):
129        self._accounts = accounts
130
131    def add_account(self, account):
132        if not self.accounts:
133            self._accounts = list()
134        self._accounts.append(account)
135
136    def get_accounts(self):
137        if not self.accounts:
138            self._accounts = list()
139        return self._accounts
140
141    def to_dict(self):
142        """
143        Returns the model properties as a dict
144        """
145        result = {}
146
147        for attr, _ in iteritems(self.swagger_types):
148            value = getattr(self, attr)
149            if isinstance(value, list):
150                result[attr] = list(map(
151                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
152                    value
153                ))
154            elif hasattr(value, "to_dict"):
155                result[attr] = value.to_dict()
156            elif isinstance(value, dict):
157                result[attr] = dict(map(
158                    lambda item: (item[0], item[1].to_dict())
159                    if hasattr(item[1], "to_dict") else item,
160                    value.items()
161                ))
162            else:
163                result[attr] = value
164
165        return result
166
167    def __str__(self):
168        """
169        Returns the string representation of the model
170        """
171        return pformat(self.to_dict())
172
173    def to_indented_string(self, obj):
174        """
175         Convert the given object to string with each line indented by 4
176         spaces (except the first line).
177        :param obj:
178        :return:
179        """
180        if obj:
181            return str(obj).replace("\n", "\n    ")
182        return ""
183
184
185class Account(object):
186    def __init__(self, account_id=None, is_default=None, account_name=None, base_uri=None, organization=None):
187        self.swagger_types = {
188            'account_id': 'str',
189            'is_default': 'str',
190            'account_name': 'str',
191            'base_uri': 'str',
192            'organization': 'str',
193        }
194
195        self.attribute_map =  {
196            'account_id': 'account_id',
197            'is_default': 'is_default',
198            'account_name': 'account_name',
199            'base_uri': 'base_uri',
200            'organization': 'organization',
201        }
202        self._account_id = account_id
203        self.is_default = is_default
204        self._account_name = account_name
205        self._base_uri = base_uri
206        self._organization = organization
207
208    def get_is_default(self):
209        return self.get_is_default
210
211    @property
212    def account_id(self):
213        return self._account_id
214
215    @account_id.setter
216    def account_id(self, account_id):
217        self._account_id = account_id
218
219    @property
220    def is_default(self):
221        return self._is_default
222
223    @is_default.setter
224    def is_default(self, is_default):
225        self._is_default = is_default
226
227    @property
228    def account_name(self):
229        return self._account_name
230
231    @account_name.setter
232    def account_name(self, account_name):
233        self._account_name = account_name
234
235    @property
236    def base_uri(self):
237        return self._base_uri
238
239    @base_uri.setter
240    def base_uri(self, base_uri):
241        self._base_uri = base_uri
242
243    @property
244    def organization(self):
245        return self._organization
246
247    @organization.setter
248    def organization(self, organization):
249        self._organization = organization
250
251
252class Link(object):
253    def __init__(self, rel=None, href=None):
254        self._rel = rel
255        self._href = href
256
257    @property
258    def rel(self):
259        return self._rel
260
261    @rel.setter
262    def rel(self, rel):
263        self._rel = rel
264
265    @property
266    def href(self):
267        return self._href
268
269    @href.setter
270    def organization(self, href):
271        self._href = href
272
273    def __str__(self):
274        return "class Link {\n    rel: {}\n    href: {}".format(self.to_indented_string(self.rel),
275                                                                self.to_indented_string(self.href))
276
277    def to_indented_string(self, obj):
278        """
279         Convert the given object to string with each line indented by 4
280         spaces (except the first line).
281        :param obj: 
282        :return: 
283        """
284        if obj:
285            return str(obj).replace("\n", "\n    ")
286        return None
287
288    def __eq__(self, other):
289        if not other:
290            return False
291        return (self.rel == other.rel or self.rel and self.rel == other.rel) and \
292                (self.href == other.href or self.href and self.href == other.href)
293
294    def to_json(self):
295        pass
296
297
298class Organization(object):
299    def __init__(self, organization_id=None, links=None):
300        self._organization_id = organization_id
301        self._links = links
302
303    @property
304    def organization_id(self):
305        return self._organization_id
306
307    @organization_id.setter
308    def organization_id(self, organization_id):
309        self._organization_id = organization_id
310
311    @property
312    def links(self):
313        return self._links
314
315    @links.setter
316    def links(self, links):
317        self._links = links
318
319    def list(self):
320        if not self._links:
321            self._links = list()
322        return self._links
323
324    def add_links(self, link):
325        if not self.links:
326            self.links = list()
327        self._links.append(link)
328
329    def __str__(self):
330        return "class Organization {\n    organization_id: {}\n    links: {}".format(
331            self.to_indented_string(self._organization_id),
332            self.to_indented_string(self._links)
333        )
334
335    def to_indented_string(self, obj):
336
337        if obj:
338            return str(obj).replace("\n", "\n    ")
339        return None
340
341    def __eq__(self, other):
342        if not other:
343            return False
344        return (self.organization_id == other.organization_id or self.organization_id
345                and self.organization_id == other.organization_id) and\
346               (self.links == other.links or self.links and self.links == other.links)
347
348
349class OAuthToken(object):
350
351    def __init__(self, access_token=None, data=None, expires_in=None, refresh_token=None, scope=None, token_type=None):
352        """
353        OAuthToken - a model defined in Swagger
354
355        :param dict swaggerTypes: The key is attribute name
356                                  and the value is attribute type.
357        :param dict attributeMap: The key is attribute name
358                                  and the value is json key in definition.
359        """
360        self.swagger_types = {
361            'access_token': 'str',
362            'data': 'list[NameValue]',
363            'expires_in': 'str',
364            'refresh_token': 'str',
365            'scope': 'str',
366            'token_type': 'str'
367        }
368
369        self.attribute_map = {
370            'access_token': 'access_token',
371            'data': 'data',
372            'expires_in': 'expires_in',
373            'refresh_token': 'refresh_token',
374            'scope': 'scope',
375            'token_type': 'token_type'
376        }
377
378        self._access_token = access_token
379        self._data = data
380        self._expires_in = expires_in
381        self._refresh_token = refresh_token
382        self._scope = scope
383        self._token_type = token_type
384
385    @property
386    def access_token(self):
387        """
388        Gets the access_token of this OAuthToken.
389        Access token information.
390
391        :return: The access_token of this OAuthToken.
392        :rtype: str
393        """
394        return self._access_token
395
396    @access_token.setter
397    def access_token(self, access_token):
398        """
399        Sets the access_token of this OAuthToken.
400        Access token information.
401
402        :param access_token: The access_token of this OAuthToken.
403        :type: str
404        """
405
406        self._access_token = access_token
407
408    @property
409    def data(self):
410        """
411        Gets the data of this OAuthToken.
412        
413
414        :return: The data of this OAuthToken.
415        :rtype: list[NameValue]
416        """
417        return self._data
418
419    @data.setter
420    def data(self, data):
421        """
422        Sets the data of this OAuthToken.
423        
424
425        :param data: The data of this OAuthToken.
426        :type: list[NameValue]
427        """
428
429        self._data = data
430
431    @property
432    def expires_in(self):
433        """
434        Gets the expires_in of this OAuthToken.
435        
436
437        :return: The expires_in of this OAuthToken.
438        :rtype: str
439        """
440        return self._expires_in
441
442    @expires_in.setter
443    def expires_in(self, expires_in):
444        """
445        Sets the expires_in of this OAuthToken.
446        
447
448        :param expires_in: The expires_in of this OAuthToken.
449        :type: str
450        """
451
452        self._expires_in = expires_in
453
454    @property
455    def refresh_token(self):
456        """
457        Gets the refresh_token of this OAuthToken.
458        
459
460        :return: The refresh_token of this OAuthToken.
461        :rtype: str
462        """
463        return self._refresh_token
464
465    @refresh_token.setter
466    def refresh_token(self, refresh_token):
467        """
468        Sets the refresh_token of this OAuthToken.
469        
470
471        :param refresh_token: The refresh_token of this OAuthToken.
472        :type: str
473        """
474
475        self._refresh_token = refresh_token
476
477    @property
478    def scope(self):
479        """
480        Gets the scope of this OAuthToken.
481        Must be set to \"api\".
482
483        :return: The scope of this OAuthToken.
484        :rtype: str
485        """
486        return self._scope
487
488    @scope.setter
489    def scope(self, scope):
490        """
491        Sets the scope of this OAuthToken.
492        Must be set to \"api\".
493
494        :param scope: The scope of this OAuthToken.
495        :type: str
496        """
497
498        self._scope = scope
499
500    @property
501    def token_type(self):
502        """
503        Gets the token_type of this OAuthToken.
504        
505
506        :return: The token_type of this OAuthToken.
507        :rtype: str
508        """
509        return self._token_type
510
511    @token_type.setter
512    def token_type(self, token_type):
513        """
514        Sets the token_type of this OAuthToken.
515        
516
517        :param token_type: The token_type of this OAuthToken.
518        :type: str
519        """
520
521        self._token_type = token_type
522
523    def to_dict(self):
524        """
525        Returns the model properties as a dict
526        """
527        result = {}
528
529        for attr, _ in iteritems(self.swagger_types):
530            value = getattr(self, attr)
531            if isinstance(value, list):
532                result[attr] = list(map(
533                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
534                    value
535                ))
536            elif hasattr(value, "to_dict"):
537                result[attr] = value.to_dict()
538            elif isinstance(value, dict):
539                result[attr] = dict(map(
540                    lambda item: (item[0], item[1].to_dict())
541                    if hasattr(item[1], "to_dict") else item,
542                    value.items()
543                ))
544            else:
545                result[attr] = value
546
547        return result
548
549    def to_str(self):
550        """
551        Returns the string representation of the model
552        """
553        return pformat(self.to_dict())
554
555    def __repr__(self):
556        """
557        For `print` and `pprint`
558        """
559        return self.to_str()
560
561    def __eq__(self, other):
562        """
563        Returns true if both objects are equal
564        """
565        return self.__dict__ == other.__dict__
566
567    def __ne__(self, other):
568        """
569        Returns true if both objects are not equal
570        """
571        return not self == other
class OAuth:
20class OAuth(object):
21    """
22        NOTE: This class is auto generated by the swagger code generator program.
23        Do not edit the class manually.
24        """
25    #  create and send envelopes, and obtain links for starting signing sessions.
26    SCOPE_SIGNATURE = "signature"
27    #  obtain a refresh token with an extended lifetime.
28    SCOPE_EXTENDED = "extended"
29    #  obtain access to the user’s account when the user is not present.
30    SCOPE_IMPERSONATION = "impersonation"
31
32    #  OAuth Base path constants
33    #  Demo server base path
34    DEMO_OAUTH_BASE_PATH = "account-d.docusign.com"
35    #  Production server base path
36    PRODUCTION_OAUTH_BASE_PATH = "account.docusign.com"
37    #   JWT Grant Type
38    GRANT_TYPE_JWT = "urn:ietf:params:oauth:grant-type:jwt-bearer"

NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.

OAuth()
SCOPE_SIGNATURE = 'signature'
SCOPE_EXTENDED = 'extended'
SCOPE_IMPERSONATION = 'impersonation'
DEMO_OAUTH_BASE_PATH = 'account-d.docusign.com'
PRODUCTION_OAUTH_BASE_PATH = 'account.docusign.com'
GRANT_TYPE_JWT = 'urn:ietf:params:oauth:grant-type:jwt-bearer'
class OAuthUserInfo:
 41class OAuthUserInfo(object):
 42
 43    def __init__(self, sub=None, email=None, accounts=None, name=None, given_name=None, family_name=None,
 44                 created=None):
 45
 46        self.swagger_types = {
 47            'sub': 'str',
 48            'email': 'str',
 49            'accounts': 'list[Account]',
 50            'name': 'str',
 51            'given_name': 'str',
 52            'family_name': 'str',
 53            'created': 'str'
 54        }
 55
 56        self.attribute_map = {
 57            'sub': 'sub',
 58            'email': 'email',
 59            'accounts': 'accounts',
 60            'name': 'name',
 61            'given_name': 'given_name',
 62            'family_name': 'family_name',
 63            'created': 'created'
 64        }
 65        self._sub = sub
 66        self._email = email
 67        self._accounts = accounts
 68        self._name = name
 69        self._given_name = given_name
 70        self._family_name = family_name
 71        self._created = created
 72
 73    @property
 74    def sub(self):
 75        return self._sub
 76
 77    @sub.setter
 78    def sub(self, sub):
 79        self._sub = sub
 80
 81    @property
 82    def created(self):
 83        return self._created
 84
 85    @created.setter
 86    def created(self, created):
 87        self._created = created
 88
 89    @property
 90    def email(self):
 91        return self._email
 92
 93    @email.setter
 94    def email(self, email):
 95        self._email = email
 96
 97    @property
 98    def name(self):
 99        return self._name
100
101    @name.setter
102    def name(self, name):
103        self._name = name
104
105    @property
106    def given_name(self):
107        return self._given_name
108
109    @given_name.setter
110    def given_name(self, given_name):
111        self._given_name = given_name
112
113    @property
114    def family_name(self):
115        return self._family_name
116
117    @family_name.setter
118    def family_name(self, family_name):
119        self._family_name = family_name
120
121    def list(self):
122        return self._accounts
123
124    @property
125    def accounts(self):
126        return self._accounts
127
128    @accounts.setter
129    def accounts(self, accounts):
130        self._accounts = accounts
131
132    def add_account(self, account):
133        if not self.accounts:
134            self._accounts = list()
135        self._accounts.append(account)
136
137    def get_accounts(self):
138        if not self.accounts:
139            self._accounts = list()
140        return self._accounts
141
142    def to_dict(self):
143        """
144        Returns the model properties as a dict
145        """
146        result = {}
147
148        for attr, _ in iteritems(self.swagger_types):
149            value = getattr(self, attr)
150            if isinstance(value, list):
151                result[attr] = list(map(
152                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
153                    value
154                ))
155            elif hasattr(value, "to_dict"):
156                result[attr] = value.to_dict()
157            elif isinstance(value, dict):
158                result[attr] = dict(map(
159                    lambda item: (item[0], item[1].to_dict())
160                    if hasattr(item[1], "to_dict") else item,
161                    value.items()
162                ))
163            else:
164                result[attr] = value
165
166        return result
167
168    def __str__(self):
169        """
170        Returns the string representation of the model
171        """
172        return pformat(self.to_dict())
173
174    def to_indented_string(self, obj):
175        """
176         Convert the given object to string with each line indented by 4
177         spaces (except the first line).
178        :param obj:
179        :return:
180        """
181        if obj:
182            return str(obj).replace("\n", "\n    ")
183        return ""
OAuthUserInfo( sub=None, email=None, accounts=None, name=None, given_name=None, family_name=None, created=None)
43    def __init__(self, sub=None, email=None, accounts=None, name=None, given_name=None, family_name=None,
44                 created=None):
45
46        self.swagger_types = {
47            'sub': 'str',
48            'email': 'str',
49            'accounts': 'list[Account]',
50            'name': 'str',
51            'given_name': 'str',
52            'family_name': 'str',
53            'created': 'str'
54        }
55
56        self.attribute_map = {
57            'sub': 'sub',
58            'email': 'email',
59            'accounts': 'accounts',
60            'name': 'name',
61            'given_name': 'given_name',
62            'family_name': 'family_name',
63            'created': 'created'
64        }
65        self._sub = sub
66        self._email = email
67        self._accounts = accounts
68        self._name = name
69        self._given_name = given_name
70        self._family_name = family_name
71        self._created = created
sub
created
email
name
given_name
family_name
def list(self)
121    def list(self):
122        return self._accounts
accounts
def add_account(self, account)
132    def add_account(self, account):
133        if not self.accounts:
134            self._accounts = list()
135        self._accounts.append(account)
def get_accounts(self)
137    def get_accounts(self):
138        if not self.accounts:
139            self._accounts = list()
140        return self._accounts
def to_dict(self)
142    def to_dict(self):
143        """
144        Returns the model properties as a dict
145        """
146        result = {}
147
148        for attr, _ in iteritems(self.swagger_types):
149            value = getattr(self, attr)
150            if isinstance(value, list):
151                result[attr] = list(map(
152                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
153                    value
154                ))
155            elif hasattr(value, "to_dict"):
156                result[attr] = value.to_dict()
157            elif isinstance(value, dict):
158                result[attr] = dict(map(
159                    lambda item: (item[0], item[1].to_dict())
160                    if hasattr(item[1], "to_dict") else item,
161                    value.items()
162                ))
163            else:
164                result[attr] = value
165
166        return result

Returns the model properties as a dict

def to_indented_string(self, obj)
174    def to_indented_string(self, obj):
175        """
176         Convert the given object to string with each line indented by 4
177         spaces (except the first line).
178        :param obj:
179        :return:
180        """
181        if obj:
182            return str(obj).replace("\n", "\n    ")
183        return ""

Convert the given object to string with each line indented by 4 spaces (except the first line).

Parameters
  • obj:
Returns
class Account:
186class Account(object):
187    def __init__(self, account_id=None, is_default=None, account_name=None, base_uri=None, organization=None):
188        self.swagger_types = {
189            'account_id': 'str',
190            'is_default': 'str',
191            'account_name': 'str',
192            'base_uri': 'str',
193            'organization': 'str',
194        }
195
196        self.attribute_map =  {
197            'account_id': 'account_id',
198            'is_default': 'is_default',
199            'account_name': 'account_name',
200            'base_uri': 'base_uri',
201            'organization': 'organization',
202        }
203        self._account_id = account_id
204        self.is_default = is_default
205        self._account_name = account_name
206        self._base_uri = base_uri
207        self._organization = organization
208
209    def get_is_default(self):
210        return self.get_is_default
211
212    @property
213    def account_id(self):
214        return self._account_id
215
216    @account_id.setter
217    def account_id(self, account_id):
218        self._account_id = account_id
219
220    @property
221    def is_default(self):
222        return self._is_default
223
224    @is_default.setter
225    def is_default(self, is_default):
226        self._is_default = is_default
227
228    @property
229    def account_name(self):
230        return self._account_name
231
232    @account_name.setter
233    def account_name(self, account_name):
234        self._account_name = account_name
235
236    @property
237    def base_uri(self):
238        return self._base_uri
239
240    @base_uri.setter
241    def base_uri(self, base_uri):
242        self._base_uri = base_uri
243
244    @property
245    def organization(self):
246        return self._organization
247
248    @organization.setter
249    def organization(self, organization):
250        self._organization = organization
Account( account_id=None, is_default=None, account_name=None, base_uri=None, organization=None)
187    def __init__(self, account_id=None, is_default=None, account_name=None, base_uri=None, organization=None):
188        self.swagger_types = {
189            'account_id': 'str',
190            'is_default': 'str',
191            'account_name': 'str',
192            'base_uri': 'str',
193            'organization': 'str',
194        }
195
196        self.attribute_map =  {
197            'account_id': 'account_id',
198            'is_default': 'is_default',
199            'account_name': 'account_name',
200            'base_uri': 'base_uri',
201            'organization': 'organization',
202        }
203        self._account_id = account_id
204        self.is_default = is_default
205        self._account_name = account_name
206        self._base_uri = base_uri
207        self._organization = organization
is_default
def get_is_default(self)
209    def get_is_default(self):
210        return self.get_is_default
account_id
account_name
base_uri
organization
class Organization:
299class Organization(object):
300    def __init__(self, organization_id=None, links=None):
301        self._organization_id = organization_id
302        self._links = links
303
304    @property
305    def organization_id(self):
306        return self._organization_id
307
308    @organization_id.setter
309    def organization_id(self, organization_id):
310        self._organization_id = organization_id
311
312    @property
313    def links(self):
314        return self._links
315
316    @links.setter
317    def links(self, links):
318        self._links = links
319
320    def list(self):
321        if not self._links:
322            self._links = list()
323        return self._links
324
325    def add_links(self, link):
326        if not self.links:
327            self.links = list()
328        self._links.append(link)
329
330    def __str__(self):
331        return "class Organization {\n    organization_id: {}\n    links: {}".format(
332            self.to_indented_string(self._organization_id),
333            self.to_indented_string(self._links)
334        )
335
336    def to_indented_string(self, obj):
337
338        if obj:
339            return str(obj).replace("\n", "\n    ")
340        return None
341
342    def __eq__(self, other):
343        if not other:
344            return False
345        return (self.organization_id == other.organization_id or self.organization_id
346                and self.organization_id == other.organization_id) and\
347               (self.links == other.links or self.links and self.links == other.links)
Organization(organization_id=None, links=None)
300    def __init__(self, organization_id=None, links=None):
301        self._organization_id = organization_id
302        self._links = links
organization_id
def list(self)
320    def list(self):
321        if not self._links:
322            self._links = list()
323        return self._links
def to_indented_string(self, obj)
336    def to_indented_string(self, obj):
337
338        if obj:
339            return str(obj).replace("\n", "\n    ")
340        return None
class OAuthToken:
350class OAuthToken(object):
351
352    def __init__(self, access_token=None, data=None, expires_in=None, refresh_token=None, scope=None, token_type=None):
353        """
354        OAuthToken - a model defined in Swagger
355
356        :param dict swaggerTypes: The key is attribute name
357                                  and the value is attribute type.
358        :param dict attributeMap: The key is attribute name
359                                  and the value is json key in definition.
360        """
361        self.swagger_types = {
362            'access_token': 'str',
363            'data': 'list[NameValue]',
364            'expires_in': 'str',
365            'refresh_token': 'str',
366            'scope': 'str',
367            'token_type': 'str'
368        }
369
370        self.attribute_map = {
371            'access_token': 'access_token',
372            'data': 'data',
373            'expires_in': 'expires_in',
374            'refresh_token': 'refresh_token',
375            'scope': 'scope',
376            'token_type': 'token_type'
377        }
378
379        self._access_token = access_token
380        self._data = data
381        self._expires_in = expires_in
382        self._refresh_token = refresh_token
383        self._scope = scope
384        self._token_type = token_type
385
386    @property
387    def access_token(self):
388        """
389        Gets the access_token of this OAuthToken.
390        Access token information.
391
392        :return: The access_token of this OAuthToken.
393        :rtype: str
394        """
395        return self._access_token
396
397    @access_token.setter
398    def access_token(self, access_token):
399        """
400        Sets the access_token of this OAuthToken.
401        Access token information.
402
403        :param access_token: The access_token of this OAuthToken.
404        :type: str
405        """
406
407        self._access_token = access_token
408
409    @property
410    def data(self):
411        """
412        Gets the data of this OAuthToken.
413        
414
415        :return: The data of this OAuthToken.
416        :rtype: list[NameValue]
417        """
418        return self._data
419
420    @data.setter
421    def data(self, data):
422        """
423        Sets the data of this OAuthToken.
424        
425
426        :param data: The data of this OAuthToken.
427        :type: list[NameValue]
428        """
429
430        self._data = data
431
432    @property
433    def expires_in(self):
434        """
435        Gets the expires_in of this OAuthToken.
436        
437
438        :return: The expires_in of this OAuthToken.
439        :rtype: str
440        """
441        return self._expires_in
442
443    @expires_in.setter
444    def expires_in(self, expires_in):
445        """
446        Sets the expires_in of this OAuthToken.
447        
448
449        :param expires_in: The expires_in of this OAuthToken.
450        :type: str
451        """
452
453        self._expires_in = expires_in
454
455    @property
456    def refresh_token(self):
457        """
458        Gets the refresh_token of this OAuthToken.
459        
460
461        :return: The refresh_token of this OAuthToken.
462        :rtype: str
463        """
464        return self._refresh_token
465
466    @refresh_token.setter
467    def refresh_token(self, refresh_token):
468        """
469        Sets the refresh_token of this OAuthToken.
470        
471
472        :param refresh_token: The refresh_token of this OAuthToken.
473        :type: str
474        """
475
476        self._refresh_token = refresh_token
477
478    @property
479    def scope(self):
480        """
481        Gets the scope of this OAuthToken.
482        Must be set to \"api\".
483
484        :return: The scope of this OAuthToken.
485        :rtype: str
486        """
487        return self._scope
488
489    @scope.setter
490    def scope(self, scope):
491        """
492        Sets the scope of this OAuthToken.
493        Must be set to \"api\".
494
495        :param scope: The scope of this OAuthToken.
496        :type: str
497        """
498
499        self._scope = scope
500
501    @property
502    def token_type(self):
503        """
504        Gets the token_type of this OAuthToken.
505        
506
507        :return: The token_type of this OAuthToken.
508        :rtype: str
509        """
510        return self._token_type
511
512    @token_type.setter
513    def token_type(self, token_type):
514        """
515        Sets the token_type of this OAuthToken.
516        
517
518        :param token_type: The token_type of this OAuthToken.
519        :type: str
520        """
521
522        self._token_type = token_type
523
524    def to_dict(self):
525        """
526        Returns the model properties as a dict
527        """
528        result = {}
529
530        for attr, _ in iteritems(self.swagger_types):
531            value = getattr(self, attr)
532            if isinstance(value, list):
533                result[attr] = list(map(
534                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
535                    value
536                ))
537            elif hasattr(value, "to_dict"):
538                result[attr] = value.to_dict()
539            elif isinstance(value, dict):
540                result[attr] = dict(map(
541                    lambda item: (item[0], item[1].to_dict())
542                    if hasattr(item[1], "to_dict") else item,
543                    value.items()
544                ))
545            else:
546                result[attr] = value
547
548        return result
549
550    def to_str(self):
551        """
552        Returns the string representation of the model
553        """
554        return pformat(self.to_dict())
555
556    def __repr__(self):
557        """
558        For `print` and `pprint`
559        """
560        return self.to_str()
561
562    def __eq__(self, other):
563        """
564        Returns true if both objects are equal
565        """
566        return self.__dict__ == other.__dict__
567
568    def __ne__(self, other):
569        """
570        Returns true if both objects are not equal
571        """
572        return not self == other
OAuthToken( access_token=None, data=None, expires_in=None, refresh_token=None, scope=None, token_type=None)
352    def __init__(self, access_token=None, data=None, expires_in=None, refresh_token=None, scope=None, token_type=None):
353        """
354        OAuthToken - a model defined in Swagger
355
356        :param dict swaggerTypes: The key is attribute name
357                                  and the value is attribute type.
358        :param dict attributeMap: The key is attribute name
359                                  and the value is json key in definition.
360        """
361        self.swagger_types = {
362            'access_token': 'str',
363            'data': 'list[NameValue]',
364            'expires_in': 'str',
365            'refresh_token': 'str',
366            'scope': 'str',
367            'token_type': 'str'
368        }
369
370        self.attribute_map = {
371            'access_token': 'access_token',
372            'data': 'data',
373            'expires_in': 'expires_in',
374            'refresh_token': 'refresh_token',
375            'scope': 'scope',
376            'token_type': 'token_type'
377        }
378
379        self._access_token = access_token
380        self._data = data
381        self._expires_in = expires_in
382        self._refresh_token = refresh_token
383        self._scope = scope
384        self._token_type = token_type

OAuthToken - a model defined in Swagger

Parameters
  • dict swaggerTypes: The key is attribute name and the value is attribute type.
  • dict attributeMap: The key is attribute name and the value is json key in definition.
access_token

Gets the access_token of this OAuthToken. Access token information.

Returns

The access_token of this OAuthToken.

data

Gets the data of this OAuthToken.

Returns

The data of this OAuthToken.

expires_in

Gets the expires_in of this OAuthToken.

Returns

The expires_in of this OAuthToken.

refresh_token

Gets the refresh_token of this OAuthToken.

Returns

The refresh_token of this OAuthToken.

scope

Gets the scope of this OAuthToken. Must be set to "api".

Returns

The scope of this OAuthToken.

token_type

Gets the token_type of this OAuthToken.

Returns

The token_type of this OAuthToken.

def to_dict(self)
524    def to_dict(self):
525        """
526        Returns the model properties as a dict
527        """
528        result = {}
529
530        for attr, _ in iteritems(self.swagger_types):
531            value = getattr(self, attr)
532            if isinstance(value, list):
533                result[attr] = list(map(
534                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
535                    value
536                ))
537            elif hasattr(value, "to_dict"):
538                result[attr] = value.to_dict()
539            elif isinstance(value, dict):
540                result[attr] = dict(map(
541                    lambda item: (item[0], item[1].to_dict())
542                    if hasattr(item[1], "to_dict") else item,
543                    value.items()
544                ))
545            else:
546                result[attr] = value
547
548        return result

Returns the model properties as a dict

def to_str(self)
550    def to_str(self):
551        """
552        Returns the string representation of the model
553        """
554        return pformat(self.to_dict())

Returns the string representation of the model