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

package operations

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

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

/*
PurgeConfiguration purge configuration API
*/
func (a *Client) PurgeConfiguration(params *PurgeConfigurationParams, authInfo runtime.ClientAuthInfoWriter) (*PurgeConfigurationNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewPurgeConfigurationParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "PurgeConfiguration",
		Method:             "POST",
		PathPattern:        "/configuration-entries/purge",
		ProducesMediaTypes: []string{"application/xml"},
		ConsumesMediaTypes: []string{"application/xml"},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &PurgeConfigurationReader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*PurgeConfigurationNoContent), nil

}

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

/*
GetCsrfToken Retrieves a csrf-token header

*/
func (a *Client) GetCsrfToken(params *GetCsrfTokenParams, authInfo runtime.ClientAuthInfoWriter) (*GetCsrfTokenNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetCsrfTokenParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "getCsrfToken",
		Method:             "GET",
		PathPattern:        "/csrf-token",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"https"},
		Params:             params,
		Reader:             &GetCsrfTokenReader{formats: a.formats},
		AuthInfo:           authInfo,
		Context:            params.Context,
		Client:             params.HTTPClient,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetCsrfTokenNoContent), nil

}
