// Code generated by go-swagger; DO NOT EDIT.

package user_service

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

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

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

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

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

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

	for the user service update operation.

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

	// Body.
	Body UserServiceUpdateBody

	/* UserID.

	     User ID (UUID).
	Will be set automatically on create.
	*/
	UserID string

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

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

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

// WithTimeout adds the timeout to the user service update params
func (o *UserServiceUpdateParams) WithTimeout(timeout time.Duration) *UserServiceUpdateParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the user service update params
func (o *UserServiceUpdateParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the user service update params
func (o *UserServiceUpdateParams) WithContext(ctx context.Context) *UserServiceUpdateParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the user service update params
func (o *UserServiceUpdateParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the user service update params
func (o *UserServiceUpdateParams) WithHTTPClient(client *http.Client) *UserServiceUpdateParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the user service update params
func (o *UserServiceUpdateParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the user service update params
func (o *UserServiceUpdateParams) WithBody(body UserServiceUpdateBody) *UserServiceUpdateParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the user service update params
func (o *UserServiceUpdateParams) SetBody(body UserServiceUpdateBody) {
	o.Body = body
}

// WithUserID adds the userID to the user service update params
func (o *UserServiceUpdateParams) WithUserID(userID string) *UserServiceUpdateParams {
	o.SetUserID(userID)
	return o
}

// SetUserID adds the userId to the user service update params
func (o *UserServiceUpdateParams) SetUserID(userID string) {
	o.UserID = userID
}

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

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

	// path param user.id
	if err := r.SetPathParam("user.id", o.UserID); err != nil {
		return err
	}

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