gtslib/client/instance/instance_update_parameters.go
decentral1se e4ade9c758
All checks were successful
continuous-integration/drone/push Build is passing
feat: init
2024-07-31 22:47:18 +02:00

360 lines
9.6 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package instance
// 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"
)
// NewInstanceUpdateParams creates a new InstanceUpdateParams 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 NewInstanceUpdateParams() *InstanceUpdateParams {
return &InstanceUpdateParams{
timeout: cr.DefaultTimeout,
}
}
// NewInstanceUpdateParamsWithTimeout creates a new InstanceUpdateParams object
// with the ability to set a timeout on a request.
func NewInstanceUpdateParamsWithTimeout(timeout time.Duration) *InstanceUpdateParams {
return &InstanceUpdateParams{
timeout: timeout,
}
}
// NewInstanceUpdateParamsWithContext creates a new InstanceUpdateParams object
// with the ability to set a context for a request.
func NewInstanceUpdateParamsWithContext(ctx context.Context) *InstanceUpdateParams {
return &InstanceUpdateParams{
Context: ctx,
}
}
// NewInstanceUpdateParamsWithHTTPClient creates a new InstanceUpdateParams object
// with the ability to set a custom HTTPClient for a request.
func NewInstanceUpdateParamsWithHTTPClient(client *http.Client) *InstanceUpdateParams {
return &InstanceUpdateParams{
HTTPClient: client,
}
}
/*
InstanceUpdateParams contains all the parameters to send to the API endpoint
for the instance update operation.
Typically these are written to a http.Request.
*/
type InstanceUpdateParams struct {
/* ContactEmail.
Email address to use as the instance contact.
*/
ContactEmail string
/* ContactUsername.
Username of the contact account. This must be the username of an instance admin.
*/
ContactUsername string
/* Description.
Longer description of the instance.
*/
Description string
/* Header.
Header image to use for the instance.
*/
Header runtime.NamedReadCloser
/* ShortDescription.
Short description of the instance.
*/
ShortDescription string
/* Terms.
Terms and conditions of the instance.
*/
Terms string
/* Thumbnail.
Thumbnail image to use for the instance.
*/
Thumbnail runtime.NamedReadCloser
/* ThumbnailDescription.
Image description of the submitted instance thumbnail.
*/
ThumbnailDescription *string
/* Title.
Title to use for the instance.
*/
Title string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the instance update params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *InstanceUpdateParams) WithDefaults() *InstanceUpdateParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the instance update params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *InstanceUpdateParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the instance update params
func (o *InstanceUpdateParams) WithTimeout(timeout time.Duration) *InstanceUpdateParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the instance update params
func (o *InstanceUpdateParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the instance update params
func (o *InstanceUpdateParams) WithContext(ctx context.Context) *InstanceUpdateParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the instance update params
func (o *InstanceUpdateParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the instance update params
func (o *InstanceUpdateParams) WithHTTPClient(client *http.Client) *InstanceUpdateParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the instance update params
func (o *InstanceUpdateParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithContactEmail adds the contactEmail to the instance update params
func (o *InstanceUpdateParams) WithContactEmail(contactEmail string) *InstanceUpdateParams {
o.SetContactEmail(contactEmail)
return o
}
// SetContactEmail adds the contactEmail to the instance update params
func (o *InstanceUpdateParams) SetContactEmail(contactEmail string) {
o.ContactEmail = contactEmail
}
// WithContactUsername adds the contactUsername to the instance update params
func (o *InstanceUpdateParams) WithContactUsername(contactUsername string) *InstanceUpdateParams {
o.SetContactUsername(contactUsername)
return o
}
// SetContactUsername adds the contactUsername to the instance update params
func (o *InstanceUpdateParams) SetContactUsername(contactUsername string) {
o.ContactUsername = contactUsername
}
// WithDescription adds the description to the instance update params
func (o *InstanceUpdateParams) WithDescription(description string) *InstanceUpdateParams {
o.SetDescription(description)
return o
}
// SetDescription adds the description to the instance update params
func (o *InstanceUpdateParams) SetDescription(description string) {
o.Description = description
}
// WithHeader adds the header to the instance update params
func (o *InstanceUpdateParams) WithHeader(header runtime.NamedReadCloser) *InstanceUpdateParams {
o.SetHeader(header)
return o
}
// SetHeader adds the header to the instance update params
func (o *InstanceUpdateParams) SetHeader(header runtime.NamedReadCloser) {
o.Header = header
}
// WithShortDescription adds the shortDescription to the instance update params
func (o *InstanceUpdateParams) WithShortDescription(shortDescription string) *InstanceUpdateParams {
o.SetShortDescription(shortDescription)
return o
}
// SetShortDescription adds the shortDescription to the instance update params
func (o *InstanceUpdateParams) SetShortDescription(shortDescription string) {
o.ShortDescription = shortDescription
}
// WithTerms adds the terms to the instance update params
func (o *InstanceUpdateParams) WithTerms(terms string) *InstanceUpdateParams {
o.SetTerms(terms)
return o
}
// SetTerms adds the terms to the instance update params
func (o *InstanceUpdateParams) SetTerms(terms string) {
o.Terms = terms
}
// WithThumbnail adds the thumbnail to the instance update params
func (o *InstanceUpdateParams) WithThumbnail(thumbnail runtime.NamedReadCloser) *InstanceUpdateParams {
o.SetThumbnail(thumbnail)
return o
}
// SetThumbnail adds the thumbnail to the instance update params
func (o *InstanceUpdateParams) SetThumbnail(thumbnail runtime.NamedReadCloser) {
o.Thumbnail = thumbnail
}
// WithThumbnailDescription adds the thumbnailDescription to the instance update params
func (o *InstanceUpdateParams) WithThumbnailDescription(thumbnailDescription *string) *InstanceUpdateParams {
o.SetThumbnailDescription(thumbnailDescription)
return o
}
// SetThumbnailDescription adds the thumbnailDescription to the instance update params
func (o *InstanceUpdateParams) SetThumbnailDescription(thumbnailDescription *string) {
o.ThumbnailDescription = thumbnailDescription
}
// WithTitle adds the title to the instance update params
func (o *InstanceUpdateParams) WithTitle(title string) *InstanceUpdateParams {
o.SetTitle(title)
return o
}
// SetTitle adds the title to the instance update params
func (o *InstanceUpdateParams) SetTitle(title string) {
o.Title = title
}
// WriteToRequest writes these params to a swagger request
func (o *InstanceUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// form param contact_email
frContactEmail := o.ContactEmail
fContactEmail := frContactEmail
if err := r.SetFormParam("contact_email", fContactEmail); err != nil {
return err
}
// form param contact_username
frContactUsername := o.ContactUsername
fContactUsername := frContactUsername
if err := r.SetFormParam("contact_username", fContactUsername); err != nil {
return err
}
// form param description
frDescription := o.Description
fDescription := frDescription
if err := r.SetFormParam("description", fDescription); err != nil {
return err
}
if o.Header != nil {
if o.Header != nil {
// form file param header
if err := r.SetFileParam("header", o.Header); err != nil {
return err
}
}
}
// form param short_description
frShortDescription := o.ShortDescription
fShortDescription := frShortDescription
if err := r.SetFormParam("short_description", fShortDescription); err != nil {
return err
}
// form param terms
frTerms := o.Terms
fTerms := frTerms
if err := r.SetFormParam("terms", fTerms); err != nil {
return err
}
if o.Thumbnail != nil {
if o.Thumbnail != nil {
// form file param thumbnail
if err := r.SetFileParam("thumbnail", o.Thumbnail); err != nil {
return err
}
}
}
if o.ThumbnailDescription != nil {
// form param thumbnail_description
var frThumbnailDescription string
if o.ThumbnailDescription != nil {
frThumbnailDescription = *o.ThumbnailDescription
}
fThumbnailDescription := frThumbnailDescription
if fThumbnailDescription != "" {
if err := r.SetFormParam("thumbnail_description", fThumbnailDescription); err != nil {
return err
}
}
}
// form param title
frTitle := o.Title
fTitle := frTitle
if err := r.SetFormParam("title", fTitle); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}