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

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

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

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

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

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

	for the create DNS forwarding rule operation.

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

	// Body.
	Body *models.HashicorpCloudNetwork20200907CreateDNSForwardingRuleRequest

	/* DNSForwardingRuleDNSForwardingID.

	   DNSForwardingId is the user specified ID of the dns forwarding to which the rule belongs
	*/
	DNSForwardingRuleDNSForwardingID string

	/* DNSForwardingRuleHvnID.

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

	/* DNSForwardingRuleHvnLocationOrganizationID.

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

	/* DNSForwardingRuleHvnLocationProjectID.

	   project_id is the projects id.
	*/
	DNSForwardingRuleHvnLocationProjectID string

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

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

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

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

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

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

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

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

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

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

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

// WithDNSForwardingRuleDNSForwardingID adds the dNSForwardingRuleDNSForwardingID to the create DNS forwarding rule params
func (o *CreateDNSForwardingRuleParams) WithDNSForwardingRuleDNSForwardingID(dNSForwardingRuleDNSForwardingID string) *CreateDNSForwardingRuleParams {
	o.SetDNSForwardingRuleDNSForwardingID(dNSForwardingRuleDNSForwardingID)
	return o
}

// SetDNSForwardingRuleDNSForwardingID adds the dnsForwardingRuleDnsForwardingId to the create DNS forwarding rule params
func (o *CreateDNSForwardingRuleParams) SetDNSForwardingRuleDNSForwardingID(dNSForwardingRuleDNSForwardingID string) {
	o.DNSForwardingRuleDNSForwardingID = dNSForwardingRuleDNSForwardingID
}

// WithDNSForwardingRuleHvnID adds the dNSForwardingRuleHvnID to the create DNS forwarding rule params
func (o *CreateDNSForwardingRuleParams) WithDNSForwardingRuleHvnID(dNSForwardingRuleHvnID string) *CreateDNSForwardingRuleParams {
	o.SetDNSForwardingRuleHvnID(dNSForwardingRuleHvnID)
	return o
}

// SetDNSForwardingRuleHvnID adds the dnsForwardingRuleHvnId to the create DNS forwarding rule params
func (o *CreateDNSForwardingRuleParams) SetDNSForwardingRuleHvnID(dNSForwardingRuleHvnID string) {
	o.DNSForwardingRuleHvnID = dNSForwardingRuleHvnID
}

// WithDNSForwardingRuleHvnLocationOrganizationID adds the dNSForwardingRuleHvnLocationOrganizationID to the create DNS forwarding rule params
func (o *CreateDNSForwardingRuleParams) WithDNSForwardingRuleHvnLocationOrganizationID(dNSForwardingRuleHvnLocationOrganizationID string) *CreateDNSForwardingRuleParams {
	o.SetDNSForwardingRuleHvnLocationOrganizationID(dNSForwardingRuleHvnLocationOrganizationID)
	return o
}

// SetDNSForwardingRuleHvnLocationOrganizationID adds the dnsForwardingRuleHvnLocationOrganizationId to the create DNS forwarding rule params
func (o *CreateDNSForwardingRuleParams) SetDNSForwardingRuleHvnLocationOrganizationID(dNSForwardingRuleHvnLocationOrganizationID string) {
	o.DNSForwardingRuleHvnLocationOrganizationID = dNSForwardingRuleHvnLocationOrganizationID
}

// WithDNSForwardingRuleHvnLocationProjectID adds the dNSForwardingRuleHvnLocationProjectID to the create DNS forwarding rule params
func (o *CreateDNSForwardingRuleParams) WithDNSForwardingRuleHvnLocationProjectID(dNSForwardingRuleHvnLocationProjectID string) *CreateDNSForwardingRuleParams {
	o.SetDNSForwardingRuleHvnLocationProjectID(dNSForwardingRuleHvnLocationProjectID)
	return o
}

// SetDNSForwardingRuleHvnLocationProjectID adds the dnsForwardingRuleHvnLocationProjectId to the create DNS forwarding rule params
func (o *CreateDNSForwardingRuleParams) SetDNSForwardingRuleHvnLocationProjectID(dNSForwardingRuleHvnLocationProjectID string) {
	o.DNSForwardingRuleHvnLocationProjectID = dNSForwardingRuleHvnLocationProjectID
}

// WriteToRequest writes these params to a swagger request
func (o *CreateDNSForwardingRuleParams) 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_rule.dns_forwarding_id
	if err := r.SetPathParam("dns_forwarding_rule.dns_forwarding_id", o.DNSForwardingRuleDNSForwardingID); err != nil {
		return err
	}

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

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

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

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