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

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

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

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

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

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

	for the create DNS forwarding operation.

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

	// Body.
	Body *models.HashicorpCloudNetwork20200907CreateDNSForwardingRequest

	/* DNSForwardingHvnID.

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

	/* DNSForwardingHvnLocationOrganizationID.

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

	/* DNSForwardingHvnLocationProjectID.

	   project_id is the projects id.
	*/
	DNSForwardingHvnLocationProjectID string

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

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

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

// WithTimeout adds the timeout to the create DNS forwarding params
func (o *CreateDNSForwardingParams) WithTimeout(timeout time.Duration) *CreateDNSForwardingParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the create DNS forwarding params
func (o *CreateDNSForwardingParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the create DNS forwarding params
func (o *CreateDNSForwardingParams) WithContext(ctx context.Context) *CreateDNSForwardingParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the create DNS forwarding params
func (o *CreateDNSForwardingParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the create DNS forwarding params
func (o *CreateDNSForwardingParams) WithHTTPClient(client *http.Client) *CreateDNSForwardingParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the create DNS forwarding params
func (o *CreateDNSForwardingParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the create DNS forwarding params
func (o *CreateDNSForwardingParams) WithBody(body *models.HashicorpCloudNetwork20200907CreateDNSForwardingRequest) *CreateDNSForwardingParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the create DNS forwarding params
func (o *CreateDNSForwardingParams) SetBody(body *models.HashicorpCloudNetwork20200907CreateDNSForwardingRequest) {
	o.Body = body
}

// WithDNSForwardingHvnID adds the dNSForwardingHvnID to the create DNS forwarding params
func (o *CreateDNSForwardingParams) WithDNSForwardingHvnID(dNSForwardingHvnID string) *CreateDNSForwardingParams {
	o.SetDNSForwardingHvnID(dNSForwardingHvnID)
	return o
}

// SetDNSForwardingHvnID adds the dnsForwardingHvnId to the create DNS forwarding params
func (o *CreateDNSForwardingParams) SetDNSForwardingHvnID(dNSForwardingHvnID string) {
	o.DNSForwardingHvnID = dNSForwardingHvnID
}

// WithDNSForwardingHvnLocationOrganizationID adds the dNSForwardingHvnLocationOrganizationID to the create DNS forwarding params
func (o *CreateDNSForwardingParams) WithDNSForwardingHvnLocationOrganizationID(dNSForwardingHvnLocationOrganizationID string) *CreateDNSForwardingParams {
	o.SetDNSForwardingHvnLocationOrganizationID(dNSForwardingHvnLocationOrganizationID)
	return o
}

// SetDNSForwardingHvnLocationOrganizationID adds the dnsForwardingHvnLocationOrganizationId to the create DNS forwarding params
func (o *CreateDNSForwardingParams) SetDNSForwardingHvnLocationOrganizationID(dNSForwardingHvnLocationOrganizationID string) {
	o.DNSForwardingHvnLocationOrganizationID = dNSForwardingHvnLocationOrganizationID
}

// WithDNSForwardingHvnLocationProjectID adds the dNSForwardingHvnLocationProjectID to the create DNS forwarding params
func (o *CreateDNSForwardingParams) WithDNSForwardingHvnLocationProjectID(dNSForwardingHvnLocationProjectID string) *CreateDNSForwardingParams {
	o.SetDNSForwardingHvnLocationProjectID(dNSForwardingHvnLocationProjectID)
	return o
}

// SetDNSForwardingHvnLocationProjectID adds the dnsForwardingHvnLocationProjectId to the create DNS forwarding params
func (o *CreateDNSForwardingParams) SetDNSForwardingHvnLocationProjectID(dNSForwardingHvnLocationProjectID string) {
	o.DNSForwardingHvnLocationProjectID = dNSForwardingHvnLocationProjectID
}

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

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

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

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