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

package manage_i_q_server_configuration

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

import (
	"fmt"

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

// New creates a new manage i q server configuration API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
	return &Client{transport: transport, formats: formats}
}

/*
Client for manage i q server configuration API
*/
type Client struct {
	transport runtime.ClientTransport
	formats   strfmt.Registry
}

// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)

// ClientService is the interface for Client methods
type ClientService interface {
	DisableIq(params *DisableIqParams, opts ...ClientOption) (*DisableIqNoContent, error)

	EnableIq(params *EnableIqParams, opts ...ClientOption) (*EnableIqNoContent, error)

	GetConfiguration(params *GetConfigurationParams, opts ...ClientOption) (*GetConfigurationOK, error)

	UpdateConfiguration(params *UpdateConfigurationParams, opts ...ClientOption) (*UpdateConfigurationNoContent, error)

	VerifyConnection(params *VerifyConnectionParams, opts ...ClientOption) (*VerifyConnectionOK, error)

	SetTransport(transport runtime.ClientTransport)
}

/*
DisableIq disables i q server
*/
func (a *Client) DisableIq(params *DisableIqParams, opts ...ClientOption) (*DisableIqNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewDisableIqParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "disableIq",
		Method:             "POST",
		PathPattern:        "/v1/iq/disable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &DisableIqReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*DisableIqNoContent)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for disableIq: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
EnableIq enables i q server
*/
func (a *Client) EnableIq(params *EnableIqParams, opts ...ClientOption) (*EnableIqNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewEnableIqParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "enableIq",
		Method:             "POST",
		PathPattern:        "/v1/iq/enable",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &EnableIqReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*EnableIqNoContent)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for enableIq: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
GetConfiguration gets i q server configuration
*/
func (a *Client) GetConfiguration(params *GetConfigurationParams, opts ...ClientOption) (*GetConfigurationOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetConfigurationParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "getConfiguration",
		Method:             "GET",
		PathPattern:        "/v1/iq",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &GetConfigurationReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*GetConfigurationOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for getConfiguration: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
UpdateConfiguration updates i q server configuration
*/
func (a *Client) UpdateConfiguration(params *UpdateConfigurationParams, opts ...ClientOption) (*UpdateConfigurationNoContent, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewUpdateConfigurationParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "updateConfiguration",
		Method:             "PUT",
		PathPattern:        "/v1/iq",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &UpdateConfigurationReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*UpdateConfigurationNoContent)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for updateConfiguration: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

/*
VerifyConnection verifies i q server connection
*/
func (a *Client) VerifyConnection(params *VerifyConnectionParams, opts ...ClientOption) (*VerifyConnectionOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewVerifyConnectionParams()
	}
	op := &runtime.ClientOperation{
		ID:                 "verifyConnection",
		Method:             "POST",
		PathPattern:        "/v1/iq/verify-connection",
		ProducesMediaTypes: []string{"application/json"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http"},
		Params:             params,
		Reader:             &VerifyConnectionReader{formats: a.formats},
		Context:            params.Context,
		Client:             params.HTTPClient,
	}
	for _, opt := range opts {
		opt(op)
	}

	result, err := a.transport.Submit(op)
	if err != nil {
		return nil, err
	}
	success, ok := result.(*VerifyConnectionOK)
	if ok {
		return success, nil
	}
	// unexpected success response
	// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
	msg := fmt.Sprintf("unexpected success response for verifyConnection: API contract not enforced by server. Client expected to get an error, but got: %T", result)
	panic(msg)
}

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