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