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

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

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

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

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

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

	for the create private link service operation.

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

	// Body.
	Body *models.HashicorpCloudNetwork20200907CreatePrivateLinkServiceRequest

	/* PrivateLinkServiceHvnID.

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

	/* PrivateLinkServiceHvnLocationOrganizationID.

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

	/* PrivateLinkServiceHvnLocationProjectID.

	   project_id is the projects id.
	*/
	PrivateLinkServiceHvnLocationProjectID string

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

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

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

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

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

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

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

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

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

// WithBody adds the body to the create private link service params
func (o *CreatePrivateLinkServiceParams) WithBody(body *models.HashicorpCloudNetwork20200907CreatePrivateLinkServiceRequest) *CreatePrivateLinkServiceParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the create private link service params
func (o *CreatePrivateLinkServiceParams) SetBody(body *models.HashicorpCloudNetwork20200907CreatePrivateLinkServiceRequest) {
	o.Body = body
}

// WithPrivateLinkServiceHvnID adds the privateLinkServiceHvnID to the create private link service params
func (o *CreatePrivateLinkServiceParams) WithPrivateLinkServiceHvnID(privateLinkServiceHvnID string) *CreatePrivateLinkServiceParams {
	o.SetPrivateLinkServiceHvnID(privateLinkServiceHvnID)
	return o
}

// SetPrivateLinkServiceHvnID adds the privateLinkServiceHvnId to the create private link service params
func (o *CreatePrivateLinkServiceParams) SetPrivateLinkServiceHvnID(privateLinkServiceHvnID string) {
	o.PrivateLinkServiceHvnID = privateLinkServiceHvnID
}

// WithPrivateLinkServiceHvnLocationOrganizationID adds the privateLinkServiceHvnLocationOrganizationID to the create private link service params
func (o *CreatePrivateLinkServiceParams) WithPrivateLinkServiceHvnLocationOrganizationID(privateLinkServiceHvnLocationOrganizationID string) *CreatePrivateLinkServiceParams {
	o.SetPrivateLinkServiceHvnLocationOrganizationID(privateLinkServiceHvnLocationOrganizationID)
	return o
}

// SetPrivateLinkServiceHvnLocationOrganizationID adds the privateLinkServiceHvnLocationOrganizationId to the create private link service params
func (o *CreatePrivateLinkServiceParams) SetPrivateLinkServiceHvnLocationOrganizationID(privateLinkServiceHvnLocationOrganizationID string) {
	o.PrivateLinkServiceHvnLocationOrganizationID = privateLinkServiceHvnLocationOrganizationID
}

// WithPrivateLinkServiceHvnLocationProjectID adds the privateLinkServiceHvnLocationProjectID to the create private link service params
func (o *CreatePrivateLinkServiceParams) WithPrivateLinkServiceHvnLocationProjectID(privateLinkServiceHvnLocationProjectID string) *CreatePrivateLinkServiceParams {
	o.SetPrivateLinkServiceHvnLocationProjectID(privateLinkServiceHvnLocationProjectID)
	return o
}

// SetPrivateLinkServiceHvnLocationProjectID adds the privateLinkServiceHvnLocationProjectId to the create private link service params
func (o *CreatePrivateLinkServiceParams) SetPrivateLinkServiceHvnLocationProjectID(privateLinkServiceHvnLocationProjectID string) {
	o.PrivateLinkServiceHvnLocationProjectID = privateLinkServiceHvnLocationProjectID
}

// WriteToRequest writes these params to a swagger request
func (o *CreatePrivateLinkServiceParams) 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 private_link_service.hvn.id
	if err := r.SetPathParam("private_link_service.hvn.id", o.PrivateLinkServiceHvnID); err != nil {
		return err
	}

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

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

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