264 lines
7.7 KiB
Go
264 lines
7.7 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package authentication
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"github.com/go-openapi/runtime"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// New creates a new authentication API client.
|
|
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
|
|
return &Client{transport: transport, formats: formats}
|
|
}
|
|
|
|
/*
|
|
Client for authentication API
|
|
*/
|
|
type Client struct {
|
|
transport runtime.ClientTransport
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
/*
|
|
DeleteToken endpoints to remove a token by the given opaque token Id
|
|
|
|
Endpoint to remove a token by the given opaqueTokenId
|
|
*/
|
|
func (a *Client) DeleteToken(params *DeleteTokenParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteTokenOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewDeleteTokenParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "DeleteToken",
|
|
Method: "DELETE",
|
|
PathPattern: "/tokens/{opaqueTokenId}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &DeleteTokenReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*DeleteTokenOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
GetMe Request user information based on a given token
|
|
*/
|
|
func (a *Client) GetMe(params *GetMeParams, authInfo runtime.ClientAuthInfoWriter) (*GetMeOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewGetMeParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "GetMe",
|
|
Method: "GET",
|
|
PathPattern: "/me",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &GetMeReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*GetMeOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
ListTokens endpoints to retrieve an opaque overview of active tokens for the logged in user
|
|
|
|
Endpoint to retrieve an opaque overview of the active tokens for the logged in user, received id's can not be used as actual tokens.
|
|
*/
|
|
func (a *Client) ListTokens(params *ListTokensParams, authInfo runtime.ClientAuthInfoWriter) (*ListTokensOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewListTokensParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "ListTokens",
|
|
Method: "GET",
|
|
PathPattern: "/tokens",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListTokensReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*ListTokensOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
PostLogin Authenticate user and retrieve security token
|
|
*/
|
|
func (a *Client) PostLogin(params *PostLoginParams) (*PostLoginOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewPostLoginParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "PostLogin",
|
|
Method: "POST",
|
|
PathPattern: "/login",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &PostLoginReader{formats: a.formats},
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*PostLoginOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
PostPasswordResetRedeem Redeem user-bound reset code, changes the users password
|
|
*/
|
|
func (a *Client) PostPasswordResetRedeem(params *PostPasswordResetRedeemParams) (*PostPasswordResetRedeemCreated, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewPostPasswordResetRedeemParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "PostPasswordResetRedeem",
|
|
Method: "POST",
|
|
PathPattern: "/password-reset/redeem",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &PostPasswordResetRedeemReader{formats: a.formats},
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*PostPasswordResetRedeemCreated), nil
|
|
|
|
}
|
|
|
|
/*
|
|
PostPasswordResetRequest Create user-bound reset code
|
|
*/
|
|
func (a *Client) PostPasswordResetRequest(params *PostPasswordResetRequestParams) (*PostPasswordResetRequestCreated, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewPostPasswordResetRequestParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "PostPasswordResetRequest",
|
|
Method: "POST",
|
|
PathPattern: "/password-reset/request",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &PostPasswordResetRequestReader{formats: a.formats},
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*PostPasswordResetRequestCreated), nil
|
|
|
|
}
|
|
|
|
/*
|
|
Verify Verify the given token
|
|
*/
|
|
func (a *Client) Verify(params *VerifyParams, authInfo runtime.ClientAuthInfoWriter) (*VerifyOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewVerifyParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "Verify",
|
|
Method: "POST",
|
|
PathPattern: "/verify",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &VerifyReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*VerifyOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
Logout Logout user and remove security token
|
|
*/
|
|
func (a *Client) Logout(params *LogoutParams, authInfo runtime.ClientAuthInfoWriter) (*LogoutNoContent, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewLogoutParams()
|
|
}
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "logout",
|
|
Method: "POST",
|
|
PathPattern: "/logout",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &LogoutReader{formats: a.formats},
|
|
AuthInfo: authInfo,
|
|
Context: params.Context,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*LogoutNoContent), nil
|
|
|
|
}
|
|
|
|
// SetTransport changes the transport on the client
|
|
func (a *Client) SetTransport(transport runtime.ClientTransport) {
|
|
a.transport = transport
|
|
}
|