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

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

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

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

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

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

	for the open app secret by resource name operation.

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

	// ResourceName.
	ResourceName string

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

// WithDefaults hydrates default values in the open app secret by resource name params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *OpenAppSecretByResourceNameParams) WithDefaults() *OpenAppSecretByResourceNameParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the open app secret by resource name params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *OpenAppSecretByResourceNameParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the open app secret by resource name params
func (o *OpenAppSecretByResourceNameParams) WithTimeout(timeout time.Duration) *OpenAppSecretByResourceNameParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the open app secret by resource name params
func (o *OpenAppSecretByResourceNameParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the open app secret by resource name params
func (o *OpenAppSecretByResourceNameParams) WithContext(ctx context.Context) *OpenAppSecretByResourceNameParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the open app secret by resource name params
func (o *OpenAppSecretByResourceNameParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the open app secret by resource name params
func (o *OpenAppSecretByResourceNameParams) WithHTTPClient(client *http.Client) *OpenAppSecretByResourceNameParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the open app secret by resource name params
func (o *OpenAppSecretByResourceNameParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithResourceName adds the resourceName to the open app secret by resource name params
func (o *OpenAppSecretByResourceNameParams) WithResourceName(resourceName string) *OpenAppSecretByResourceNameParams {
	o.SetResourceName(resourceName)
	return o
}

// SetResourceName adds the resourceName to the open app secret by resource name params
func (o *OpenAppSecretByResourceNameParams) SetResourceName(resourceName string) {
	o.ResourceName = resourceName
}

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

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

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

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