All checks were successful
continuous-integration/drone/push Build is passing
182 lines
4.9 KiB
Go
182 lines
4.9 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"
|
|
)
|
|
|
|
// NewAccountMoveParams creates a new AccountMoveParams 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 NewAccountMoveParams() *AccountMoveParams {
|
|
return &AccountMoveParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewAccountMoveParamsWithTimeout creates a new AccountMoveParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewAccountMoveParamsWithTimeout(timeout time.Duration) *AccountMoveParams {
|
|
return &AccountMoveParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewAccountMoveParamsWithContext creates a new AccountMoveParams object
|
|
// with the ability to set a context for a request.
|
|
func NewAccountMoveParamsWithContext(ctx context.Context) *AccountMoveParams {
|
|
return &AccountMoveParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewAccountMoveParamsWithHTTPClient creates a new AccountMoveParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewAccountMoveParamsWithHTTPClient(client *http.Client) *AccountMoveParams {
|
|
return &AccountMoveParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
AccountMoveParams contains all the parameters to send to the API endpoint
|
|
|
|
for the account move operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type AccountMoveParams struct {
|
|
|
|
/* MovedToURI.
|
|
|
|
ActivityPub URI/ID of the target account. Eg., `https://example.org/users/some_account`. The target account must be alsoKnownAs the requesting account in order for the move to be successful.
|
|
*/
|
|
MovedToURI string
|
|
|
|
/* Password.
|
|
|
|
Password of the account user, for confirmation.
|
|
*/
|
|
Password string
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the account move params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *AccountMoveParams) WithDefaults() *AccountMoveParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the account move params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *AccountMoveParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the account move params
|
|
func (o *AccountMoveParams) WithTimeout(timeout time.Duration) *AccountMoveParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the account move params
|
|
func (o *AccountMoveParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the account move params
|
|
func (o *AccountMoveParams) WithContext(ctx context.Context) *AccountMoveParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the account move params
|
|
func (o *AccountMoveParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the account move params
|
|
func (o *AccountMoveParams) WithHTTPClient(client *http.Client) *AccountMoveParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the account move params
|
|
func (o *AccountMoveParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithMovedToURI adds the movedToURI to the account move params
|
|
func (o *AccountMoveParams) WithMovedToURI(movedToURI string) *AccountMoveParams {
|
|
o.SetMovedToURI(movedToURI)
|
|
return o
|
|
}
|
|
|
|
// SetMovedToURI adds the movedToUri to the account move params
|
|
func (o *AccountMoveParams) SetMovedToURI(movedToURI string) {
|
|
o.MovedToURI = movedToURI
|
|
}
|
|
|
|
// WithPassword adds the password to the account move params
|
|
func (o *AccountMoveParams) WithPassword(password string) *AccountMoveParams {
|
|
o.SetPassword(password)
|
|
return o
|
|
}
|
|
|
|
// SetPassword adds the password to the account move params
|
|
func (o *AccountMoveParams) SetPassword(password string) {
|
|
o.Password = password
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *AccountMoveParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
// form param moved_to_uri
|
|
frMovedToURI := o.MovedToURI
|
|
fMovedToURI := frMovedToURI
|
|
if fMovedToURI != "" {
|
|
if err := r.SetFormParam("moved_to_uri", fMovedToURI); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
// form param password
|
|
frPassword := o.Password
|
|
fPassword := frPassword
|
|
if fPassword != "" {
|
|
if err := r.SetFormParam("password", fPassword); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|