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

package recurring_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 (
	"github.com/go-openapi/runtime"

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

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

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

/*
CreateRecurringRun creates a new recurring run in an experiment given the experiment ID
*/
func (a *Client) CreateRecurringRun(params *CreateRecurringRunParams) (*CreateRecurringRunOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewCreateRecurringRunParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "CreateRecurringRun",
		Method:             "POST",
		PathPattern:        "/apis/v2beta1/recurringruns",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &CreateRecurringRunReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*CreateRecurringRunOK), nil

}

/*
DeleteRecurringRun deletes a recurring run
*/
func (a *Client) DeleteRecurringRun(params *DeleteRecurringRunParams) (*DeleteRecurringRunOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDeleteRecurringRunParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "DeleteRecurringRun",
		Method:             "DELETE",
		PathPattern:        "/apis/v2beta1/recurringruns/{recurring_run_id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &DeleteRecurringRunReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*DeleteRecurringRunOK), nil

}

/*
DisableRecurringRun stops a recurring run and all its associated runs the recurring run is not deleted
*/
func (a *Client) DisableRecurringRun(params *DisableRecurringRunParams) (*DisableRecurringRunOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDisableRecurringRunParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "DisableRecurringRun",
		Method:             "POST",
		PathPattern:        "/apis/v2beta1/recurringruns/{recurring_run_id}:disable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &DisableRecurringRunReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*DisableRecurringRunOK), nil

}

/*
EnableRecurringRun restarts a recurring run that was previously stopped all runs associated with the recurring run will continue
*/
func (a *Client) EnableRecurringRun(params *EnableRecurringRunParams) (*EnableRecurringRunOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewEnableRecurringRunParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "EnableRecurringRun",
		Method:             "POST",
		PathPattern:        "/apis/v2beta1/recurringruns/{recurring_run_id}:enable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &EnableRecurringRunReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*EnableRecurringRunOK), nil

}

/*
GetRecurringRun finds a specific recurring run by ID
*/
func (a *Client) GetRecurringRun(params *GetRecurringRunParams) (*GetRecurringRunOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetRecurringRunParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetRecurringRun",
		Method:             "GET",
		PathPattern:        "/apis/v2beta1/recurringruns/{recurring_run_id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetRecurringRunReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetRecurringRunOK), nil

}

/*
ListRecurringRuns finds all recurring runs given experiment and namespace if experiment ID is not specified find all recurring runs across all experiments
*/
func (a *Client) ListRecurringRuns(params *ListRecurringRunsParams) (*ListRecurringRunsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewListRecurringRunsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "ListRecurringRuns",
		Method:             "GET",
		PathPattern:        "/apis/v2beta1/recurringruns",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &ListRecurringRunsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*ListRecurringRunsOK), nil

}

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