go-gitea/client/user/user_current_list_keys_parameters.go
jolheiser 021242f2ad
initial commit
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2023-04-11 22:59:19 -05:00

233 lines
6.0 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package user
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewUserCurrentListKeysParams creates a new UserCurrentListKeysParams 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 NewUserCurrentListKeysParams() *UserCurrentListKeysParams {
return &UserCurrentListKeysParams{
timeout: cr.DefaultTimeout,
}
}
// NewUserCurrentListKeysParamsWithTimeout creates a new UserCurrentListKeysParams object
// with the ability to set a timeout on a request.
func NewUserCurrentListKeysParamsWithTimeout(timeout time.Duration) *UserCurrentListKeysParams {
return &UserCurrentListKeysParams{
timeout: timeout,
}
}
// NewUserCurrentListKeysParamsWithContext creates a new UserCurrentListKeysParams object
// with the ability to set a context for a request.
func NewUserCurrentListKeysParamsWithContext(ctx context.Context) *UserCurrentListKeysParams {
return &UserCurrentListKeysParams{
Context: ctx,
}
}
// NewUserCurrentListKeysParamsWithHTTPClient creates a new UserCurrentListKeysParams object
// with the ability to set a custom HTTPClient for a request.
func NewUserCurrentListKeysParamsWithHTTPClient(client *http.Client) *UserCurrentListKeysParams {
return &UserCurrentListKeysParams{
HTTPClient: client,
}
}
/*
UserCurrentListKeysParams contains all the parameters to send to the API endpoint
for the user current list keys operation.
Typically these are written to a http.Request.
*/
type UserCurrentListKeysParams struct {
/* Fingerprint.
fingerprint of the key
*/
Fingerprint *string
/* Limit.
page size of results
*/
Limit *int64
/* Page.
page number of results to return (1-based)
*/
Page *int64
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the user current list keys params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *UserCurrentListKeysParams) WithDefaults() *UserCurrentListKeysParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the user current list keys params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *UserCurrentListKeysParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the user current list keys params
func (o *UserCurrentListKeysParams) WithTimeout(timeout time.Duration) *UserCurrentListKeysParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the user current list keys params
func (o *UserCurrentListKeysParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the user current list keys params
func (o *UserCurrentListKeysParams) WithContext(ctx context.Context) *UserCurrentListKeysParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the user current list keys params
func (o *UserCurrentListKeysParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the user current list keys params
func (o *UserCurrentListKeysParams) WithHTTPClient(client *http.Client) *UserCurrentListKeysParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the user current list keys params
func (o *UserCurrentListKeysParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithFingerprint adds the fingerprint to the user current list keys params
func (o *UserCurrentListKeysParams) WithFingerprint(fingerprint *string) *UserCurrentListKeysParams {
o.SetFingerprint(fingerprint)
return o
}
// SetFingerprint adds the fingerprint to the user current list keys params
func (o *UserCurrentListKeysParams) SetFingerprint(fingerprint *string) {
o.Fingerprint = fingerprint
}
// WithLimit adds the limit to the user current list keys params
func (o *UserCurrentListKeysParams) WithLimit(limit *int64) *UserCurrentListKeysParams {
o.SetLimit(limit)
return o
}
// SetLimit adds the limit to the user current list keys params
func (o *UserCurrentListKeysParams) SetLimit(limit *int64) {
o.Limit = limit
}
// WithPage adds the page to the user current list keys params
func (o *UserCurrentListKeysParams) WithPage(page *int64) *UserCurrentListKeysParams {
o.SetPage(page)
return o
}
// SetPage adds the page to the user current list keys params
func (o *UserCurrentListKeysParams) SetPage(page *int64) {
o.Page = page
}
// WriteToRequest writes these params to a swagger request
func (o *UserCurrentListKeysParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Fingerprint != nil {
// query param fingerprint
var qrFingerprint string
if o.Fingerprint != nil {
qrFingerprint = *o.Fingerprint
}
qFingerprint := qrFingerprint
if qFingerprint != "" {
if err := r.SetQueryParam("fingerprint", qFingerprint); err != nil {
return err
}
}
}
if o.Limit != nil {
// query param limit
var qrLimit int64
if o.Limit != nil {
qrLimit = *o.Limit
}
qLimit := swag.FormatInt64(qrLimit)
if qLimit != "" {
if err := r.SetQueryParam("limit", qLimit); err != nil {
return err
}
}
}
if o.Page != nil {
// query param page
var qrPage int64
if o.Page != nil {
qrPage = *o.Page
}
qPage := swag.FormatInt64(qrPage)
if qPage != "" {
if err := r.SetQueryParam("page", qPage); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}