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

package log_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-log-service/preview/2021-03-30/models"
)

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

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

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

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

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

	for the log service create streaming destination2 operation.

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

	// Body.
	Body *models.LogService20210330CreateStreamingDestinationRequest

	/* LocationOrganizationID.

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

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

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

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

// WithTimeout adds the timeout to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) WithTimeout(timeout time.Duration) *LogServiceCreateStreamingDestination2Params {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) WithContext(ctx context.Context) *LogServiceCreateStreamingDestination2Params {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) WithHTTPClient(client *http.Client) *LogServiceCreateStreamingDestination2Params {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) WithBody(body *models.LogService20210330CreateStreamingDestinationRequest) *LogServiceCreateStreamingDestination2Params {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) SetBody(body *models.LogService20210330CreateStreamingDestinationRequest) {
	o.Body = body
}

// WithLocationOrganizationID adds the locationOrganizationID to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) WithLocationOrganizationID(locationOrganizationID string) *LogServiceCreateStreamingDestination2Params {
	o.SetLocationOrganizationID(locationOrganizationID)
	return o
}

// SetLocationOrganizationID adds the locationOrganizationId to the log service create streaming destination2 params
func (o *LogServiceCreateStreamingDestination2Params) SetLocationOrganizationID(locationOrganizationID string) {
	o.LocationOrganizationID = locationOrganizationID
}

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

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