gtslib/client/accounts/account_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

1017 lines
29 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package accounts
// 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"
)
// NewAccountUpdateParams creates a new AccountUpdateParams 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 NewAccountUpdateParams() *AccountUpdateParams {
return &AccountUpdateParams{
timeout: cr.DefaultTimeout,
}
}
// NewAccountUpdateParamsWithTimeout creates a new AccountUpdateParams object
// with the ability to set a timeout on a request.
func NewAccountUpdateParamsWithTimeout(timeout time.Duration) *AccountUpdateParams {
return &AccountUpdateParams{
timeout: timeout,
}
}
// NewAccountUpdateParamsWithContext creates a new AccountUpdateParams object
// with the ability to set a context for a request.
func NewAccountUpdateParamsWithContext(ctx context.Context) *AccountUpdateParams {
return &AccountUpdateParams{
Context: ctx,
}
}
// NewAccountUpdateParamsWithHTTPClient creates a new AccountUpdateParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountUpdateParamsWithHTTPClient(client *http.Client) *AccountUpdateParams {
return &AccountUpdateParams{
HTTPClient: client,
}
}
/*
AccountUpdateParams contains all the parameters to send to the API endpoint
for the account update operation.
Typically these are written to a http.Request.
*/
type AccountUpdateParams struct {
/* Avatar.
Avatar of the user.
*/
Avatar runtime.NamedReadCloser
/* AvatarDescription.
Description of avatar image, for alt-text.
*/
AvatarDescription string
/* Bot.
Account is flagged as a bot.
*/
Bot *bool
/* CustomCSS.
Custom CSS to use when rendering this account's profile or statuses. String must be no more than 5,000 characters (~5kb).
*/
CustomCSS *string
/* Discoverable.
Account should be made discoverable and shown in the profile directory (if enabled).
*/
Discoverable *bool
/* DisplayName.
The display name to use for the account.
*/
DisplayName string
/* EnableRss.
Enable RSS feed for this account's Public posts at `/[username]/feed.rss`
*/
EnableRss *bool
/* FieldsAttributes0Name.
Name of 1st profile field to be added to this account's profile. (The index may be any string; add more indexes to send more fields.)
*/
FieldsAttributes0Name *string
/* FieldsAttributes0Value.
Value of 1st profile field to be added to this account's profile. (The index may be any string; add more indexes to send more fields.)
*/
FieldsAttributes0Value *string
/* FieldsAttributes1Name.
Name of 2nd profile field to be added to this account's profile.
*/
FieldsAttributes1Name *string
/* FieldsAttributes1Value.
Value of 2nd profile field to be added to this account's profile.
*/
FieldsAttributes1Value *string
/* FieldsAttributes2Name.
Name of 3rd profile field to be added to this account's profile.
*/
FieldsAttributes2Name *string
/* FieldsAttributes2Value.
Value of 3rd profile field to be added to this account's profile.
*/
FieldsAttributes2Value *string
/* FieldsAttributes3Name.
Name of 4th profile field to be added to this account's profile.
*/
FieldsAttributes3Name *string
/* FieldsAttributes3Value.
Value of 4th profile field to be added to this account's profile.
*/
FieldsAttributes3Value *string
/* FieldsAttributes4Name.
Name of 5th profile field to be added to this account's profile.
*/
FieldsAttributes4Name *string
/* FieldsAttributes4Value.
Value of 5th profile field to be added to this account's profile.
*/
FieldsAttributes4Value *string
/* FieldsAttributes5Name.
Name of 6th profile field to be added to this account's profile.
*/
FieldsAttributes5Name *string
/* FieldsAttributes5Value.
Value of 6th profile field to be added to this account's profile.
*/
FieldsAttributes5Value *string
/* Header.
Header of the user.
*/
Header runtime.NamedReadCloser
/* HeaderDescription.
Description of header image, for alt-text.
*/
HeaderDescription string
/* HideCollections.
Hide the account's following/followers collections.
*/
HideCollections *bool
/* Locked.
Require manual approval of follow requests.
*/
Locked *bool
/* Note.
Bio/description of this account.
*/
Note string
/* SourceLanguage.
Default language to use for authored statuses (ISO 6391).
*/
SourceLanguage *string
/* SourcePrivacy.
Default post privacy for authored statuses.
*/
SourcePrivacy *string
/* SourceSensitive.
Mark authored statuses as sensitive by default.
*/
SourceSensitive *bool
/* SourceStatusContentType.
Default content type to use for authored statuses (text/plain or text/markdown).
*/
SourceStatusContentType *string
/* Theme.
FileName of the theme to use when rendering this account's profile or statuses. The theme must exist on this server, as indicated by /api/v1/accounts/themes. Empty string unsets theme and returns to the default GoToSocial theme.
*/
Theme *string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the account update params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountUpdateParams) WithDefaults() *AccountUpdateParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the account update params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountUpdateParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the account update params
func (o *AccountUpdateParams) WithTimeout(timeout time.Duration) *AccountUpdateParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the account update params
func (o *AccountUpdateParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the account update params
func (o *AccountUpdateParams) WithContext(ctx context.Context) *AccountUpdateParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the account update params
func (o *AccountUpdateParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the account update params
func (o *AccountUpdateParams) WithHTTPClient(client *http.Client) *AccountUpdateParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the account update params
func (o *AccountUpdateParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAvatar adds the avatar to the account update params
func (o *AccountUpdateParams) WithAvatar(avatar runtime.NamedReadCloser) *AccountUpdateParams {
o.SetAvatar(avatar)
return o
}
// SetAvatar adds the avatar to the account update params
func (o *AccountUpdateParams) SetAvatar(avatar runtime.NamedReadCloser) {
o.Avatar = avatar
}
// WithAvatarDescription adds the avatarDescription to the account update params
func (o *AccountUpdateParams) WithAvatarDescription(avatarDescription string) *AccountUpdateParams {
o.SetAvatarDescription(avatarDescription)
return o
}
// SetAvatarDescription adds the avatarDescription to the account update params
func (o *AccountUpdateParams) SetAvatarDescription(avatarDescription string) {
o.AvatarDescription = avatarDescription
}
// WithBot adds the bot to the account update params
func (o *AccountUpdateParams) WithBot(bot *bool) *AccountUpdateParams {
o.SetBot(bot)
return o
}
// SetBot adds the bot to the account update params
func (o *AccountUpdateParams) SetBot(bot *bool) {
o.Bot = bot
}
// WithCustomCSS adds the customCSS to the account update params
func (o *AccountUpdateParams) WithCustomCSS(customCSS *string) *AccountUpdateParams {
o.SetCustomCSS(customCSS)
return o
}
// SetCustomCSS adds the customCss to the account update params
func (o *AccountUpdateParams) SetCustomCSS(customCSS *string) {
o.CustomCSS = customCSS
}
// WithDiscoverable adds the discoverable to the account update params
func (o *AccountUpdateParams) WithDiscoverable(discoverable *bool) *AccountUpdateParams {
o.SetDiscoverable(discoverable)
return o
}
// SetDiscoverable adds the discoverable to the account update params
func (o *AccountUpdateParams) SetDiscoverable(discoverable *bool) {
o.Discoverable = discoverable
}
// WithDisplayName adds the displayName to the account update params
func (o *AccountUpdateParams) WithDisplayName(displayName string) *AccountUpdateParams {
o.SetDisplayName(displayName)
return o
}
// SetDisplayName adds the displayName to the account update params
func (o *AccountUpdateParams) SetDisplayName(displayName string) {
o.DisplayName = displayName
}
// WithEnableRss adds the enableRss to the account update params
func (o *AccountUpdateParams) WithEnableRss(enableRss *bool) *AccountUpdateParams {
o.SetEnableRss(enableRss)
return o
}
// SetEnableRss adds the enableRss to the account update params
func (o *AccountUpdateParams) SetEnableRss(enableRss *bool) {
o.EnableRss = enableRss
}
// WithFieldsAttributes0Name adds the fieldsAttributes0Name to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes0Name(fieldsAttributes0Name *string) *AccountUpdateParams {
o.SetFieldsAttributes0Name(fieldsAttributes0Name)
return o
}
// SetFieldsAttributes0Name adds the fieldsAttributes0Name to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes0Name(fieldsAttributes0Name *string) {
o.FieldsAttributes0Name = fieldsAttributes0Name
}
// WithFieldsAttributes0Value adds the fieldsAttributes0Value to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes0Value(fieldsAttributes0Value *string) *AccountUpdateParams {
o.SetFieldsAttributes0Value(fieldsAttributes0Value)
return o
}
// SetFieldsAttributes0Value adds the fieldsAttributes0Value to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes0Value(fieldsAttributes0Value *string) {
o.FieldsAttributes0Value = fieldsAttributes0Value
}
// WithFieldsAttributes1Name adds the fieldsAttributes1Name to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes1Name(fieldsAttributes1Name *string) *AccountUpdateParams {
o.SetFieldsAttributes1Name(fieldsAttributes1Name)
return o
}
// SetFieldsAttributes1Name adds the fieldsAttributes1Name to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes1Name(fieldsAttributes1Name *string) {
o.FieldsAttributes1Name = fieldsAttributes1Name
}
// WithFieldsAttributes1Value adds the fieldsAttributes1Value to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes1Value(fieldsAttributes1Value *string) *AccountUpdateParams {
o.SetFieldsAttributes1Value(fieldsAttributes1Value)
return o
}
// SetFieldsAttributes1Value adds the fieldsAttributes1Value to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes1Value(fieldsAttributes1Value *string) {
o.FieldsAttributes1Value = fieldsAttributes1Value
}
// WithFieldsAttributes2Name adds the fieldsAttributes2Name to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes2Name(fieldsAttributes2Name *string) *AccountUpdateParams {
o.SetFieldsAttributes2Name(fieldsAttributes2Name)
return o
}
// SetFieldsAttributes2Name adds the fieldsAttributes2Name to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes2Name(fieldsAttributes2Name *string) {
o.FieldsAttributes2Name = fieldsAttributes2Name
}
// WithFieldsAttributes2Value adds the fieldsAttributes2Value to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes2Value(fieldsAttributes2Value *string) *AccountUpdateParams {
o.SetFieldsAttributes2Value(fieldsAttributes2Value)
return o
}
// SetFieldsAttributes2Value adds the fieldsAttributes2Value to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes2Value(fieldsAttributes2Value *string) {
o.FieldsAttributes2Value = fieldsAttributes2Value
}
// WithFieldsAttributes3Name adds the fieldsAttributes3Name to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes3Name(fieldsAttributes3Name *string) *AccountUpdateParams {
o.SetFieldsAttributes3Name(fieldsAttributes3Name)
return o
}
// SetFieldsAttributes3Name adds the fieldsAttributes3Name to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes3Name(fieldsAttributes3Name *string) {
o.FieldsAttributes3Name = fieldsAttributes3Name
}
// WithFieldsAttributes3Value adds the fieldsAttributes3Value to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes3Value(fieldsAttributes3Value *string) *AccountUpdateParams {
o.SetFieldsAttributes3Value(fieldsAttributes3Value)
return o
}
// SetFieldsAttributes3Value adds the fieldsAttributes3Value to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes3Value(fieldsAttributes3Value *string) {
o.FieldsAttributes3Value = fieldsAttributes3Value
}
// WithFieldsAttributes4Name adds the fieldsAttributes4Name to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes4Name(fieldsAttributes4Name *string) *AccountUpdateParams {
o.SetFieldsAttributes4Name(fieldsAttributes4Name)
return o
}
// SetFieldsAttributes4Name adds the fieldsAttributes4Name to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes4Name(fieldsAttributes4Name *string) {
o.FieldsAttributes4Name = fieldsAttributes4Name
}
// WithFieldsAttributes4Value adds the fieldsAttributes4Value to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes4Value(fieldsAttributes4Value *string) *AccountUpdateParams {
o.SetFieldsAttributes4Value(fieldsAttributes4Value)
return o
}
// SetFieldsAttributes4Value adds the fieldsAttributes4Value to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes4Value(fieldsAttributes4Value *string) {
o.FieldsAttributes4Value = fieldsAttributes4Value
}
// WithFieldsAttributes5Name adds the fieldsAttributes5Name to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes5Name(fieldsAttributes5Name *string) *AccountUpdateParams {
o.SetFieldsAttributes5Name(fieldsAttributes5Name)
return o
}
// SetFieldsAttributes5Name adds the fieldsAttributes5Name to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes5Name(fieldsAttributes5Name *string) {
o.FieldsAttributes5Name = fieldsAttributes5Name
}
// WithFieldsAttributes5Value adds the fieldsAttributes5Value to the account update params
func (o *AccountUpdateParams) WithFieldsAttributes5Value(fieldsAttributes5Value *string) *AccountUpdateParams {
o.SetFieldsAttributes5Value(fieldsAttributes5Value)
return o
}
// SetFieldsAttributes5Value adds the fieldsAttributes5Value to the account update params
func (o *AccountUpdateParams) SetFieldsAttributes5Value(fieldsAttributes5Value *string) {
o.FieldsAttributes5Value = fieldsAttributes5Value
}
// WithHeader adds the header to the account update params
func (o *AccountUpdateParams) WithHeader(header runtime.NamedReadCloser) *AccountUpdateParams {
o.SetHeader(header)
return o
}
// SetHeader adds the header to the account update params
func (o *AccountUpdateParams) SetHeader(header runtime.NamedReadCloser) {
o.Header = header
}
// WithHeaderDescription adds the headerDescription to the account update params
func (o *AccountUpdateParams) WithHeaderDescription(headerDescription string) *AccountUpdateParams {
o.SetHeaderDescription(headerDescription)
return o
}
// SetHeaderDescription adds the headerDescription to the account update params
func (o *AccountUpdateParams) SetHeaderDescription(headerDescription string) {
o.HeaderDescription = headerDescription
}
// WithHideCollections adds the hideCollections to the account update params
func (o *AccountUpdateParams) WithHideCollections(hideCollections *bool) *AccountUpdateParams {
o.SetHideCollections(hideCollections)
return o
}
// SetHideCollections adds the hideCollections to the account update params
func (o *AccountUpdateParams) SetHideCollections(hideCollections *bool) {
o.HideCollections = hideCollections
}
// WithLocked adds the locked to the account update params
func (o *AccountUpdateParams) WithLocked(locked *bool) *AccountUpdateParams {
o.SetLocked(locked)
return o
}
// SetLocked adds the locked to the account update params
func (o *AccountUpdateParams) SetLocked(locked *bool) {
o.Locked = locked
}
// WithNote adds the note to the account update params
func (o *AccountUpdateParams) WithNote(note string) *AccountUpdateParams {
o.SetNote(note)
return o
}
// SetNote adds the note to the account update params
func (o *AccountUpdateParams) SetNote(note string) {
o.Note = note
}
// WithSourceLanguage adds the sourceLanguage to the account update params
func (o *AccountUpdateParams) WithSourceLanguage(sourceLanguage *string) *AccountUpdateParams {
o.SetSourceLanguage(sourceLanguage)
return o
}
// SetSourceLanguage adds the sourceLanguage to the account update params
func (o *AccountUpdateParams) SetSourceLanguage(sourceLanguage *string) {
o.SourceLanguage = sourceLanguage
}
// WithSourcePrivacy adds the sourcePrivacy to the account update params
func (o *AccountUpdateParams) WithSourcePrivacy(sourcePrivacy *string) *AccountUpdateParams {
o.SetSourcePrivacy(sourcePrivacy)
return o
}
// SetSourcePrivacy adds the sourcePrivacy to the account update params
func (o *AccountUpdateParams) SetSourcePrivacy(sourcePrivacy *string) {
o.SourcePrivacy = sourcePrivacy
}
// WithSourceSensitive adds the sourceSensitive to the account update params
func (o *AccountUpdateParams) WithSourceSensitive(sourceSensitive *bool) *AccountUpdateParams {
o.SetSourceSensitive(sourceSensitive)
return o
}
// SetSourceSensitive adds the sourceSensitive to the account update params
func (o *AccountUpdateParams) SetSourceSensitive(sourceSensitive *bool) {
o.SourceSensitive = sourceSensitive
}
// WithSourceStatusContentType adds the sourceStatusContentType to the account update params
func (o *AccountUpdateParams) WithSourceStatusContentType(sourceStatusContentType *string) *AccountUpdateParams {
o.SetSourceStatusContentType(sourceStatusContentType)
return o
}
// SetSourceStatusContentType adds the sourceStatusContentType to the account update params
func (o *AccountUpdateParams) SetSourceStatusContentType(sourceStatusContentType *string) {
o.SourceStatusContentType = sourceStatusContentType
}
// WithTheme adds the theme to the account update params
func (o *AccountUpdateParams) WithTheme(theme *string) *AccountUpdateParams {
o.SetTheme(theme)
return o
}
// SetTheme adds the theme to the account update params
func (o *AccountUpdateParams) SetTheme(theme *string) {
o.Theme = theme
}
// WriteToRequest writes these params to a swagger request
func (o *AccountUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Avatar != nil {
if o.Avatar != nil {
// form file param avatar
if err := r.SetFileParam("avatar", o.Avatar); err != nil {
return err
}
}
}
// form param avatar_description
frAvatarDescription := o.AvatarDescription
fAvatarDescription := frAvatarDescription
if err := r.SetFormParam("avatar_description", fAvatarDescription); err != nil {
return err
}
if o.Bot != nil {
// form param bot
var frBot bool
if o.Bot != nil {
frBot = *o.Bot
}
fBot := swag.FormatBool(frBot)
if fBot != "" {
if err := r.SetFormParam("bot", fBot); err != nil {
return err
}
}
}
if o.CustomCSS != nil {
// form param custom_css
var frCustomCSS string
if o.CustomCSS != nil {
frCustomCSS = *o.CustomCSS
}
fCustomCSS := frCustomCSS
if fCustomCSS != "" {
if err := r.SetFormParam("custom_css", fCustomCSS); err != nil {
return err
}
}
}
if o.Discoverable != nil {
// form param discoverable
var frDiscoverable bool
if o.Discoverable != nil {
frDiscoverable = *o.Discoverable
}
fDiscoverable := swag.FormatBool(frDiscoverable)
if fDiscoverable != "" {
if err := r.SetFormParam("discoverable", fDiscoverable); err != nil {
return err
}
}
}
// form param display_name
frDisplayName := o.DisplayName
fDisplayName := frDisplayName
if err := r.SetFormParam("display_name", fDisplayName); err != nil {
return err
}
if o.EnableRss != nil {
// form param enable_rss
var frEnableRss bool
if o.EnableRss != nil {
frEnableRss = *o.EnableRss
}
fEnableRss := swag.FormatBool(frEnableRss)
if fEnableRss != "" {
if err := r.SetFormParam("enable_rss", fEnableRss); err != nil {
return err
}
}
}
if o.FieldsAttributes0Name != nil {
// form param fields_attributes[0][name]
var frFieldsAttributes0Name string
if o.FieldsAttributes0Name != nil {
frFieldsAttributes0Name = *o.FieldsAttributes0Name
}
fFieldsAttributes0Name := frFieldsAttributes0Name
if fFieldsAttributes0Name != "" {
if err := r.SetFormParam("fields_attributes[0][name]", fFieldsAttributes0Name); err != nil {
return err
}
}
}
if o.FieldsAttributes0Value != nil {
// form param fields_attributes[0][value]
var frFieldsAttributes0Value string
if o.FieldsAttributes0Value != nil {
frFieldsAttributes0Value = *o.FieldsAttributes0Value
}
fFieldsAttributes0Value := frFieldsAttributes0Value
if fFieldsAttributes0Value != "" {
if err := r.SetFormParam("fields_attributes[0][value]", fFieldsAttributes0Value); err != nil {
return err
}
}
}
if o.FieldsAttributes1Name != nil {
// form param fields_attributes[1][name]
var frFieldsAttributes1Name string
if o.FieldsAttributes1Name != nil {
frFieldsAttributes1Name = *o.FieldsAttributes1Name
}
fFieldsAttributes1Name := frFieldsAttributes1Name
if fFieldsAttributes1Name != "" {
if err := r.SetFormParam("fields_attributes[1][name]", fFieldsAttributes1Name); err != nil {
return err
}
}
}
if o.FieldsAttributes1Value != nil {
// form param fields_attributes[1][value]
var frFieldsAttributes1Value string
if o.FieldsAttributes1Value != nil {
frFieldsAttributes1Value = *o.FieldsAttributes1Value
}
fFieldsAttributes1Value := frFieldsAttributes1Value
if fFieldsAttributes1Value != "" {
if err := r.SetFormParam("fields_attributes[1][value]", fFieldsAttributes1Value); err != nil {
return err
}
}
}
if o.FieldsAttributes2Name != nil {
// form param fields_attributes[2][name]
var frFieldsAttributes2Name string
if o.FieldsAttributes2Name != nil {
frFieldsAttributes2Name = *o.FieldsAttributes2Name
}
fFieldsAttributes2Name := frFieldsAttributes2Name
if fFieldsAttributes2Name != "" {
if err := r.SetFormParam("fields_attributes[2][name]", fFieldsAttributes2Name); err != nil {
return err
}
}
}
if o.FieldsAttributes2Value != nil {
// form param fields_attributes[2][value]
var frFieldsAttributes2Value string
if o.FieldsAttributes2Value != nil {
frFieldsAttributes2Value = *o.FieldsAttributes2Value
}
fFieldsAttributes2Value := frFieldsAttributes2Value
if fFieldsAttributes2Value != "" {
if err := r.SetFormParam("fields_attributes[2][value]", fFieldsAttributes2Value); err != nil {
return err
}
}
}
if o.FieldsAttributes3Name != nil {
// form param fields_attributes[3][name]
var frFieldsAttributes3Name string
if o.FieldsAttributes3Name != nil {
frFieldsAttributes3Name = *o.FieldsAttributes3Name
}
fFieldsAttributes3Name := frFieldsAttributes3Name
if fFieldsAttributes3Name != "" {
if err := r.SetFormParam("fields_attributes[3][name]", fFieldsAttributes3Name); err != nil {
return err
}
}
}
if o.FieldsAttributes3Value != nil {
// form param fields_attributes[3][value]
var frFieldsAttributes3Value string
if o.FieldsAttributes3Value != nil {
frFieldsAttributes3Value = *o.FieldsAttributes3Value
}
fFieldsAttributes3Value := frFieldsAttributes3Value
if fFieldsAttributes3Value != "" {
if err := r.SetFormParam("fields_attributes[3][value]", fFieldsAttributes3Value); err != nil {
return err
}
}
}
if o.FieldsAttributes4Name != nil {
// form param fields_attributes[4][name]
var frFieldsAttributes4Name string
if o.FieldsAttributes4Name != nil {
frFieldsAttributes4Name = *o.FieldsAttributes4Name
}
fFieldsAttributes4Name := frFieldsAttributes4Name
if fFieldsAttributes4Name != "" {
if err := r.SetFormParam("fields_attributes[4][name]", fFieldsAttributes4Name); err != nil {
return err
}
}
}
if o.FieldsAttributes4Value != nil {
// form param fields_attributes[4][value]
var frFieldsAttributes4Value string
if o.FieldsAttributes4Value != nil {
frFieldsAttributes4Value = *o.FieldsAttributes4Value
}
fFieldsAttributes4Value := frFieldsAttributes4Value
if fFieldsAttributes4Value != "" {
if err := r.SetFormParam("fields_attributes[4][value]", fFieldsAttributes4Value); err != nil {
return err
}
}
}
if o.FieldsAttributes5Name != nil {
// form param fields_attributes[5][name]
var frFieldsAttributes5Name string
if o.FieldsAttributes5Name != nil {
frFieldsAttributes5Name = *o.FieldsAttributes5Name
}
fFieldsAttributes5Name := frFieldsAttributes5Name
if fFieldsAttributes5Name != "" {
if err := r.SetFormParam("fields_attributes[5][name]", fFieldsAttributes5Name); err != nil {
return err
}
}
}
if o.FieldsAttributes5Value != nil {
// form param fields_attributes[5][value]
var frFieldsAttributes5Value string
if o.FieldsAttributes5Value != nil {
frFieldsAttributes5Value = *o.FieldsAttributes5Value
}
fFieldsAttributes5Value := frFieldsAttributes5Value
if fFieldsAttributes5Value != "" {
if err := r.SetFormParam("fields_attributes[5][value]", fFieldsAttributes5Value); 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 header_description
frHeaderDescription := o.HeaderDescription
fHeaderDescription := frHeaderDescription
if err := r.SetFormParam("header_description", fHeaderDescription); err != nil {
return err
}
if o.HideCollections != nil {
// form param hide_collections
var frHideCollections bool
if o.HideCollections != nil {
frHideCollections = *o.HideCollections
}
fHideCollections := swag.FormatBool(frHideCollections)
if fHideCollections != "" {
if err := r.SetFormParam("hide_collections", fHideCollections); err != nil {
return err
}
}
}
if o.Locked != nil {
// form param locked
var frLocked bool
if o.Locked != nil {
frLocked = *o.Locked
}
fLocked := swag.FormatBool(frLocked)
if fLocked != "" {
if err := r.SetFormParam("locked", fLocked); err != nil {
return err
}
}
}
// form param note
frNote := o.Note
fNote := frNote
if err := r.SetFormParam("note", fNote); err != nil {
return err
}
if o.SourceLanguage != nil {
// form param source[language]
var frSourceLanguage string
if o.SourceLanguage != nil {
frSourceLanguage = *o.SourceLanguage
}
fSourceLanguage := frSourceLanguage
if fSourceLanguage != "" {
if err := r.SetFormParam("source[language]", fSourceLanguage); err != nil {
return err
}
}
}
if o.SourcePrivacy != nil {
// form param source[privacy]
var frSourcePrivacy string
if o.SourcePrivacy != nil {
frSourcePrivacy = *o.SourcePrivacy
}
fSourcePrivacy := frSourcePrivacy
if fSourcePrivacy != "" {
if err := r.SetFormParam("source[privacy]", fSourcePrivacy); err != nil {
return err
}
}
}
if o.SourceSensitive != nil {
// form param source[sensitive]
var frSourceSensitive bool
if o.SourceSensitive != nil {
frSourceSensitive = *o.SourceSensitive
}
fSourceSensitive := swag.FormatBool(frSourceSensitive)
if fSourceSensitive != "" {
if err := r.SetFormParam("source[sensitive]", fSourceSensitive); err != nil {
return err
}
}
}
if o.SourceStatusContentType != nil {
// form param source[status_content_type]
var frSourceStatusContentType string
if o.SourceStatusContentType != nil {
frSourceStatusContentType = *o.SourceStatusContentType
}
fSourceStatusContentType := frSourceStatusContentType
if fSourceStatusContentType != "" {
if err := r.SetFormParam("source[status_content_type]", fSourceStatusContentType); err != nil {
return err
}
}
}
if o.Theme != nil {
// form param theme
var frTheme string
if o.Theme != nil {
frTheme = *o.Theme
}
fTheme := frTheme
if fTheme != "" {
if err := r.SetFormParam("theme", fTheme); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}