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

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

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

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

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

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

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

	for the run service read artifact v1 operation.

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

	/* ArtifactName.

	   The name of the artifact.
	*/
	ArtifactName string

	/* NodeID.

	   The ID of the running node.
	*/
	NodeID string

	/* RunID.

	   The ID of the run.
	*/
	RunID string

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

// WithDefaults hydrates default values in the run service read artifact v1 params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *RunServiceReadArtifactV1Params) WithDefaults() *RunServiceReadArtifactV1Params {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the run service read artifact v1 params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *RunServiceReadArtifactV1Params) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) WithTimeout(timeout time.Duration) *RunServiceReadArtifactV1Params {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) WithContext(ctx context.Context) *RunServiceReadArtifactV1Params {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) WithHTTPClient(client *http.Client) *RunServiceReadArtifactV1Params {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithArtifactName adds the artifactName to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) WithArtifactName(artifactName string) *RunServiceReadArtifactV1Params {
	o.SetArtifactName(artifactName)
	return o
}

// SetArtifactName adds the artifactName to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) SetArtifactName(artifactName string) {
	o.ArtifactName = artifactName
}

// WithNodeID adds the nodeID to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) WithNodeID(nodeID string) *RunServiceReadArtifactV1Params {
	o.SetNodeID(nodeID)
	return o
}

// SetNodeID adds the nodeId to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) SetNodeID(nodeID string) {
	o.NodeID = nodeID
}

// WithRunID adds the runID to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) WithRunID(runID string) *RunServiceReadArtifactV1Params {
	o.SetRunID(runID)
	return o
}

// SetRunID adds the runId to the run service read artifact v1 params
func (o *RunServiceReadArtifactV1Params) SetRunID(runID string) {
	o.RunID = runID
}

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

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

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

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

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

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