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

package alliance

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

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

/*
GetAlliances lists all alliances

List all active player alliances

---
Alternate route: `/v1/alliances/`

Alternate route: `/legacy/alliances/`

Alternate route: `/dev/alliances/`

---
This route is cached for up to 3600 seconds
*/
func (a *Client) GetAlliances(params *GetAlliancesParams) (*GetAlliancesOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetAlliancesParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "get_alliances",
		Method:             "GET",
		PathPattern:        "/alliances/",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{""},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &GetAlliancesReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetAlliancesOK), nil

}

/*
GetAlliancesAllianceID gets alliance information

Public information about an alliance

---
Alternate route: `/v2/alliances/{alliance_id}/`

---
This route is cached for up to 3600 seconds
*/
func (a *Client) GetAlliancesAllianceID(params *GetAlliancesAllianceIDParams) (*GetAlliancesAllianceIDOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetAlliancesAllianceIDParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "get_alliances_alliance_id",
		Method:             "GET",
		PathPattern:        "/alliances/{alliance_id}/",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{""},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &GetAlliancesAllianceIDReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetAlliancesAllianceIDOK), nil

}

/*
GetAlliancesAllianceIDCorporations lists alliance s corporations

List all current member corporations of an alliance

---
Alternate route: `/v1/alliances/{alliance_id}/corporations/`

Alternate route: `/legacy/alliances/{alliance_id}/corporations/`

Alternate route: `/dev/alliances/{alliance_id}/corporations/`

---
This route is cached for up to 3600 seconds
*/
func (a *Client) GetAlliancesAllianceIDCorporations(params *GetAlliancesAllianceIDCorporationsParams) (*GetAlliancesAllianceIDCorporationsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetAlliancesAllianceIDCorporationsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "get_alliances_alliance_id_corporations",
		Method:             "GET",
		PathPattern:        "/alliances/{alliance_id}/corporations/",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{""},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &GetAlliancesAllianceIDCorporationsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetAlliancesAllianceIDCorporationsOK), nil

}

/*
GetAlliancesAllianceIDIcons gets alliance icon

Get the icon urls for a alliance

---
Alternate route: `/v1/alliances/{alliance_id}/icons/`

Alternate route: `/legacy/alliances/{alliance_id}/icons/`

Alternate route: `/dev/alliances/{alliance_id}/icons/`

---
This route is cached for up to 3600 seconds
*/
func (a *Client) GetAlliancesAllianceIDIcons(params *GetAlliancesAllianceIDIconsParams) (*GetAlliancesAllianceIDIconsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetAlliancesAllianceIDIconsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "get_alliances_alliance_id_icons",
		Method:             "GET",
		PathPattern:        "/alliances/{alliance_id}/icons/",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{""},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &GetAlliancesAllianceIDIconsReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetAlliancesAllianceIDIconsOK), nil

}

/*
GetAlliancesNames gets alliance names

Resolve a set of alliance IDs to alliance names

---
Alternate route: `/v1/alliances/names/`

Alternate route: `/legacy/alliances/names/`

---
This route is cached for up to 3600 seconds
*/
func (a *Client) GetAlliancesNames(params *GetAlliancesNamesParams) (*GetAlliancesNamesOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetAlliancesNamesParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "get_alliances_names",
		Method:             "GET",
		PathPattern:        "/alliances/names/",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{""},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &GetAlliancesNamesReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetAlliancesNamesOK), nil

}

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