backup_code

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package backup_code provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.

Index

Constants

View Source
const (
	BasicAuthScopes = "BasicAuth.Scopes"
	OAuth2Scopes    = "OAuth2.Scopes"
)

Variables

This section is empty.

Functions

func NewDeleteMeBackupCodesRequest

func NewDeleteMeBackupCodesRequest(server string) (*http.Request, error)

NewDeleteMeBackupCodesRequest generates requests for DeleteMeBackupCodes

func NewGetMeBackupCodesRequest

func NewGetMeBackupCodesRequest(server string) (*http.Request, error)

NewGetMeBackupCodesRequest generates requests for GetMeBackupCodes

func NewPostMeBackupCodesRequest

func NewPostMeBackupCodesRequest(server string) (*http.Request, error)

NewPostMeBackupCodesRequest generates requests for PostMeBackupCodes

Types

type BackupCodeResponse

type BackupCodeResponse struct {
	// BackupCodes Backup codes of the authenticated user.
	BackupCodes *[]string `json:"backupCodes,omitempty"`
}

BackupCodeResponse Backup code response.

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) DeleteMeBackupCodes

func (c *Client) DeleteMeBackupCodes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetMeBackupCodes

func (c *Client) GetMeBackupCodes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) PostMeBackupCodes

func (c *Client) PostMeBackupCodes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// DeleteMeBackupCodes request
	DeleteMeBackupCodes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetMeBackupCodes request
	GetMeBackupCodes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// PostMeBackupCodes request
	PostMeBackupCodes(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) DeleteMeBackupCodesWithResponse

func (c *ClientWithResponses) DeleteMeBackupCodesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DeleteMeBackupCodesResponse, error)

DeleteMeBackupCodesWithResponse request returning *DeleteMeBackupCodesResponse

func (*ClientWithResponses) GetMeBackupCodesWithResponse

func (c *ClientWithResponses) GetMeBackupCodesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMeBackupCodesResponse, error)

GetMeBackupCodesWithResponse request returning *GetMeBackupCodesResponse

func (*ClientWithResponses) PostMeBackupCodesWithResponse

func (c *ClientWithResponses) PostMeBackupCodesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostMeBackupCodesResponse, error)

PostMeBackupCodesWithResponse request returning *PostMeBackupCodesResponse

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// DeleteMeBackupCodesWithResponse request
	DeleteMeBackupCodesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*DeleteMeBackupCodesResponse, error)

	// GetMeBackupCodesWithResponse request
	GetMeBackupCodesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMeBackupCodesResponse, error)

	// PostMeBackupCodesWithResponse request
	PostMeBackupCodesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*PostMeBackupCodesResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type DeleteMeBackupCodesResponse

type DeleteMeBackupCodesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON500      *Error
}

func ParseDeleteMeBackupCodesResponse

func ParseDeleteMeBackupCodesResponse(rsp *http.Response) (*DeleteMeBackupCodesResponse, error)

ParseDeleteMeBackupCodesResponse parses an HTTP response from a DeleteMeBackupCodesWithResponse call

func (DeleteMeBackupCodesResponse) Status

Status returns HTTPResponse.Status

func (DeleteMeBackupCodesResponse) StatusCode

func (r DeleteMeBackupCodesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Error

type Error struct {
	// Code Error code.
	Code string `json:"code"`

	// Description Error description.
	Description *string `json:"description,omitempty"`

	// Message Error message.
	Message string `json:"message"`

	// TraceId Error trace id.
	TraceId string `json:"traceId"`
}

Error Backup code error.

type GetMeBackupCodesResponse

type GetMeBackupCodesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *RemainingBackupCodeResponse
	JSON500      *Error
}

func ParseGetMeBackupCodesResponse

func ParseGetMeBackupCodesResponse(rsp *http.Response) (*GetMeBackupCodesResponse, error)

ParseGetMeBackupCodesResponse parses an HTTP response from a GetMeBackupCodesWithResponse call

func (GetMeBackupCodesResponse) Status

func (r GetMeBackupCodesResponse) Status() string

Status returns HTTPResponse.Status

func (GetMeBackupCodesResponse) StatusCode

func (r GetMeBackupCodesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type PostMeBackupCodesResponse

type PostMeBackupCodesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *BackupCodeResponse
	JSON500      *Error
}

func ParsePostMeBackupCodesResponse

func ParsePostMeBackupCodesResponse(rsp *http.Response) (*PostMeBackupCodesResponse, error)

ParsePostMeBackupCodesResponse parses an HTTP response from a PostMeBackupCodesWithResponse call

func (PostMeBackupCodesResponse) Status

func (r PostMeBackupCodesResponse) Status() string

Status returns HTTPResponse.Status

func (PostMeBackupCodesResponse) StatusCode

func (r PostMeBackupCodesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type RemainingBackupCodeResponse

type RemainingBackupCodeResponse struct {
	// RemainingBackupCodesCount Remaining backup codes of the authenticated user.
	RemainingBackupCodesCount *int `json:"remainingBackupCodesCount,omitempty"`
}

RemainingBackupCodeResponse Remaining backup code response.

type RequestEditorFn

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

Jump to

Keyboard shortcuts

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