(
cls,
metadata,
refresh_using,
method,
advisory_timeout=None,
mandatory_timeout=None,
)
| 438 | |
| 439 | @classmethod |
| 440 | def create_from_metadata( |
| 441 | cls, |
| 442 | metadata, |
| 443 | refresh_using, |
| 444 | method, |
| 445 | advisory_timeout=None, |
| 446 | mandatory_timeout=None, |
| 447 | ): |
| 448 | kwargs = {} |
| 449 | if advisory_timeout is not None: |
| 450 | kwargs['advisory_timeout'] = advisory_timeout |
| 451 | if mandatory_timeout is not None: |
| 452 | kwargs['mandatory_timeout'] = mandatory_timeout |
| 453 | |
| 454 | instance = cls( |
| 455 | access_key=metadata['access_key'], |
| 456 | secret_key=metadata['secret_key'], |
| 457 | token=metadata['token'], |
| 458 | expiry_time=cls._expiry_datetime(metadata['expiry_time']), |
| 459 | method=method, |
| 460 | refresh_using=refresh_using, |
| 461 | account_id=metadata.get('account_id'), |
| 462 | **kwargs, |
| 463 | ) |
| 464 | return instance |
| 465 | |
| 466 | @property |
| 467 | def access_key(self): |
no test coverage detected