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

package p_cloud_jobs

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

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

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

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

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

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

	for the pcloud cloudinstances jobs getall operation.

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

	/* CloudInstanceID.

	   Cloud Instance ID of a PCloud Instance
	*/
	CloudInstanceID string

	/* OperationAction.

	   Operation action to filter jobs (optional) vmCapture - includes operation action value (vmCapture) imageExport - includes operation action value (imageExport) imageImport - includes operation action value (imageImport) storage - includes operation action values (vmCapture,imageExport,imageImport)
	*/
	OperationAction *string

	/* OperationID.

	   Operation ID to filter jobs (optional)
	*/
	OperationID *string

	/* OperationTarget.

	   Operation target to filter jobs (optional)
	*/
	OperationTarget *string

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

// WithDefaults hydrates default values in the pcloud cloudinstances jobs getall params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PcloudCloudinstancesJobsGetallParams) WithDefaults() *PcloudCloudinstancesJobsGetallParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the pcloud cloudinstances jobs getall params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PcloudCloudinstancesJobsGetallParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) WithTimeout(timeout time.Duration) *PcloudCloudinstancesJobsGetallParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) WithContext(ctx context.Context) *PcloudCloudinstancesJobsGetallParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) WithHTTPClient(client *http.Client) *PcloudCloudinstancesJobsGetallParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithCloudInstanceID adds the cloudInstanceID to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) WithCloudInstanceID(cloudInstanceID string) *PcloudCloudinstancesJobsGetallParams {
	o.SetCloudInstanceID(cloudInstanceID)
	return o
}

// SetCloudInstanceID adds the cloudInstanceId to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) SetCloudInstanceID(cloudInstanceID string) {
	o.CloudInstanceID = cloudInstanceID
}

// WithOperationAction adds the operationAction to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) WithOperationAction(operationAction *string) *PcloudCloudinstancesJobsGetallParams {
	o.SetOperationAction(operationAction)
	return o
}

// SetOperationAction adds the operationAction to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) SetOperationAction(operationAction *string) {
	o.OperationAction = operationAction
}

// WithOperationID adds the operationID to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) WithOperationID(operationID *string) *PcloudCloudinstancesJobsGetallParams {
	o.SetOperationID(operationID)
	return o
}

// SetOperationID adds the operationId to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) SetOperationID(operationID *string) {
	o.OperationID = operationID
}

// WithOperationTarget adds the operationTarget to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) WithOperationTarget(operationTarget *string) *PcloudCloudinstancesJobsGetallParams {
	o.SetOperationTarget(operationTarget)
	return o
}

// SetOperationTarget adds the operationTarget to the pcloud cloudinstances jobs getall params
func (o *PcloudCloudinstancesJobsGetallParams) SetOperationTarget(operationTarget *string) {
	o.OperationTarget = operationTarget
}

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

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

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

	if o.OperationAction != nil {

		// query param operation.action
		var qrOperationAction string

		if o.OperationAction != nil {
			qrOperationAction = *o.OperationAction
		}
		qOperationAction := qrOperationAction
		if qOperationAction != "" {

			if err := r.SetQueryParam("operation.action", qOperationAction); err != nil {
				return err
			}
		}
	}

	if o.OperationID != nil {

		// query param operation.id
		var qrOperationID string

		if o.OperationID != nil {
			qrOperationID = *o.OperationID
		}
		qOperationID := qrOperationID
		if qOperationID != "" {

			if err := r.SetQueryParam("operation.id", qOperationID); err != nil {
				return err
			}
		}
	}

	if o.OperationTarget != nil {

		// query param operation.target
		var qrOperationTarget string

		if o.OperationTarget != nil {
			qrOperationTarget = *o.OperationTarget
		}
		qOperationTarget := qrOperationTarget
		if qOperationTarget != "" {

			if err := r.SetQueryParam("operation.target", qOperationTarget); err != nil {
				return err
			}
		}
	}

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