lib/api/geo/geo_client/coordinate/coordinate_client.go

259 lines
9.0 KiB
Go
Raw Normal View History

2021-01-08 17:40:28 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-01-19 16:58:40 +00:00
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
2021-01-08 17:40:28 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package coordinate
// 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 coordinate API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for coordinate API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
2021-02-09 16:56:57 +00:00
// ClientOption is the option for Client methods
type ClientOption func(*runtime.ClientOperation)
2021-01-08 17:40:28 +00:00
// ClientService is the interface for Client methods
type ClientService interface {
2021-02-09 16:56:57 +00:00
DeleteCoordinate(params *DeleteCoordinateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCoordinateOK, error)
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
GetCoordinateBasic(params *GetCoordinateBasicParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCoordinateBasicOK, error)
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
GetCoordinateObservable(params *GetCoordinateObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCoordinateObservableOK, error)
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
GetCoordinates(params *GetCoordinatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCoordinatesOK, error)
2021-01-08 17:40:28 +00:00
2021-02-09 16:56:57 +00:00
PostCoordinates(params *PostCoordinatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCoordinatesOK, error)
2021-01-08 17:40:28 +00:00
SetTransport(transport runtime.ClientTransport)
}
/*
DeleteCoordinate deletes a coordinate
Delete a Taxneuxs Coordinate record from the Coordinate database
*/
2021-02-09 16:56:57 +00:00
func (a *Client) DeleteCoordinate(params *DeleteCoordinateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCoordinateOK, error) {
2021-01-08 17:40:28 +00:00
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteCoordinateParams()
}
2021-02-09 16:56:57 +00:00
op := &runtime.ClientOperation{
2021-01-08 17:40:28 +00:00
ID: "deleteCoordinate",
Method: "DELETE",
PathPattern: "/coordinates",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &DeleteCoordinateReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
2021-02-09 16:56:57 +00:00
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
2021-01-08 17:40:28 +00:00
if err != nil {
return nil, err
}
success, ok := result.(*DeleteCoordinateOK)
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 deleteCoordinate: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetCoordinateBasic gets a single taxnexus coordinate from address information
Response is one minimized Coordinate record including Tax Type IDs
*/
2021-02-09 16:56:57 +00:00
func (a *Client) GetCoordinateBasic(params *GetCoordinateBasicParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCoordinateBasicOK, error) {
2021-01-08 17:40:28 +00:00
// TODO: Validate the params before sending
if params == nil {
params = NewGetCoordinateBasicParams()
}
2021-02-09 16:56:57 +00:00
op := &runtime.ClientOperation{
2021-01-08 17:40:28 +00:00
ID: "getCoordinateBasic",
Method: "GET",
PathPattern: "/coordinates/basic",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetCoordinateBasicReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
2021-02-09 16:56:57 +00:00
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
2021-01-08 17:40:28 +00:00
if err != nil {
return nil, err
}
success, ok := result.(*GetCoordinateBasicOK)
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 getCoordinateBasic: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetCoordinateObservable gets a single taxnexus coordinate as an observable array
Response is one minimized Coordinate record including Tax Type IDs as an observable array
*/
2021-02-09 16:56:57 +00:00
func (a *Client) GetCoordinateObservable(params *GetCoordinateObservableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCoordinateObservableOK, error) {
2021-01-08 17:40:28 +00:00
// TODO: Validate the params before sending
if params == nil {
params = NewGetCoordinateObservableParams()
}
2021-02-09 16:56:57 +00:00
op := &runtime.ClientOperation{
2021-01-08 17:40:28 +00:00
ID: "getCoordinateObservable",
Method: "GET",
PathPattern: "/coordinates/observable",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetCoordinateObservableReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
2021-02-09 16:56:57 +00:00
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
2021-01-08 17:40:28 +00:00
if err != nil {
return nil, err
}
success, ok := result.(*GetCoordinateObservableOK)
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 getCoordinateObservable: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
GetCoordinates gets a single taxnexus coordinate from address information
Return a fully-populated Coordinate record including Tax Type array
*/
2021-02-09 16:56:57 +00:00
func (a *Client) GetCoordinates(params *GetCoordinatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCoordinatesOK, error) {
2021-01-08 17:40:28 +00:00
// TODO: Validate the params before sending
if params == nil {
params = NewGetCoordinatesParams()
}
2021-02-09 16:56:57 +00:00
op := &runtime.ClientOperation{
2021-01-08 17:40:28 +00:00
ID: "getCoordinates",
Method: "GET",
PathPattern: "/coordinates",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &GetCoordinatesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
2021-02-09 16:56:57 +00:00
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
2021-01-08 17:40:28 +00:00
if err != nil {
return nil, err
}
success, ok := result.(*GetCoordinatesOK)
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 getCoordinates: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PostCoordinates processes a batch of coordinate g e t requests
Processes a batch of Coordinate GET requests and returns an array of Coordinate records including Tax Type IDs
*/
2021-02-09 16:56:57 +00:00
func (a *Client) PostCoordinates(params *PostCoordinatesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCoordinatesOK, error) {
2021-01-08 17:40:28 +00:00
// TODO: Validate the params before sending
if params == nil {
params = NewPostCoordinatesParams()
}
2021-02-09 16:56:57 +00:00
op := &runtime.ClientOperation{
2021-01-08 17:40:28 +00:00
ID: "postCoordinates",
Method: "POST",
PathPattern: "/coordinates",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
Reader: &PostCoordinatesReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
2021-02-09 16:56:57 +00:00
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
2021-01-08 17:40:28 +00:00
if err != nil {
return nil, err
}
success, ok := result.(*PostCoordinatesOK)
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 postCoordinates: 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
}