Struct roctogen::endpoints::oauth_authorizations::OauthAuthorizations[][src]

pub struct OauthAuthorizations<'api> { /* fields omitted */ }

Implementations

impl<'api> OauthAuthorizations<'api>[src]

pub async fn create_authorization_async(
    &self,
    body: PostOauthAuthorizationsCreateAuthorization
) -> Result<Authorization, OauthAuthorizationsCreateAuthorizationError>
[src]


Create a new authorization

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.

Creates OAuth tokens using Basic Authentication. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app’s client ID and secret, found on your OAuth application’s settings page. If your OAuth application intends to create multiple tokens for one user, use fingerprint to differentiate between them.

You can also create tokens on GitHub from the personal access tokens settings page. Read more about these tokens in the GitHub Help documentation.

Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in the GitHub Help documentation.

GitHub API docs for create_authorization


pub fn create_authorization(
    &self,
    body: PostOauthAuthorizationsCreateAuthorization
) -> Result<Authorization, OauthAuthorizationsCreateAuthorizationError>
[src]


Create a new authorization

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.

Creates OAuth tokens using Basic Authentication. If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app’s client ID and secret, found on your OAuth application’s settings page. If your OAuth application intends to create multiple tokens for one user, use fingerprint to differentiate between them.

You can also create tokens on GitHub from the personal access tokens settings page. Read more about these tokens in the GitHub Help documentation.

Organizations that enforce SAML SSO require personal access tokens to be allowed. Read more about allowing tokens in the GitHub Help documentation.

GitHub API docs for create_authorization


pub async fn delete_authorization_async(
    &self,
    authorization_id: i32
) -> Result<(), OauthAuthorizationsDeleteAuthorizationError>
[src]


Delete an authorization

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for delete_authorization


pub fn delete_authorization(
    &self,
    authorization_id: i32
) -> Result<(), OauthAuthorizationsDeleteAuthorizationError>
[src]


Delete an authorization

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for delete_authorization


pub async fn delete_grant_async(
    &self,
    grant_id: i32
) -> Result<(), OauthAuthorizationsDeleteGrantError>
[src]


Delete a grant

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

Deleting an OAuth application’s grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on the application authorizations settings screen within GitHub.

GitHub API docs for delete_grant


pub fn delete_grant(
    &self,
    grant_id: i32
) -> Result<(), OauthAuthorizationsDeleteGrantError>
[src]


Delete a grant

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

Deleting an OAuth application’s grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on the application authorizations settings screen within GitHub.

GitHub API docs for delete_grant


pub async fn get_authorization_async(
    &self,
    authorization_id: i32
) -> Result<Authorization, OauthAuthorizationsGetAuthorizationError>
[src]


Get a single authorization

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for get_authorization


pub fn get_authorization(
    &self,
    authorization_id: i32
) -> Result<Authorization, OauthAuthorizationsGetAuthorizationError>
[src]


Get a single authorization

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for get_authorization


pub async fn get_grant_async(
    &self,
    grant_id: i32
) -> Result<ApplicationGrant, OauthAuthorizationsGetGrantError>
[src]


Get a single grant

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for get_grant


pub fn get_grant(
    &self,
    grant_id: i32
) -> Result<ApplicationGrant, OauthAuthorizationsGetGrantError>
[src]


Get a single grant

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for get_grant


pub async fn get_or_create_authorization_for_app_async(
    &self,
    client_id: &str,
    body: PutOauthAuthorizationsGetOrCreateAuthorizationForApp
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError>
[src]


Get-or-create an authorization for a specific app

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.

Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn’t already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.

If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for get_or_create_authorization_for_app


pub fn get_or_create_authorization_for_app(
    &self,
    client_id: &str,
    body: PutOauthAuthorizationsGetOrCreateAuthorizationForApp
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppError>
[src]


Get-or-create an authorization for a specific app

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.

Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn’t already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.

If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for get_or_create_authorization_for_app


pub async fn get_or_create_authorization_for_app_and_fingerprint_async(
    &self,
    client_id: &str,
    fingerprint: &str,
    body: PutOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError>
[src]


Get-or-create an authorization for a specific app and fingerprint

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.

This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. fingerprint is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.

If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

GitHub API docs for get_or_create_authorization_for_app_and_fingerprint


pub fn get_or_create_authorization_for_app_and_fingerprint(
    &self,
    client_id: &str,
    fingerprint: &str,
    body: PutOauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprint
) -> Result<Authorization, OauthAuthorizationsGetOrCreateAuthorizationForAppAndFingerprintError>
[src]


Get-or-create an authorization for a specific app and fingerprint

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

Warning: Apps must use the web application flow to obtain OAuth tokens that work with GitHub SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub SAML organizations. For more information, see the blog post.

This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. fingerprint is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user’s existing authorization for the application if one is present. Otherwise, it creates and returns a new one.

If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

GitHub API docs for get_or_create_authorization_for_app_and_fingerprint


pub async fn list_authorizations_async(
    &self,
    query_params: Option<impl Into<OauthAuthorizationsListAuthorizationsParams<'api>>>
) -> Result<Vec<Authorization>, OauthAuthorizationsListAuthorizationsError>
[src]


List your authorizations

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for list_authorizations


pub fn list_authorizations(
    &self,
    query_params: Option<impl Into<OauthAuthorizationsListAuthorizationsParams<'api>>>
) -> Result<Vec<Authorization>, OauthAuthorizationsListAuthorizationsError>
[src]


List your authorizations

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

GitHub API docs for list_authorizations


pub async fn list_grants_async(
    &self,
    query_params: Option<impl Into<OauthAuthorizationsListGrantsParams<'api>>>
) -> Result<Vec<ApplicationGrant>, OauthAuthorizationsListGrantsError>
[src]


List your grants

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the list your authorizations API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on the application authorizations settings screen within GitHub. The scopes returned are the union of scopes authorized for the application. For example, if an application has one token with repo scope and another token with user scope, the grant will return ["repo", "user"].

GitHub API docs for list_grants


pub fn list_grants(
    &self,
    query_params: Option<impl Into<OauthAuthorizationsListGrantsParams<'api>>>
) -> Result<Vec<ApplicationGrant>, OauthAuthorizationsListGrantsError>
[src]


List your grants

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the list your authorizations API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on the application authorizations settings screen within GitHub. The scopes returned are the union of scopes authorized for the application. For example, if an application has one token with repo scope and another token with user scope, the grant will return ["repo", "user"].

GitHub API docs for list_grants


pub async fn update_authorization_async(
    &self,
    authorization_id: i32,
    body: PatchOauthAuthorizationsUpdateAuthorization
) -> Result<Authorization, OauthAuthorizationsUpdateAuthorizationError>
[src]


Update an existing authorization

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

You can only send one of these scope keys at a time.

GitHub API docs for update_authorization


pub fn update_authorization(
    &self,
    authorization_id: i32,
    body: PatchOauthAuthorizationsUpdateAuthorization
) -> Result<Authorization, OauthAuthorizationsUpdateAuthorizationError>
[src]


Update an existing authorization

Deprecation Notice: GitHub will discontinue the OAuth Authorizations API, which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our web application flow. The OAuth Authorizations API will be removed on November, 13, 2020. For more information, including scheduled brownouts, see the blog post.

If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see “Working with two-factor authentication.”

You can only send one of these scope keys at a time.

GitHub API docs for update_authorization


Auto Trait Implementations

impl<'api> RefUnwindSafe for OauthAuthorizations<'api>

impl<'api> Send for OauthAuthorizations<'api>

impl<'api> Sync for OauthAuthorizations<'api>

impl<'api> Unpin for OauthAuthorizations<'api>

impl<'api> UnwindSafe for OauthAuthorizations<'api>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.