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

package fittings

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

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

/*
DeleteCharactersCharacterIDFittingsFittingID deletes fitting

Delete a fitting from a character

---
Alternate route: `/v1/characters/{character_id}/fittings/{fitting_id}/`

Alternate route: `/legacy/characters/{character_id}/fittings/{fitting_id}/`

Alternate route: `/dev/characters/{character_id}/fittings/{fitting_id}/`

*/
func (a *Client) DeleteCharactersCharacterIDFittingsFittingID(params *DeleteCharactersCharacterIDFittingsFittingIDParams, authInfo runtime.ClientAuthInfoWriter) (*DeleteCharactersCharacterIDFittingsFittingIDNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDeleteCharactersCharacterIDFittingsFittingIDParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "delete_characters_character_id_fittings_fitting_id",
		Method:             "DELETE",
		PathPattern:        "/characters/{character_id}/fittings/{fitting_id}/",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{""},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &DeleteCharactersCharacterIDFittingsFittingIDReader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*DeleteCharactersCharacterIDFittingsFittingIDNoContent), nil

}

/*
GetCharactersCharacterIDFittings gets fittings

Return fittings of a character

---
Alternate route: `/v1/characters/{character_id}/fittings/`

Alternate route: `/legacy/characters/{character_id}/fittings/`

Alternate route: `/dev/characters/{character_id}/fittings/`

---
This route is cached for up to 300 seconds
*/
func (a *Client) GetCharactersCharacterIDFittings(params *GetCharactersCharacterIDFittingsParams, authInfo runtime.ClientAuthInfoWriter) (*GetCharactersCharacterIDFittingsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetCharactersCharacterIDFittingsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "get_characters_character_id_fittings",
		Method:             "GET",
		PathPattern:        "/characters/{character_id}/fittings/",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{""},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &GetCharactersCharacterIDFittingsReader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetCharactersCharacterIDFittingsOK), nil

}

/*
PostCharactersCharacterIDFittings creates fitting

Save a new fitting for a character

---
Alternate route: `/v1/characters/{character_id}/fittings/`

Alternate route: `/legacy/characters/{character_id}/fittings/`

Alternate route: `/dev/characters/{character_id}/fittings/`

*/
func (a *Client) PostCharactersCharacterIDFittings(params *PostCharactersCharacterIDFittingsParams, authInfo runtime.ClientAuthInfoWriter) (*PostCharactersCharacterIDFittingsCreated, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewPostCharactersCharacterIDFittingsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "post_characters_character_id_fittings",
		Method:             "POST",
		PathPattern:        "/characters/{character_id}/fittings/",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{""},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &PostCharactersCharacterIDFittingsReader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*PostCharactersCharacterIDFittingsCreated), nil

}

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