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

package network_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"

	"github.com/hashicorp/hcp-sdk-go/clients/cloud-network/stable/2020-09-07/models"
)

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

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

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

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

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

	for the update private link service operation.

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

	// Body.
	Body *models.HashicorpCloudNetwork20200907UpdatePrivateLinkServiceRequest

	/* HvnID.

	   id is the identifier for this resource.
	*/
	HvnID string

	/* HvnLocationOrganizationID.

	   organization_id is the id of the organization.
	*/
	HvnLocationOrganizationID string

	/* HvnLocationProjectID.

	   project_id is the projects id.
	*/
	HvnLocationProjectID string

	/* ID.

	   Id is the ID of the private_link to update
	*/
	ID string

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

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

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

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

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

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

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

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

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

// WithBody adds the body to the update private link service params
func (o *UpdatePrivateLinkServiceParams) WithBody(body *models.HashicorpCloudNetwork20200907UpdatePrivateLinkServiceRequest) *UpdatePrivateLinkServiceParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the update private link service params
func (o *UpdatePrivateLinkServiceParams) SetBody(body *models.HashicorpCloudNetwork20200907UpdatePrivateLinkServiceRequest) {
	o.Body = body
}

// WithHvnID adds the hvnID to the update private link service params
func (o *UpdatePrivateLinkServiceParams) WithHvnID(hvnID string) *UpdatePrivateLinkServiceParams {
	o.SetHvnID(hvnID)
	return o
}

// SetHvnID adds the hvnId to the update private link service params
func (o *UpdatePrivateLinkServiceParams) SetHvnID(hvnID string) {
	o.HvnID = hvnID
}

// WithHvnLocationOrganizationID adds the hvnLocationOrganizationID to the update private link service params
func (o *UpdatePrivateLinkServiceParams) WithHvnLocationOrganizationID(hvnLocationOrganizationID string) *UpdatePrivateLinkServiceParams {
	o.SetHvnLocationOrganizationID(hvnLocationOrganizationID)
	return o
}

// SetHvnLocationOrganizationID adds the hvnLocationOrganizationId to the update private link service params
func (o *UpdatePrivateLinkServiceParams) SetHvnLocationOrganizationID(hvnLocationOrganizationID string) {
	o.HvnLocationOrganizationID = hvnLocationOrganizationID
}

// WithHvnLocationProjectID adds the hvnLocationProjectID to the update private link service params
func (o *UpdatePrivateLinkServiceParams) WithHvnLocationProjectID(hvnLocationProjectID string) *UpdatePrivateLinkServiceParams {
	o.SetHvnLocationProjectID(hvnLocationProjectID)
	return o
}

// SetHvnLocationProjectID adds the hvnLocationProjectId to the update private link service params
func (o *UpdatePrivateLinkServiceParams) SetHvnLocationProjectID(hvnLocationProjectID string) {
	o.HvnLocationProjectID = hvnLocationProjectID
}

// WithID adds the id to the update private link service params
func (o *UpdatePrivateLinkServiceParams) WithID(id string) *UpdatePrivateLinkServiceParams {
	o.SetID(id)
	return o
}

// SetID adds the id to the update private link service params
func (o *UpdatePrivateLinkServiceParams) SetID(id string) {
	o.ID = id
}

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

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

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

	// path param hvn.location.organization_id
	if err := r.SetPathParam("hvn.location.organization_id", o.HvnLocationOrganizationID); err != nil {
		return err
	}

	// path param hvn.location.project_id
	if err := r.SetPathParam("hvn.location.project_id", o.HvnLocationProjectID); err != nil {
		return err
	}

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

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