Main class to obtain tokens for a GitHub integration.
| 55 | |
| 56 | |
| 57 | class GithubIntegration: |
| 58 | """ |
| 59 | Main class to obtain tokens for a GitHub integration. |
| 60 | """ |
| 61 | |
| 62 | # keep non-deprecated arguments in-sync with Requester |
| 63 | # v3: remove integration_id, private_key, jwt_expiry, jwt_issued_at and jwt_algorithm |
| 64 | # v3: move auth to the front of arguments |
| 65 | # v3: move * before first argument so all arguments must be named, |
| 66 | # allows to reorder / add new arguments / remove deprecated arguments without breaking user code |
| 67 | # added here to force named parameters because new parameters have been added |
| 68 | auth: AppAuth |
| 69 | base_url: str |
| 70 | __requester: Requester |
| 71 | |
| 72 | def __init__( |
| 73 | self, |
| 74 | integration_id: int | str | None = None, |
| 75 | private_key: str | None = None, |
| 76 | base_url: str = Consts.DEFAULT_BASE_URL, |
| 77 | *, |
| 78 | timeout: int = Consts.DEFAULT_TIMEOUT, |
| 79 | user_agent: str = Consts.DEFAULT_USER_AGENT, |
| 80 | per_page: int = Consts.DEFAULT_PER_PAGE, |
| 81 | verify: bool | str = True, |
| 82 | retry: int | Retry | None = None, |
| 83 | pool_size: int | None = None, |
| 84 | seconds_between_requests: float | None = Consts.DEFAULT_SECONDS_BETWEEN_REQUESTS, |
| 85 | seconds_between_writes: float | None = Consts.DEFAULT_SECONDS_BETWEEN_WRITES, |
| 86 | jwt_expiry: int = Consts.DEFAULT_JWT_EXPIRY, |
| 87 | jwt_issued_at: int = Consts.DEFAULT_JWT_ISSUED_AT, |
| 88 | jwt_algorithm: str = Consts.DEFAULT_JWT_ALGORITHM, |
| 89 | auth: AppAuth | None = None, |
| 90 | # v3: set lazy = True as the default |
| 91 | lazy: bool = False, |
| 92 | ) -> None: |
| 93 | """ |
| 94 | :param integration_id: int deprecated, use auth=github.Auth.AppAuth(...) instead |
| 95 | :param private_key: string deprecated, use auth=github.Auth.AppAuth(...) instead |
| 96 | :param base_url: string |
| 97 | :param timeout: integer |
| 98 | :param user_agent: string |
| 99 | :param per_page: int |
| 100 | :param verify: boolean or string |
| 101 | :param retry: int or urllib3.util.retry.Retry object |
| 102 | :param pool_size: int |
| 103 | :param seconds_between_requests: float |
| 104 | :param seconds_between_writes: float |
| 105 | :param jwt_expiry: int deprecated, use auth=github.Auth.AppAuth(...) instead |
| 106 | :param jwt_issued_at: int deprecated, use auth=github.Auth.AppAuth(...) instead |
| 107 | :param jwt_algorithm: string deprecated, use auth=github.Auth.AppAuth(...) instead |
| 108 | :param auth: authentication method |
| 109 | :param lazy: completable objects created from this instance are lazy, |
| 110 | as well as completable objects created from those, and so on |
| 111 | """ |
| 112 | if integration_id is not None: |
| 113 | assert isinstance(integration_id, (int, str)), integration_id |
| 114 | if private_key is not None: |
no outgoing calls
no test coverage detected
searching dependent graphs…