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

package pipeline_service

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"github.com/go-openapi/runtime"

	strfmt "github.com/go-openapi/strfmt"
)

// New creates a new pipeline service API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
	return &Client{transport: transport, formats: formats}
}

/*
Client for pipeline service API
*/
type Client struct {
	transport runtime.ClientTransport
	formats   strfmt.Registry
}

/*
CreatePipelineV1 creates a pipeline
*/
func (a *Client) CreatePipelineV1(params *CreatePipelineV1Params, authInfo runtime.ClientAuthInfoWriter) (*CreatePipelineV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewCreatePipelineV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "CreatePipelineV1",
		Method:             "POST",
		PathPattern:        "/apis/v1beta1/pipelines",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &CreatePipelineV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*CreatePipelineV1OK), nil

}

/*
CreatePipelineVersionV1 adds a pipeline version to the specified pipeline
*/
func (a *Client) CreatePipelineVersionV1(params *CreatePipelineVersionV1Params, authInfo runtime.ClientAuthInfoWriter) (*CreatePipelineVersionV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewCreatePipelineVersionV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "CreatePipelineVersionV1",
		Method:             "POST",
		PathPattern:        "/apis/v1beta1/pipeline_versions",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &CreatePipelineVersionV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*CreatePipelineVersionV1OK), nil

}

/*
DeletePipelineV1 deletes a pipeline and its pipeline versions
*/
func (a *Client) DeletePipelineV1(params *DeletePipelineV1Params, authInfo runtime.ClientAuthInfoWriter) (*DeletePipelineV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDeletePipelineV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "DeletePipelineV1",
		Method:             "DELETE",
		PathPattern:        "/apis/v1beta1/pipelines/{id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &DeletePipelineV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*DeletePipelineV1OK), nil

}

/*
DeletePipelineVersionV1 deletes a pipeline version by pipeline version ID if the deleted pipeline version is the default pipeline version the pipeline s default version changes to the pipeline s most recent pipeline version if there are no remaining pipeline versions the pipeline will have no default version examines the run service api ipynb notebook to learn more about creating a run using a pipeline version https github com kubeflow pipelines blob master tools benchmarks run service api ipynb
*/
func (a *Client) DeletePipelineVersionV1(params *DeletePipelineVersionV1Params, authInfo runtime.ClientAuthInfoWriter) (*DeletePipelineVersionV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDeletePipelineVersionV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "DeletePipelineVersionV1",
		Method:             "DELETE",
		PathPattern:        "/apis/v1beta1/pipeline_versions/{version_id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &DeletePipelineVersionV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*DeletePipelineVersionV1OK), nil

}

/*
GetPipelineByNameV1 finds a pipeline by name and namespace
*/
func (a *Client) GetPipelineByNameV1(params *GetPipelineByNameV1Params, authInfo runtime.ClientAuthInfoWriter) (*GetPipelineByNameV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetPipelineByNameV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetPipelineByNameV1",
		Method:             "GET",
		PathPattern:        "/apis/v1beta1/namespaces/{namespace}/pipelines/{name}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetPipelineByNameV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetPipelineByNameV1OK), nil

}

/*
GetPipelineV1 finds a specific pipeline by ID
*/
func (a *Client) GetPipelineV1(params *GetPipelineV1Params, authInfo runtime.ClientAuthInfoWriter) (*GetPipelineV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetPipelineV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetPipelineV1",
		Method:             "GET",
		PathPattern:        "/apis/v1beta1/pipelines/{id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetPipelineV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetPipelineV1OK), nil

}

/*
GetPipelineVersionTemplate returns a y a m l template that contains the specified pipeline version s description parameters and metadata
*/
func (a *Client) GetPipelineVersionTemplate(params *GetPipelineVersionTemplateParams, authInfo runtime.ClientAuthInfoWriter) (*GetPipelineVersionTemplateOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetPipelineVersionTemplateParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetPipelineVersionTemplate",
		Method:             "GET",
		PathPattern:        "/apis/v1beta1/pipeline_versions/{version_id}/templates",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetPipelineVersionTemplateReader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetPipelineVersionTemplateOK), nil

}

/*
GetPipelineVersionV1 gets a pipeline version by pipeline version ID
*/
func (a *Client) GetPipelineVersionV1(params *GetPipelineVersionV1Params, authInfo runtime.ClientAuthInfoWriter) (*GetPipelineVersionV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetPipelineVersionV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetPipelineVersionV1",
		Method:             "GET",
		PathPattern:        "/apis/v1beta1/pipeline_versions/{version_id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetPipelineVersionV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetPipelineVersionV1OK), nil

}

/*
GetTemplate returns a single y a m l template that contains the description parameters and metadata associated with the pipeline provided
*/
func (a *Client) GetTemplate(params *GetTemplateParams, authInfo runtime.ClientAuthInfoWriter) (*GetTemplateOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetTemplateParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetTemplate",
		Method:             "GET",
		PathPattern:        "/apis/v1beta1/pipelines/{id}/templates",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetTemplateReader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetTemplateOK), nil

}

/*
ListPipelineVersionsV1 lists all pipeline versions of a given pipeline
*/
func (a *Client) ListPipelineVersionsV1(params *ListPipelineVersionsV1Params, authInfo runtime.ClientAuthInfoWriter) (*ListPipelineVersionsV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewListPipelineVersionsV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "ListPipelineVersionsV1",
		Method:             "GET",
		PathPattern:        "/apis/v1beta1/pipeline_versions",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &ListPipelineVersionsV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*ListPipelineVersionsV1OK), nil

}

/*
ListPipelinesV1 finds all pipelines
*/
func (a *Client) ListPipelinesV1(params *ListPipelinesV1Params, authInfo runtime.ClientAuthInfoWriter) (*ListPipelinesV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewListPipelinesV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "ListPipelinesV1",
		Method:             "GET",
		PathPattern:        "/apis/v1beta1/pipelines",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &ListPipelinesV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*ListPipelinesV1OK), nil

}

/*
UpdatePipelineDefaultVersionV1 updates the default pipeline version of a specific pipeline
*/
func (a *Client) UpdatePipelineDefaultVersionV1(params *UpdatePipelineDefaultVersionV1Params, authInfo runtime.ClientAuthInfoWriter) (*UpdatePipelineDefaultVersionV1OK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewUpdatePipelineDefaultVersionV1Params()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "UpdatePipelineDefaultVersionV1",
		Method:             "POST",
		PathPattern:        "/apis/v1beta1/pipelines/{pipeline_id}/default_version/{version_id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &UpdatePipelineDefaultVersionV1Reader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*UpdatePipelineDefaultVersionV1OK), nil

}

// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
	a.transport = transport
}
