peridot/vendor/github.com/ory/hydra-client-go/client/admin/flush_inactive_o_auth2_tokens_parameters.go
2022-07-07 22:13:21 +02:00

149 lines
4.8 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package admin
// 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/ory/hydra-client-go/models"
)
// NewFlushInactiveOAuth2TokensParams creates a new FlushInactiveOAuth2TokensParams 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 NewFlushInactiveOAuth2TokensParams() *FlushInactiveOAuth2TokensParams {
return &FlushInactiveOAuth2TokensParams{
timeout: cr.DefaultTimeout,
}
}
// NewFlushInactiveOAuth2TokensParamsWithTimeout creates a new FlushInactiveOAuth2TokensParams object
// with the ability to set a timeout on a request.
func NewFlushInactiveOAuth2TokensParamsWithTimeout(timeout time.Duration) *FlushInactiveOAuth2TokensParams {
return &FlushInactiveOAuth2TokensParams{
timeout: timeout,
}
}
// NewFlushInactiveOAuth2TokensParamsWithContext creates a new FlushInactiveOAuth2TokensParams object
// with the ability to set a context for a request.
func NewFlushInactiveOAuth2TokensParamsWithContext(ctx context.Context) *FlushInactiveOAuth2TokensParams {
return &FlushInactiveOAuth2TokensParams{
Context: ctx,
}
}
// NewFlushInactiveOAuth2TokensParamsWithHTTPClient creates a new FlushInactiveOAuth2TokensParams object
// with the ability to set a custom HTTPClient for a request.
func NewFlushInactiveOAuth2TokensParamsWithHTTPClient(client *http.Client) *FlushInactiveOAuth2TokensParams {
return &FlushInactiveOAuth2TokensParams{
HTTPClient: client,
}
}
/* FlushInactiveOAuth2TokensParams contains all the parameters to send to the API endpoint
for the flush inactive o auth2 tokens operation.
Typically these are written to a http.Request.
*/
type FlushInactiveOAuth2TokensParams struct {
// Body.
Body *models.FlushInactiveOAuth2TokensRequest
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the flush inactive o auth2 tokens params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *FlushInactiveOAuth2TokensParams) WithDefaults() *FlushInactiveOAuth2TokensParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the flush inactive o auth2 tokens params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *FlushInactiveOAuth2TokensParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the flush inactive o auth2 tokens params
func (o *FlushInactiveOAuth2TokensParams) WithTimeout(timeout time.Duration) *FlushInactiveOAuth2TokensParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the flush inactive o auth2 tokens params
func (o *FlushInactiveOAuth2TokensParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the flush inactive o auth2 tokens params
func (o *FlushInactiveOAuth2TokensParams) WithContext(ctx context.Context) *FlushInactiveOAuth2TokensParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the flush inactive o auth2 tokens params
func (o *FlushInactiveOAuth2TokensParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the flush inactive o auth2 tokens params
func (o *FlushInactiveOAuth2TokensParams) WithHTTPClient(client *http.Client) *FlushInactiveOAuth2TokensParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the flush inactive o auth2 tokens params
func (o *FlushInactiveOAuth2TokensParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the flush inactive o auth2 tokens params
func (o *FlushInactiveOAuth2TokensParams) WithBody(body *models.FlushInactiveOAuth2TokensRequest) *FlushInactiveOAuth2TokensParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the flush inactive o auth2 tokens params
func (o *FlushInactiveOAuth2TokensParams) SetBody(body *models.FlushInactiveOAuth2TokensRequest) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *FlushInactiveOAuth2TokensParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}