1 Star 0 Fork 0

pengchengduan / goharbor-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
get_gc_history_parameters.go 6.96 KB
一键复制 编辑 原始数据 按行查看 历史
pengchengduan 提交于 2024-02-01 17:28 . first commit
// Code generated by go-swagger; DO NOT EDIT.
package gc
// 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"
)
// NewGetGCHistoryParams creates a new GetGCHistoryParams object
// with the default values initialized.
func NewGetGCHistoryParams() *GetGCHistoryParams {
var (
pageDefault = int64(1)
pageSizeDefault = int64(10)
)
return &GetGCHistoryParams{
Page: &pageDefault,
PageSize: &pageSizeDefault,
timeout: cr.DefaultTimeout,
}
}
// NewGetGCHistoryParamsWithTimeout creates a new GetGCHistoryParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewGetGCHistoryParamsWithTimeout(timeout time.Duration) *GetGCHistoryParams {
var (
pageDefault = int64(1)
pageSizeDefault = int64(10)
)
return &GetGCHistoryParams{
Page: &pageDefault,
PageSize: &pageSizeDefault,
timeout: timeout,
}
}
// NewGetGCHistoryParamsWithContext creates a new GetGCHistoryParams object
// with the default values initialized, and the ability to set a context for a request
func NewGetGCHistoryParamsWithContext(ctx context.Context) *GetGCHistoryParams {
var (
pageDefault = int64(1)
pageSizeDefault = int64(10)
)
return &GetGCHistoryParams{
Page: &pageDefault,
PageSize: &pageSizeDefault,
Context: ctx,
}
}
// NewGetGCHistoryParamsWithHTTPClient creates a new GetGCHistoryParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewGetGCHistoryParamsWithHTTPClient(client *http.Client) *GetGCHistoryParams {
var (
pageDefault = int64(1)
pageSizeDefault = int64(10)
)
return &GetGCHistoryParams{
Page: &pageDefault,
PageSize: &pageSizeDefault,
HTTPClient: client,
}
}
/*GetGCHistoryParams contains all the parameters to send to the API endpoint
for the get GC history operation typically these are written to a http.Request
*/
type GetGCHistoryParams struct {
/*XRequestID
An unique ID for the request
*/
XRequestID *string
/*Page
The page number
*/
Page *int64
/*PageSize
The size of per page
*/
PageSize *int64
/*Q
Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3=[min~max]
*/
Q *string
/*Sort
Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2"
*/
Sort *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the get GC history params
func (o *GetGCHistoryParams) WithTimeout(timeout time.Duration) *GetGCHistoryParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get GC history params
func (o *GetGCHistoryParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get GC history params
func (o *GetGCHistoryParams) WithContext(ctx context.Context) *GetGCHistoryParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get GC history params
func (o *GetGCHistoryParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get GC history params
func (o *GetGCHistoryParams) WithHTTPClient(client *http.Client) *GetGCHistoryParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get GC history params
func (o *GetGCHistoryParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithXRequestID adds the xRequestID to the get GC history params
func (o *GetGCHistoryParams) WithXRequestID(xRequestID *string) *GetGCHistoryParams {
o.SetXRequestID(xRequestID)
return o
}
// SetXRequestID adds the xRequestId to the get GC history params
func (o *GetGCHistoryParams) SetXRequestID(xRequestID *string) {
o.XRequestID = xRequestID
}
// WithPage adds the page to the get GC history params
func (o *GetGCHistoryParams) WithPage(page *int64) *GetGCHistoryParams {
o.SetPage(page)
return o
}
// SetPage adds the page to the get GC history params
func (o *GetGCHistoryParams) SetPage(page *int64) {
o.Page = page
}
// WithPageSize adds the pageSize to the get GC history params
func (o *GetGCHistoryParams) WithPageSize(pageSize *int64) *GetGCHistoryParams {
o.SetPageSize(pageSize)
return o
}
// SetPageSize adds the pageSize to the get GC history params
func (o *GetGCHistoryParams) SetPageSize(pageSize *int64) {
o.PageSize = pageSize
}
// WithQ adds the q to the get GC history params
func (o *GetGCHistoryParams) WithQ(q *string) *GetGCHistoryParams {
o.SetQ(q)
return o
}
// SetQ adds the q to the get GC history params
func (o *GetGCHistoryParams) SetQ(q *string) {
o.Q = q
}
// WithSort adds the sort to the get GC history params
func (o *GetGCHistoryParams) WithSort(sort *string) *GetGCHistoryParams {
o.SetSort(sort)
return o
}
// SetSort adds the sort to the get GC history params
func (o *GetGCHistoryParams) SetSort(sort *string) {
o.Sort = sort
}
// WriteToRequest writes these params to a swagger request
func (o *GetGCHistoryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.XRequestID != nil {
// header param X-Request-Id
if err := r.SetHeaderParam("X-Request-Id", *o.XRequestID); 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 o.PageSize != nil {
// query param page_size
var qrPageSize int64
if o.PageSize != nil {
qrPageSize = *o.PageSize
}
qPageSize := swag.FormatInt64(qrPageSize)
if qPageSize != "" {
if err := r.SetQueryParam("page_size", qPageSize); err != nil {
return err
}
}
}
if o.Q != nil {
// query param q
var qrQ string
if o.Q != nil {
qrQ = *o.Q
}
qQ := qrQ
if qQ != "" {
if err := r.SetQueryParam("q", qQ); err != nil {
return err
}
}
}
if o.Sort != nil {
// query param sort
var qrSort string
if o.Sort != nil {
qrSort = *o.Sort
}
qSort := qrSort
if qSort != "" {
if err := r.SetQueryParam("sort", qSort); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
1
https://gitee.com/pengchengduan/goharbor-client.git
git@gitee.com:pengchengduan/goharbor-client.git
pengchengduan
goharbor-client
goharbor-client
41c6882efe91

搜索帮助