// 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"
)

// NewAccountAliasParams creates a new AccountAliasParams 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 NewAccountAliasParams() *AccountAliasParams {
	return &AccountAliasParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewAccountAliasParamsWithTimeout creates a new AccountAliasParams object
// with the ability to set a timeout on a request.
func NewAccountAliasParamsWithTimeout(timeout time.Duration) *AccountAliasParams {
	return &AccountAliasParams{
		timeout: timeout,
	}
}

// NewAccountAliasParamsWithContext creates a new AccountAliasParams object
// with the ability to set a context for a request.
func NewAccountAliasParamsWithContext(ctx context.Context) *AccountAliasParams {
	return &AccountAliasParams{
		Context: ctx,
	}
}

// NewAccountAliasParamsWithHTTPClient creates a new AccountAliasParams object
// with the ability to set a custom HTTPClient for a request.
func NewAccountAliasParamsWithHTTPClient(client *http.Client) *AccountAliasParams {
	return &AccountAliasParams{
		HTTPClient: client,
	}
}

/*
AccountAliasParams contains all the parameters to send to the API endpoint

	for the account alias operation.

	Typically these are written to a http.Request.
*/
type AccountAliasParams struct {

	/* AlsoKnownAsUris.

	     ActivityPub URI/IDs of target accounts to which this account is being aliased. Eg., `["https://example.org/users/some_account"]`.
	Use an empty array to unset alsoKnownAs, clearing the aliases.
	*/
	AlsoKnownAsUris string

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithDefaults hydrates default values in the account alias params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountAliasParams) WithDefaults() *AccountAliasParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the account alias params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AccountAliasParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the account alias params
func (o *AccountAliasParams) WithTimeout(timeout time.Duration) *AccountAliasParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the account alias params
func (o *AccountAliasParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the account alias params
func (o *AccountAliasParams) WithContext(ctx context.Context) *AccountAliasParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the account alias params
func (o *AccountAliasParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the account alias params
func (o *AccountAliasParams) WithHTTPClient(client *http.Client) *AccountAliasParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the account alias params
func (o *AccountAliasParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithAlsoKnownAsUris adds the alsoKnownAsUris to the account alias params
func (o *AccountAliasParams) WithAlsoKnownAsUris(alsoKnownAsUris string) *AccountAliasParams {
	o.SetAlsoKnownAsUris(alsoKnownAsUris)
	return o
}

// SetAlsoKnownAsUris adds the alsoKnownAsUris to the account alias params
func (o *AccountAliasParams) SetAlsoKnownAsUris(alsoKnownAsUris string) {
	o.AlsoKnownAsUris = alsoKnownAsUris
}

// WriteToRequest writes these params to a swagger request
func (o *AccountAliasParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	// form param also_known_as_uris
	frAlsoKnownAsUris := o.AlsoKnownAsUris
	fAlsoKnownAsUris := frAlsoKnownAsUris
	if fAlsoKnownAsUris != "" {
		if err := r.SetFormParam("also_known_as_uris", fAlsoKnownAsUris); err != nil {
			return err
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
