1 Star 0 Fork 0

pengchengduan / goharbor-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
list_repositories_parameters.go 7.76 KB
一键复制 编辑 原始数据 按行查看 历史
pengchengduan 提交于 2024-02-01 17:28 . first commit
// Code generated by go-swagger; DO NOT EDIT.
package repository
// 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"
)
// NewListRepositoriesParams creates a new ListRepositoriesParams object
// with the default values initialized.
func NewListRepositoriesParams() *ListRepositoriesParams {
var (
pageDefault = int64(1)
pageSizeDefault = int64(10)
)
return &ListRepositoriesParams{
Page: &pageDefault,
PageSize: &pageSizeDefault,
timeout: cr.DefaultTimeout,
}
}
// NewListRepositoriesParamsWithTimeout creates a new ListRepositoriesParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewListRepositoriesParamsWithTimeout(timeout time.Duration) *ListRepositoriesParams {
var (
pageDefault = int64(1)
pageSizeDefault = int64(10)
)
return &ListRepositoriesParams{
Page: &pageDefault,
PageSize: &pageSizeDefault,
timeout: timeout,
}
}
// NewListRepositoriesParamsWithContext creates a new ListRepositoriesParams object
// with the default values initialized, and the ability to set a context for a request
func NewListRepositoriesParamsWithContext(ctx context.Context) *ListRepositoriesParams {
var (
pageDefault = int64(1)
pageSizeDefault = int64(10)
)
return &ListRepositoriesParams{
Page: &pageDefault,
PageSize: &pageSizeDefault,
Context: ctx,
}
}
// NewListRepositoriesParamsWithHTTPClient creates a new ListRepositoriesParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewListRepositoriesParamsWithHTTPClient(client *http.Client) *ListRepositoriesParams {
var (
pageDefault = int64(1)
pageSizeDefault = int64(10)
)
return &ListRepositoriesParams{
Page: &pageDefault,
PageSize: &pageSizeDefault,
HTTPClient: client,
}
}
/*ListRepositoriesParams contains all the parameters to send to the API endpoint
for the list repositories operation typically these are written to a http.Request
*/
type ListRepositoriesParams struct {
/*XRequestID
An unique ID for the request
*/
XRequestID *string
/*Page
The page number
*/
Page *int64
/*PageSize
The size of per page
*/
PageSize *int64
/*ProjectName
The name of the project
*/
ProjectName string
/*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 list repositories params
func (o *ListRepositoriesParams) WithTimeout(timeout time.Duration) *ListRepositoriesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the list repositories params
func (o *ListRepositoriesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the list repositories params
func (o *ListRepositoriesParams) WithContext(ctx context.Context) *ListRepositoriesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the list repositories params
func (o *ListRepositoriesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the list repositories params
func (o *ListRepositoriesParams) WithHTTPClient(client *http.Client) *ListRepositoriesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the list repositories params
func (o *ListRepositoriesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithXRequestID adds the xRequestID to the list repositories params
func (o *ListRepositoriesParams) WithXRequestID(xRequestID *string) *ListRepositoriesParams {
o.SetXRequestID(xRequestID)
return o
}
// SetXRequestID adds the xRequestId to the list repositories params
func (o *ListRepositoriesParams) SetXRequestID(xRequestID *string) {
o.XRequestID = xRequestID
}
// WithPage adds the page to the list repositories params
func (o *ListRepositoriesParams) WithPage(page *int64) *ListRepositoriesParams {
o.SetPage(page)
return o
}
// SetPage adds the page to the list repositories params
func (o *ListRepositoriesParams) SetPage(page *int64) {
o.Page = page
}
// WithPageSize adds the pageSize to the list repositories params
func (o *ListRepositoriesParams) WithPageSize(pageSize *int64) *ListRepositoriesParams {
o.SetPageSize(pageSize)
return o
}
// SetPageSize adds the pageSize to the list repositories params
func (o *ListRepositoriesParams) SetPageSize(pageSize *int64) {
o.PageSize = pageSize
}
// WithProjectName adds the projectName to the list repositories params
func (o *ListRepositoriesParams) WithProjectName(projectName string) *ListRepositoriesParams {
o.SetProjectName(projectName)
return o
}
// SetProjectName adds the projectName to the list repositories params
func (o *ListRepositoriesParams) SetProjectName(projectName string) {
o.ProjectName = projectName
}
// WithQ adds the q to the list repositories params
func (o *ListRepositoriesParams) WithQ(q *string) *ListRepositoriesParams {
o.SetQ(q)
return o
}
// SetQ adds the q to the list repositories params
func (o *ListRepositoriesParams) SetQ(q *string) {
o.Q = q
}
// WithSort adds the sort to the list repositories params
func (o *ListRepositoriesParams) WithSort(sort *string) *ListRepositoriesParams {
o.SetSort(sort)
return o
}
// SetSort adds the sort to the list repositories params
func (o *ListRepositoriesParams) SetSort(sort *string) {
o.Sort = sort
}
// WriteToRequest writes these params to a swagger request
func (o *ListRepositoriesParams) 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
}
}
}
// path param project_name
if err := r.SetPathParam("project_name", o.ProjectName); 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

搜索帮助