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

package experiment_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 experiment service API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
	return &Client{transport: transport, formats: formats}
}

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

/*
ArchiveExperiment archives an experiment and the experiment s runs and recurring runs
*/
func (a *Client) ArchiveExperiment(params *ArchiveExperimentParams) (*ArchiveExperimentOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewArchiveExperimentParams()
	}

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

}

/*
CreateExperiment creates a new experiment
*/
func (a *Client) CreateExperiment(params *CreateExperimentParams) (*CreateExperimentOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewCreateExperimentParams()
	}

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

}

/*
DeleteExperiment deletes an experiment without deleting the experiment s runs and recurring runs to avoid unexpected behaviors delete an experiment s runs and recurring runs before deleting the experiment
*/
func (a *Client) DeleteExperiment(params *DeleteExperimentParams) (*DeleteExperimentOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDeleteExperimentParams()
	}

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

}

/*
GetExperiment finds a specific experiment by ID
*/
func (a *Client) GetExperiment(params *GetExperimentParams) (*GetExperimentOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetExperimentParams()
	}

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

}

/*
ListExperiments finds all experiments supports pagination and sorting on certain fields
*/
func (a *Client) ListExperiments(params *ListExperimentsParams) (*ListExperimentsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewListExperimentsParams()
	}

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

}

/*
UnarchiveExperiment restores an archived experiment the experiment s archived runs and recurring runs will stay archived
*/
func (a *Client) UnarchiveExperiment(params *UnarchiveExperimentParams) (*UnarchiveExperimentOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewUnarchiveExperimentParams()
	}

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

}

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