oauthauthorizations

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client []requests.Option

Client is a set of options to apply to requests

func NewClient

func NewClient(opt ...requests.Option) Client

NewClient returns a new Client

func (Client) CreateAuthorization

func (c Client) CreateAuthorization(ctx context.Context, req *CreateAuthorizationReq, opt ...requests.Option) (*CreateAuthorizationResponse, error)

CreateAuthorization performs requests for "oauth-authorizations/create-authorization"

Create a new authorization.

POST /authorizations

https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) DeleteAuthorization

func (c Client) DeleteAuthorization(ctx context.Context, req *DeleteAuthorizationReq, opt ...requests.Option) (*DeleteAuthorizationResponse, error)

DeleteAuthorization performs requests for "oauth-authorizations/delete-authorization"

Delete an authorization.

DELETE /authorizations/{authorization_id}

https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) DeleteGrant

func (c Client) DeleteGrant(ctx context.Context, req *DeleteGrantReq, opt ...requests.Option) (*DeleteGrantResponse, error)

DeleteGrant performs requests for "oauth-authorizations/delete-grant"

Delete a grant.

DELETE /applications/grants/{grant_id}

https://developer.github.com/v3/oauth_authorizations/#delete-a-grant

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) GetAuthorization

func (c Client) GetAuthorization(ctx context.Context, req *GetAuthorizationReq, opt ...requests.Option) (*GetAuthorizationResponse, error)

GetAuthorization performs requests for "oauth-authorizations/get-authorization"

Get a single authorization.

GET /authorizations/{authorization_id}

https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) GetGrant

func (c Client) GetGrant(ctx context.Context, req *GetGrantReq, opt ...requests.Option) (*GetGrantResponse, error)

GetGrant performs requests for "oauth-authorizations/get-grant"

Get a single grant.

GET /applications/grants/{grant_id}

https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) GetOrCreateAuthorizationForApp

GetOrCreateAuthorizationForApp performs requests for "oauth-authorizations/get-or-create-authorization-for-app"

Get-or-create an authorization for a specific app.

PUT /authorizations/clients/{client_id}

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) GetOrCreateAuthorizationForAppAndFingerprint

GetOrCreateAuthorizationForAppAndFingerprint performs requests for "oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint"

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

PUT /authorizations/clients/{client_id}/{fingerprint}

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) ListAuthorizations

func (c Client) ListAuthorizations(ctx context.Context, req *ListAuthorizationsReq, opt ...requests.Option) (*ListAuthorizationsResponse, error)

ListAuthorizations performs requests for "oauth-authorizations/list-authorizations"

List your authorizations.

GET /authorizations

https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) ListGrants

func (c Client) ListGrants(ctx context.Context, req *ListGrantsReq, opt ...requests.Option) (*ListGrantsResponse, error)

ListGrants performs requests for "oauth-authorizations/list-grants"

List your grants.

GET /applications/grants

https://developer.github.com/v3/oauth_authorizations/#list-your-grants

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (Client) UpdateAuthorization

func (c Client) UpdateAuthorization(ctx context.Context, req *UpdateAuthorizationReq, opt ...requests.Option) (*UpdateAuthorizationResponse, error)

UpdateAuthorization performs requests for "oauth-authorizations/update-authorization"

Update an existing authorization.

PATCH /authorizations/{authorization_id}

https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

type CreateAuthorizationReq

type CreateAuthorizationReq struct {
	RequestBody CreateAuthorizationReqBody
	// contains filtered or unexported fields
}

CreateAuthorizationReq is request data for Client.CreateAuthorization

https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*CreateAuthorizationReq) HTTPRequest

func (r *CreateAuthorizationReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*CreateAuthorizationReq) Rel

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type CreateAuthorizationReqBody

type CreateAuthorizationReqBody struct {

	// The OAuth app client key for which to create the token.
	ClientId *string `json:"client_id,omitempty"`

	// The OAuth app client secret for which to create the token.
	ClientSecret *string `json:"client_secret,omitempty"`

	// A unique string to distinguish an authorization from others created for the same client ID and user.
	Fingerprint *string `json:"fingerprint,omitempty"`

	// A note to remind you what the OAuth token is for.
	Note *string `json:"note,omitempty"`

	// A URL to remind you what app the OAuth token is for.
	NoteUrl *string `json:"note_url,omitempty"`

	// A list of scopes that this authorization is in.
	Scopes []string `json:"scopes,omitempty"`
}

CreateAuthorizationReqBody is a request body for oauth-authorizations/create-authorization

https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization

type CreateAuthorizationResponse

type CreateAuthorizationResponse struct {
	Data components.Authorization
	// contains filtered or unexported fields
}

CreateAuthorizationResponse is a response for CreateAuthorization

https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization

func CreateAuthorization

func CreateAuthorization(ctx context.Context, req *CreateAuthorizationReq, opt ...requests.Option) (*CreateAuthorizationResponse, error)

CreateAuthorization performs requests for "oauth-authorizations/create-authorization"

Create a new authorization.

POST /authorizations

https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization

func (*CreateAuthorizationResponse) HTTPResponse

func (r *CreateAuthorizationResponse) HTTPResponse() *http.Response

HTTPResponse returns the *http.Response

func (*CreateAuthorizationResponse) ReadResponse

func (r *CreateAuthorizationResponse) ReadResponse(resp *http.Response) error

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type DeleteAuthorizationReq

type DeleteAuthorizationReq struct {

	// authorization_id parameter
	AuthorizationId int64
	// contains filtered or unexported fields
}

DeleteAuthorizationReq is request data for Client.DeleteAuthorization

https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*DeleteAuthorizationReq) HTTPRequest

func (r *DeleteAuthorizationReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*DeleteAuthorizationReq) Rel

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type DeleteAuthorizationResponse

type DeleteAuthorizationResponse struct {
	// contains filtered or unexported fields
}

DeleteAuthorizationResponse is a response for DeleteAuthorization

https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization

func DeleteAuthorization

func DeleteAuthorization(ctx context.Context, req *DeleteAuthorizationReq, opt ...requests.Option) (*DeleteAuthorizationResponse, error)

DeleteAuthorization performs requests for "oauth-authorizations/delete-authorization"

Delete an authorization.

DELETE /authorizations/{authorization_id}

https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization

func (*DeleteAuthorizationResponse) HTTPResponse

func (r *DeleteAuthorizationResponse) HTTPResponse() *http.Response

HTTPResponse returns the *http.Response

func (*DeleteAuthorizationResponse) ReadResponse

func (r *DeleteAuthorizationResponse) ReadResponse(resp *http.Response) error

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type DeleteGrantReq

type DeleteGrantReq struct {

	// grant_id parameter
	GrantId int64
	// contains filtered or unexported fields
}

DeleteGrantReq is request data for Client.DeleteGrant

https://developer.github.com/v3/oauth_authorizations/#delete-a-grant

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*DeleteGrantReq) HTTPRequest

func (r *DeleteGrantReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*DeleteGrantReq) Rel

func (r *DeleteGrantReq) Rel(link string, resp *DeleteGrantResponse) bool

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type DeleteGrantResponse

type DeleteGrantResponse struct {
	// contains filtered or unexported fields
}

DeleteGrantResponse is a response for DeleteGrant

https://developer.github.com/v3/oauth_authorizations/#delete-a-grant

func DeleteGrant

func DeleteGrant(ctx context.Context, req *DeleteGrantReq, opt ...requests.Option) (*DeleteGrantResponse, error)

DeleteGrant performs requests for "oauth-authorizations/delete-grant"

Delete a grant.

DELETE /applications/grants/{grant_id}

https://developer.github.com/v3/oauth_authorizations/#delete-a-grant

func (*DeleteGrantResponse) HTTPResponse

func (r *DeleteGrantResponse) HTTPResponse() *http.Response

HTTPResponse returns the *http.Response

func (*DeleteGrantResponse) ReadResponse

func (r *DeleteGrantResponse) ReadResponse(resp *http.Response) error

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type GetAuthorizationReq

type GetAuthorizationReq struct {

	// authorization_id parameter
	AuthorizationId int64
	// contains filtered or unexported fields
}

GetAuthorizationReq is request data for Client.GetAuthorization

https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*GetAuthorizationReq) HTTPRequest

func (r *GetAuthorizationReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*GetAuthorizationReq) Rel

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type GetAuthorizationResponse

type GetAuthorizationResponse struct {
	Data components.Authorization
	// contains filtered or unexported fields
}

GetAuthorizationResponse is a response for GetAuthorization

https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization

func GetAuthorization

func GetAuthorization(ctx context.Context, req *GetAuthorizationReq, opt ...requests.Option) (*GetAuthorizationResponse, error)

GetAuthorization performs requests for "oauth-authorizations/get-authorization"

Get a single authorization.

GET /authorizations/{authorization_id}

https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization

func (*GetAuthorizationResponse) HTTPResponse

func (r *GetAuthorizationResponse) HTTPResponse() *http.Response

HTTPResponse returns the *http.Response

func (*GetAuthorizationResponse) ReadResponse

func (r *GetAuthorizationResponse) ReadResponse(resp *http.Response) error

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type GetGrantReq

type GetGrantReq struct {

	// grant_id parameter
	GrantId int64
	// contains filtered or unexported fields
}

GetGrantReq is request data for Client.GetGrant

https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*GetGrantReq) HTTPRequest

func (r *GetGrantReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*GetGrantReq) Rel

func (r *GetGrantReq) Rel(link string, resp *GetGrantResponse) bool

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type GetGrantResponse

type GetGrantResponse struct {
	Data components.ApplicationGrant
	// contains filtered or unexported fields
}

GetGrantResponse is a response for GetGrant

https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant

func GetGrant

func GetGrant(ctx context.Context, req *GetGrantReq, opt ...requests.Option) (*GetGrantResponse, error)

GetGrant performs requests for "oauth-authorizations/get-grant"

Get a single grant.

GET /applications/grants/{grant_id}

https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant

func (*GetGrantResponse) HTTPResponse

func (r *GetGrantResponse) HTTPResponse() *http.Response

HTTPResponse returns the *http.Response

func (*GetGrantResponse) ReadResponse

func (r *GetGrantResponse) ReadResponse(resp *http.Response) error

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type GetOrCreateAuthorizationForAppAndFingerprintReq

type GetOrCreateAuthorizationForAppAndFingerprintReq struct {
	ClientId string

	// fingerprint parameter
	Fingerprint string
	RequestBody GetOrCreateAuthorizationForAppAndFingerprintReqBody
	// contains filtered or unexported fields
}

GetOrCreateAuthorizationForAppAndFingerprintReq is request data for Client.GetOrCreateAuthorizationForAppAndFingerprint

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*GetOrCreateAuthorizationForAppAndFingerprintReq) HTTPRequest

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*GetOrCreateAuthorizationForAppAndFingerprintReq) Rel

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type GetOrCreateAuthorizationForAppAndFingerprintReqBody

type GetOrCreateAuthorizationForAppAndFingerprintReqBody struct {

	// The OAuth app client secret for which to create the token.
	ClientSecret *string `json:"client_secret"`

	// A note to remind you what the OAuth token is for.
	Note *string `json:"note,omitempty"`

	// A URL to remind you what app the OAuth token is for.
	NoteUrl *string `json:"note_url,omitempty"`

	// A list of scopes that this authorization is in.
	Scopes []string `json:"scopes,omitempty"`
}

GetOrCreateAuthorizationForAppAndFingerprintReqBody is a request body for oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint

type GetOrCreateAuthorizationForAppAndFingerprintResponse

type GetOrCreateAuthorizationForAppAndFingerprintResponse struct {
	Data components.Authorization
	// contains filtered or unexported fields
}

GetOrCreateAuthorizationForAppAndFingerprintResponse is a response for GetOrCreateAuthorizationForAppAndFingerprint

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint

func GetOrCreateAuthorizationForAppAndFingerprint

GetOrCreateAuthorizationForAppAndFingerprint performs requests for "oauth-authorizations/get-or-create-authorization-for-app-and-fingerprint"

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

PUT /authorizations/clients/{client_id}/{fingerprint}

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint

func (*GetOrCreateAuthorizationForAppAndFingerprintResponse) HTTPResponse

HTTPResponse returns the *http.Response

func (*GetOrCreateAuthorizationForAppAndFingerprintResponse) ReadResponse

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type GetOrCreateAuthorizationForAppReq

type GetOrCreateAuthorizationForAppReq struct {
	ClientId    string
	RequestBody GetOrCreateAuthorizationForAppReqBody
	// contains filtered or unexported fields
}

GetOrCreateAuthorizationForAppReq is request data for Client.GetOrCreateAuthorizationForApp

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*GetOrCreateAuthorizationForAppReq) HTTPRequest

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*GetOrCreateAuthorizationForAppReq) Rel

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type GetOrCreateAuthorizationForAppReqBody

type GetOrCreateAuthorizationForAppReqBody struct {

	// The OAuth app client secret for which to create the token.
	ClientSecret *string `json:"client_secret"`

	// A unique string to distinguish an authorization from others created for the same client ID and user.
	Fingerprint *string `json:"fingerprint,omitempty"`

	// A note to remind you what the OAuth token is for.
	Note *string `json:"note,omitempty"`

	// A URL to remind you what app the OAuth token is for.
	NoteUrl *string `json:"note_url,omitempty"`

	// A list of scopes that this authorization is in.
	Scopes []string `json:"scopes,omitempty"`
}

GetOrCreateAuthorizationForAppReqBody is a request body for oauth-authorizations/get-or-create-authorization-for-app

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app

type GetOrCreateAuthorizationForAppResponse

type GetOrCreateAuthorizationForAppResponse struct {
	Data components.Authorization
	// contains filtered or unexported fields
}

GetOrCreateAuthorizationForAppResponse is a response for GetOrCreateAuthorizationForApp

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app

func GetOrCreateAuthorizationForApp

GetOrCreateAuthorizationForApp performs requests for "oauth-authorizations/get-or-create-authorization-for-app"

Get-or-create an authorization for a specific app.

PUT /authorizations/clients/{client_id}

https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app

func (*GetOrCreateAuthorizationForAppResponse) HTTPResponse

HTTPResponse returns the *http.Response

func (*GetOrCreateAuthorizationForAppResponse) ReadResponse

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type ListAuthorizationsReq

type ListAuthorizationsReq struct {

	// Results per page (max 100)
	PerPage *int64

	// Page number of the results to fetch.
	Page *int64
	// contains filtered or unexported fields
}

ListAuthorizationsReq is request data for Client.ListAuthorizations

https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*ListAuthorizationsReq) HTTPRequest

func (r *ListAuthorizationsReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*ListAuthorizationsReq) Rel

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type ListAuthorizationsResponse

type ListAuthorizationsResponse struct {
	Data []components.Authorization
	// contains filtered or unexported fields
}

ListAuthorizationsResponse is a response for ListAuthorizations

https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations

func ListAuthorizations

func ListAuthorizations(ctx context.Context, req *ListAuthorizationsReq, opt ...requests.Option) (*ListAuthorizationsResponse, error)

ListAuthorizations performs requests for "oauth-authorizations/list-authorizations"

List your authorizations.

GET /authorizations

https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations

func (*ListAuthorizationsResponse) HTTPResponse

func (r *ListAuthorizationsResponse) HTTPResponse() *http.Response

HTTPResponse returns the *http.Response

func (*ListAuthorizationsResponse) ReadResponse

func (r *ListAuthorizationsResponse) ReadResponse(resp *http.Response) error

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type ListGrantsReq

type ListGrantsReq struct {

	// Results per page (max 100)
	PerPage *int64

	// Page number of the results to fetch.
	Page *int64
	// contains filtered or unexported fields
}

ListGrantsReq is request data for Client.ListGrants

https://developer.github.com/v3/oauth_authorizations/#list-your-grants

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*ListGrantsReq) HTTPRequest

func (r *ListGrantsReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*ListGrantsReq) Rel

func (r *ListGrantsReq) Rel(link string, resp *ListGrantsResponse) bool

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type ListGrantsResponse

type ListGrantsResponse struct {
	Data []components.ApplicationGrant
	// contains filtered or unexported fields
}

ListGrantsResponse is a response for ListGrants

https://developer.github.com/v3/oauth_authorizations/#list-your-grants

func ListGrants

func ListGrants(ctx context.Context, req *ListGrantsReq, opt ...requests.Option) (*ListGrantsResponse, error)

ListGrants performs requests for "oauth-authorizations/list-grants"

List your grants.

GET /applications/grants

https://developer.github.com/v3/oauth_authorizations/#list-your-grants

func (*ListGrantsResponse) HTTPResponse

func (r *ListGrantsResponse) HTTPResponse() *http.Response

HTTPResponse returns the *http.Response

func (*ListGrantsResponse) ReadResponse

func (r *ListGrantsResponse) ReadResponse(resp *http.Response) error

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

type UpdateAuthorizationReq

type UpdateAuthorizationReq struct {

	// authorization_id parameter
	AuthorizationId int64
	RequestBody     UpdateAuthorizationReqBody
	// contains filtered or unexported fields
}

UpdateAuthorizationReq is request data for Client.UpdateAuthorization

https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization

Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.

func (*UpdateAuthorizationReq) HTTPRequest

func (r *UpdateAuthorizationReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)

HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.

func (*UpdateAuthorizationReq) Rel

Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.

type UpdateAuthorizationReqBody

type UpdateAuthorizationReqBody struct {

	// A list of scopes to add to this authorization.
	AddScopes []string `json:"add_scopes,omitempty"`

	// A unique string to distinguish an authorization from others created for the same client ID and user.
	Fingerprint *string `json:"fingerprint,omitempty"`

	// A note to remind you what the OAuth token is for.
	Note *string `json:"note,omitempty"`

	// A URL to remind you what app the OAuth token is for.
	NoteUrl *string `json:"note_url,omitempty"`

	// A list of scopes to remove from this authorization.
	RemoveScopes []string `json:"remove_scopes,omitempty"`

	// A list of scopes that this authorization is in.
	Scopes []string `json:"scopes,omitempty"`
}

UpdateAuthorizationReqBody is a request body for oauth-authorizations/update-authorization

https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization

type UpdateAuthorizationResponse

type UpdateAuthorizationResponse struct {
	Data components.Authorization
	// contains filtered or unexported fields
}

UpdateAuthorizationResponse is a response for UpdateAuthorization

https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization

func UpdateAuthorization

func UpdateAuthorization(ctx context.Context, req *UpdateAuthorizationReq, opt ...requests.Option) (*UpdateAuthorizationResponse, error)

UpdateAuthorization performs requests for "oauth-authorizations/update-authorization"

Update an existing authorization.

PATCH /authorizations/{authorization_id}

https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization

func (*UpdateAuthorizationResponse) HTTPResponse

func (r *UpdateAuthorizationResponse) HTTPResponse() *http.Response

HTTPResponse returns the *http.Response

func (*UpdateAuthorizationResponse) ReadResponse

func (r *UpdateAuthorizationResponse) ReadResponse(resp *http.Response) error

ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL