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

package secret_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"
)

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

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

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

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

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

	for the get gateway pool certificate operation.

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

	// CsrPem.
	CsrPem *string

	// GatewayPoolName.
	GatewayPoolName string

	// OrganizationID.
	OrganizationID string

	// ProjectID.
	ProjectID string

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

// WithDefaults hydrates default values in the get gateway pool certificate params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetGatewayPoolCertificateParams) WithDefaults() *GetGatewayPoolCertificateParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the get gateway pool certificate params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetGatewayPoolCertificateParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) WithTimeout(timeout time.Duration) *GetGatewayPoolCertificateParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) WithContext(ctx context.Context) *GetGatewayPoolCertificateParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) WithHTTPClient(client *http.Client) *GetGatewayPoolCertificateParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithCsrPem adds the csrPem to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) WithCsrPem(csrPem *string) *GetGatewayPoolCertificateParams {
	o.SetCsrPem(csrPem)
	return o
}

// SetCsrPem adds the csrPem to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) SetCsrPem(csrPem *string) {
	o.CsrPem = csrPem
}

// WithGatewayPoolName adds the gatewayPoolName to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) WithGatewayPoolName(gatewayPoolName string) *GetGatewayPoolCertificateParams {
	o.SetGatewayPoolName(gatewayPoolName)
	return o
}

// SetGatewayPoolName adds the gatewayPoolName to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) SetGatewayPoolName(gatewayPoolName string) {
	o.GatewayPoolName = gatewayPoolName
}

// WithOrganizationID adds the organizationID to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) WithOrganizationID(organizationID string) *GetGatewayPoolCertificateParams {
	o.SetOrganizationID(organizationID)
	return o
}

// SetOrganizationID adds the organizationId to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) SetOrganizationID(organizationID string) {
	o.OrganizationID = organizationID
}

// WithProjectID adds the projectID to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) WithProjectID(projectID string) *GetGatewayPoolCertificateParams {
	o.SetProjectID(projectID)
	return o
}

// SetProjectID adds the projectId to the get gateway pool certificate params
func (o *GetGatewayPoolCertificateParams) SetProjectID(projectID string) {
	o.ProjectID = projectID
}

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

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

	if o.CsrPem != nil {

		// query param csr_pem
		var qrCsrPem string

		if o.CsrPem != nil {
			qrCsrPem = *o.CsrPem
		}
		qCsrPem := qrCsrPem
		if qCsrPem != "" {

			if err := r.SetQueryParam("csr_pem", qCsrPem); err != nil {
				return err
			}
		}
	}

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

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

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

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