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

package experimental

import (
	"context"
	"fmt"

	"github.com/go-openapi/runtime"

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

//go:generate mockery --name API --keeptree --with-expecter --case underscore

// API is the interface of the experimental client
type API interface {
	/*
	   GetExperimental get experimental API*/
	GetExperimental(ctx context.Context, params *GetExperimentalParams) (*GetExperimentalOK, error)
	/*
	   PutExperimental put experimental API*/
	PutExperimental(ctx context.Context, params *PutExperimentalParams) (*PutExperimentalOK, *PutExperimentalNoContent, error)
}

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

/*
Client for experimental API
*/
type Client struct {
	transport runtime.ClientTransport
	formats   strfmt.Registry
	authInfo  runtime.ClientAuthInfoWriter
}

/*
GetExperimental get experimental API
*/
func (a *Client) GetExperimental(ctx context.Context, params *GetExperimentalParams) (*GetExperimentalOK, error) {
	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetExperimental",
		Method:             "GET",
		PathPattern:        "/experimental",
		ProducesMediaTypes: []string{"application/io.swagger.examples.todo-list.v1+json"},
		ConsumesMediaTypes: []string{"application/io.swagger.examples.todo-list.v1+json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetExperimentalReader{formats: a.formats},
		AuthInfo:           a.authInfo,
		Context:            ctx,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}

	switch value := result.(type) {
	case *GetExperimentalOK:
		return value, nil
	case *GetExperimentalUnauthorized:
		return nil, runtime.NewAPIError("unsuccessful response", value, value.Code())
	}

	// unexpected response.

	// no default response is defined.
	//
	// safeguard: normally, in the absence of a default response, unknown responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for GetExperimental: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
PutExperimental put experimental API
*/
func (a *Client) PutExperimental(ctx context.Context, params *PutExperimentalParams) (*PutExperimentalOK, *PutExperimentalNoContent, error) {
	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "PutExperimental",
		Method:             "PUT",
		PathPattern:        "/experimental",
		ProducesMediaTypes: []string{"application/io.swagger.examples.todo-list.v1+json"},
		ConsumesMediaTypes: []string{"application/io.swagger.examples.todo-list.v1+json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &PutExperimentalReader{formats: a.formats},
		AuthInfo:           a.authInfo,
		Context:            ctx,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, nil, err
	}

	switch value := result.(type) {
	case *PutExperimentalOK:
		return value, nil, nil
	case *PutExperimentalNoContent:
		return nil, value, nil
	case *PutExperimentalMethodNotAllowed:
		return nil, nil, runtime.NewAPIError("unsuccessful response", value, value.Code())
	}

	// unexpected response.

	// no default response is defined.
	//
	// safeguard: normally, in the absence of a default response, unknown responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for PutExperimental: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}
