:calls: `PATCH /authorizations/{id} `_ :param scopes: list of string :param add_scopes: list of string :param remove_scopes: list of string :param note: string :param note_url: string
(
self,
scopes: Opt[list[str]] = NotSet,
add_scopes: Opt[list[str]] = NotSet,
remove_scopes: Opt[list[str]] = NotSet,
note: Opt[str] = NotSet,
note_url: Opt[str] = NotSet,
)
| 128 | headers, data = self._requester.requestJsonAndCheck("DELETE", self.url) |
| 129 | |
| 130 | def edit( |
| 131 | self, |
| 132 | scopes: Opt[list[str]] = NotSet, |
| 133 | add_scopes: Opt[list[str]] = NotSet, |
| 134 | remove_scopes: Opt[list[str]] = NotSet, |
| 135 | note: Opt[str] = NotSet, |
| 136 | note_url: Opt[str] = NotSet, |
| 137 | ) -> None: |
| 138 | """ |
| 139 | :calls: `PATCH /authorizations/{id} <https://docs.github.com/en/developers/apps/authorizing-oauth-apps>`_ |
| 140 | :param scopes: list of string |
| 141 | :param add_scopes: list of string |
| 142 | :param remove_scopes: list of string |
| 143 | :param note: string |
| 144 | :param note_url: string |
| 145 | :rtype: None |
| 146 | """ |
| 147 | assert isinstance(scopes, _NotSetType) or all(isinstance(element, str) for element in scopes), scopes |
| 148 | assert isinstance(add_scopes, _NotSetType) or all( |
| 149 | isinstance(element, str) for element in add_scopes |
| 150 | ), add_scopes |
| 151 | assert isinstance(remove_scopes, _NotSetType) or all( |
| 152 | isinstance(element, str) for element in remove_scopes |
| 153 | ), remove_scopes |
| 154 | assert isinstance(note, (_NotSetType, str)), note |
| 155 | assert isinstance(note_url, (_NotSetType, str)), note_url |
| 156 | |
| 157 | post_parameters = NotSet.remove_unset_items( |
| 158 | { |
| 159 | "scopes": scopes, |
| 160 | "add_scopes": add_scopes, |
| 161 | "remove_scopes": remove_scopes, |
| 162 | "note": note, |
| 163 | "note_url": note_url, |
| 164 | } |
| 165 | ) |
| 166 | |
| 167 | headers, data = self._requester.requestJsonAndCheck("PATCH", self.url, input=post_parameters) |
| 168 | self._useAttributes(data) |
| 169 | |
| 170 | def _useAttributes(self, attributes: dict[str, Any]) -> None: |
| 171 | if "app" in attributes: # pragma no branch |
nothing calls this directly
no test coverage detected