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

package reseller_management

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

import (
	"context"

	"github.com/go-openapi/runtime"

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

//go:generate mockery -name API -inpkg

// API is the interface of the reseller management client
type API interface {
	/*
	   AddReseller inserts a new reseller in the system*/
	AddReseller(ctx context.Context, params *AddResellerParams) (*AddResellerCreated, *AddResellerAccepted, error)
	/*
	   GetReseller returns the information about the reseller with the given id*/
	GetReseller(ctx context.Context, params *GetResellerParams) (*GetResellerOK, error)
	/*
	   ListResellers lists all the resellers in the system*/
	ListResellers(ctx context.Context, params *ListResellersParams) (*ListResellersOK, error)
	/*
	   UpdateReseller updates the information of the reseller with the given id*/
	UpdateReseller(ctx context.Context, params *UpdateResellerParams) (*UpdateResellerOK, *UpdateResellerAccepted, error)
}

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

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

/*
AddReseller inserts a new reseller in the system
*/
func (a *Client) AddReseller(ctx context.Context, params *AddResellerParams) (*AddResellerCreated, *AddResellerAccepted, error) {

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "addReseller",
		Method:             "POST",
		PathPattern:        "/reseller",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &AddResellerReader{formats: a.formats},
		AuthInfo:           a.authInfo,
		Context:            ctx,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, nil, err
	}
	switch value := result.(type) {
	case *AddResellerCreated:
		return value, nil, nil
	case *AddResellerAccepted:
		return nil, value, nil
	}
	return nil, nil, nil

}

/*
GetReseller returns the information about the reseller with the given id
*/
func (a *Client) GetReseller(ctx context.Context, params *GetResellerParams) (*GetResellerOK, error) {

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

}

/*
ListResellers lists all the resellers in the system
*/
func (a *Client) ListResellers(ctx context.Context, params *ListResellersParams) (*ListResellersOK, error) {

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

}

/*
UpdateReseller updates the information of the reseller with the given id
*/
func (a *Client) UpdateReseller(ctx context.Context, params *UpdateResellerParams) (*UpdateResellerOK, *UpdateResellerAccepted, error) {

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "updateReseller",
		Method:             "PUT",
		PathPattern:        "/reseller/{id}",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &UpdateResellerReader{formats: a.formats},
		AuthInfo:           a.authInfo,
		Context:            ctx,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, nil, err
	}
	switch value := result.(type) {
	case *UpdateResellerOK:
		return value, nil, nil
	case *UpdateResellerAccepted:
		return nil, value, nil
	}
	return nil, nil, nil

}
