user

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 12 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 struct {
	// contains filtered or unexported fields
}

Client for user API

func (*Client) GetMe

func (a *Client) GetMe(params *GetMeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMeOK, error)

GetMe extracts the connecting user from auth header

func (*Client) SetTransport

func (a *Client) SetTransport(transport runtime.ClientTransport)

SetTransport changes the transport on the client

type ClientOption

type ClientOption func(*runtime.ClientOperation)

ClientOption may be used to customize the behavior of Client methods.

type ClientService

type ClientService interface {
	GetMe(params *GetMeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetMeOK, error)

	SetTransport(transport runtime.ClientTransport)
}

ClientService is the interface for Client methods

func New

func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService

New creates a new user API client.

func NewClientWithBasicAuth added in v0.32.0

func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService

New creates a new user API client with basic auth credentials. It takes the following parameters: - host: http host (github.com). - basePath: any base path for the API client ("/v1", "/v3"). - scheme: http scheme ("http", "https"). - user: user for basic authentication header. - password: password for basic authentication header.

func NewClientWithBearerToken added in v0.32.0

func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService

New creates a new user API client with a bearer token for authentication. It takes the following parameters: - host: http host (github.com). - basePath: any base path for the API client ("/v1", "/v3"). - scheme: http scheme ("http", "https"). - bearerToken: bearer token for Bearer authentication header.

type GetMeDefault

type GetMeDefault struct {
	Payload *httperrors.HTTPErrorResponse
	// contains filtered or unexported fields
}

GetMeDefault describes a response with status code -1, with default header values.

Error

func NewGetMeDefault

func NewGetMeDefault(code int) *GetMeDefault

NewGetMeDefault creates a GetMeDefault with default headers values

func (*GetMeDefault) Code

func (o *GetMeDefault) Code() int

Code gets the status code for the get me default response

func (*GetMeDefault) Error

func (o *GetMeDefault) Error() string

func (*GetMeDefault) GetPayload

func (o *GetMeDefault) GetPayload() *httperrors.HTTPErrorResponse

func (*GetMeDefault) IsClientError added in v0.19.3

func (o *GetMeDefault) IsClientError() bool

IsClientError returns true when this get me default response has a 4xx status code

func (*GetMeDefault) IsCode added in v0.19.3

func (o *GetMeDefault) IsCode(code int) bool

IsCode returns true when this get me default response a status code equal to that given

func (*GetMeDefault) IsRedirect added in v0.19.3

func (o *GetMeDefault) IsRedirect() bool

IsRedirect returns true when this get me default response has a 3xx status code

func (*GetMeDefault) IsServerError added in v0.19.3

func (o *GetMeDefault) IsServerError() bool

IsServerError returns true when this get me default response has a 5xx status code

func (*GetMeDefault) IsSuccess added in v0.19.3

func (o *GetMeDefault) IsSuccess() bool

IsSuccess returns true when this get me default response has a 2xx status code

func (*GetMeDefault) String added in v0.19.3

func (o *GetMeDefault) String() string

type GetMeOK

type GetMeOK struct {
	Payload *models.V1User
}

GetMeOK describes a response with status code 200, with default header values.

OK

func NewGetMeOK

func NewGetMeOK() *GetMeOK

NewGetMeOK creates a GetMeOK with default headers values

func (*GetMeOK) Code added in v0.22.1

func (o *GetMeOK) Code() int

Code gets the status code for the get me o k response

func (*GetMeOK) Error

func (o *GetMeOK) Error() string

func (*GetMeOK) GetPayload

func (o *GetMeOK) GetPayload() *models.V1User

func (*GetMeOK) IsClientError added in v0.19.3

func (o *GetMeOK) IsClientError() bool

IsClientError returns true when this get me o k response has a 4xx status code

func (*GetMeOK) IsCode added in v0.19.3

func (o *GetMeOK) IsCode(code int) bool

IsCode returns true when this get me o k response a status code equal to that given

func (*GetMeOK) IsRedirect added in v0.19.3

func (o *GetMeOK) IsRedirect() bool

IsRedirect returns true when this get me o k response has a 3xx status code

func (*GetMeOK) IsServerError added in v0.19.3

func (o *GetMeOK) IsServerError() bool

IsServerError returns true when this get me o k response has a 5xx status code

func (*GetMeOK) IsSuccess added in v0.19.3

func (o *GetMeOK) IsSuccess() bool

IsSuccess returns true when this get me o k response has a 2xx status code

func (*GetMeOK) String added in v0.19.3

func (o *GetMeOK) String() string

type GetMeParams

type GetMeParams struct {
	Context    context.Context
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

GetMeParams contains all the parameters to send to the API endpoint

for the get me operation.

Typically these are written to a http.Request.

func NewGetMeParams

func NewGetMeParams() *GetMeParams

NewGetMeParams creates a new GetMeParams object, with the default timeout for this client.

Default values are not hydrated, since defaults are normally applied by the API server side.

To enforce default values in parameter, use SetDefaults or WithDefaults.

func NewGetMeParamsWithContext

func NewGetMeParamsWithContext(ctx context.Context) *GetMeParams

NewGetMeParamsWithContext creates a new GetMeParams object with the ability to set a context for a request.

func NewGetMeParamsWithHTTPClient

func NewGetMeParamsWithHTTPClient(client *http.Client) *GetMeParams

NewGetMeParamsWithHTTPClient creates a new GetMeParams object with the ability to set a custom HTTPClient for a request.

func NewGetMeParamsWithTimeout

func NewGetMeParamsWithTimeout(timeout time.Duration) *GetMeParams

NewGetMeParamsWithTimeout creates a new GetMeParams object with the ability to set a timeout on a request.

func (*GetMeParams) SetContext

func (o *GetMeParams) SetContext(ctx context.Context)

SetContext adds the context to the get me params

func (*GetMeParams) SetDefaults

func (o *GetMeParams) SetDefaults()

SetDefaults hydrates default values in the get me params (not the query body).

All values with no default are reset to their zero value.

func (*GetMeParams) SetHTTPClient

func (o *GetMeParams) SetHTTPClient(client *http.Client)

SetHTTPClient adds the HTTPClient to the get me params

func (*GetMeParams) SetTimeout

func (o *GetMeParams) SetTimeout(timeout time.Duration)

SetTimeout adds the timeout to the get me params

func (*GetMeParams) WithContext

func (o *GetMeParams) WithContext(ctx context.Context) *GetMeParams

WithContext adds the context to the get me params

func (*GetMeParams) WithDefaults

func (o *GetMeParams) WithDefaults() *GetMeParams

WithDefaults hydrates default values in the get me params (not the query body).

All values with no default are reset to their zero value.

func (*GetMeParams) WithHTTPClient

func (o *GetMeParams) WithHTTPClient(client *http.Client) *GetMeParams

WithHTTPClient adds the HTTPClient to the get me params

func (*GetMeParams) WithTimeout

func (o *GetMeParams) WithTimeout(timeout time.Duration) *GetMeParams

WithTimeout adds the timeout to the get me params

func (*GetMeParams) WriteToRequest

func (o *GetMeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error

WriteToRequest writes these params to a swagger request

type GetMeReader

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

GetMeReader is a Reader for the GetMe structure.

func (*GetMeReader) ReadResponse

func (o *GetMeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error)

ReadResponse reads a server response into the received o.

Jump to

Keyboard shortcuts

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