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

package application_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"
)

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

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

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

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

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

	for the application service update operation.

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

	/* ApplicationID.

	     Application ID (UUID).
	Note: on create this will be automatically generated.
	*/
	ApplicationID string

	// Body.
	Body ApplicationServiceUpdateBody

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

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

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

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

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

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

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

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

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

// WithApplicationID adds the applicationID to the application service update params
func (o *ApplicationServiceUpdateParams) WithApplicationID(applicationID string) *ApplicationServiceUpdateParams {
	o.SetApplicationID(applicationID)
	return o
}

// SetApplicationID adds the applicationId to the application service update params
func (o *ApplicationServiceUpdateParams) SetApplicationID(applicationID string) {
	o.ApplicationID = applicationID
}

// WithBody adds the body to the application service update params
func (o *ApplicationServiceUpdateParams) WithBody(body ApplicationServiceUpdateBody) *ApplicationServiceUpdateParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the application service update params
func (o *ApplicationServiceUpdateParams) SetBody(body ApplicationServiceUpdateBody) {
	o.Body = body
}

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

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

	// path param application.id
	if err := r.SetPathParam("application.id", o.ApplicationID); err != nil {
		return err
	}
	if err := r.SetBodyParam(o.Body); err != nil {
		return err
	}

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