All checks were successful
continuous-integration/drone/push Build is passing
221 lines
5.4 KiB
Go
221 lines
5.4 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package lists
|
|
|
|
// 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"
|
|
)
|
|
|
|
// NewListUpdateParams creates a new ListUpdateParams 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 NewListUpdateParams() *ListUpdateParams {
|
|
return &ListUpdateParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewListUpdateParamsWithTimeout creates a new ListUpdateParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewListUpdateParamsWithTimeout(timeout time.Duration) *ListUpdateParams {
|
|
return &ListUpdateParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewListUpdateParamsWithContext creates a new ListUpdateParams object
|
|
// with the ability to set a context for a request.
|
|
func NewListUpdateParamsWithContext(ctx context.Context) *ListUpdateParams {
|
|
return &ListUpdateParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewListUpdateParamsWithHTTPClient creates a new ListUpdateParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewListUpdateParamsWithHTTPClient(client *http.Client) *ListUpdateParams {
|
|
return &ListUpdateParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
ListUpdateParams contains all the parameters to send to the API endpoint
|
|
|
|
for the list update operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type ListUpdateParams struct {
|
|
|
|
/* ID.
|
|
|
|
ID of the list
|
|
*/
|
|
ID string
|
|
|
|
/* RepliesPolicy.
|
|
|
|
RepliesPolicy for this list.
|
|
followed = Show replies to any followed user
|
|
list = Show replies to members of the list
|
|
none = Show replies to no one
|
|
Sample: list
|
|
*/
|
|
RepliesPolicy *string
|
|
|
|
/* Title.
|
|
|
|
Title of this list.
|
|
Sample: Cool People
|
|
*/
|
|
Title *string
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the list update params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *ListUpdateParams) WithDefaults() *ListUpdateParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the list update params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *ListUpdateParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the list update params
|
|
func (o *ListUpdateParams) WithTimeout(timeout time.Duration) *ListUpdateParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the list update params
|
|
func (o *ListUpdateParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the list update params
|
|
func (o *ListUpdateParams) WithContext(ctx context.Context) *ListUpdateParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the list update params
|
|
func (o *ListUpdateParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the list update params
|
|
func (o *ListUpdateParams) WithHTTPClient(client *http.Client) *ListUpdateParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the list update params
|
|
func (o *ListUpdateParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithID adds the id to the list update params
|
|
func (o *ListUpdateParams) WithID(id string) *ListUpdateParams {
|
|
o.SetID(id)
|
|
return o
|
|
}
|
|
|
|
// SetID adds the id to the list update params
|
|
func (o *ListUpdateParams) SetID(id string) {
|
|
o.ID = id
|
|
}
|
|
|
|
// WithRepliesPolicy adds the repliesPolicy to the list update params
|
|
func (o *ListUpdateParams) WithRepliesPolicy(repliesPolicy *string) *ListUpdateParams {
|
|
o.SetRepliesPolicy(repliesPolicy)
|
|
return o
|
|
}
|
|
|
|
// SetRepliesPolicy adds the repliesPolicy to the list update params
|
|
func (o *ListUpdateParams) SetRepliesPolicy(repliesPolicy *string) {
|
|
o.RepliesPolicy = repliesPolicy
|
|
}
|
|
|
|
// WithTitle adds the title to the list update params
|
|
func (o *ListUpdateParams) WithTitle(title *string) *ListUpdateParams {
|
|
o.SetTitle(title)
|
|
return o
|
|
}
|
|
|
|
// SetTitle adds the title to the list update params
|
|
func (o *ListUpdateParams) SetTitle(title *string) {
|
|
o.Title = title
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *ListUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
// path param id
|
|
if err := r.SetPathParam("id", o.ID); err != nil {
|
|
return err
|
|
}
|
|
|
|
if o.RepliesPolicy != nil {
|
|
|
|
// form param replies_policy
|
|
var frRepliesPolicy string
|
|
if o.RepliesPolicy != nil {
|
|
frRepliesPolicy = *o.RepliesPolicy
|
|
}
|
|
fRepliesPolicy := frRepliesPolicy
|
|
if fRepliesPolicy != "" {
|
|
if err := r.SetFormParam("replies_policy", fRepliesPolicy); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if o.Title != nil {
|
|
|
|
// form param title
|
|
var frTitle string
|
|
if o.Title != nil {
|
|
frTitle = *o.Title
|
|
}
|
|
fTitle := frTitle
|
|
if fTitle != "" {
|
|
if err := r.SetFormParam("title", fTitle); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|