lib/api/research/research_client/company_services/company_services_client.go

173 lines
5.7 KiB
Go
Raw Normal View History

2023-05-28 16:22:37 +00:00
// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package company_services
// 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 company services API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
/*
Client for company services 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 {
DeleteCompanyService(params *DeleteCompanyServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCompanyServiceOK, error)
GetCompanyServices(params *GetCompanyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyServicesOK, error)
2023-05-29 15:13:02 +00:00
PostCompanyServices(params *PostCompanyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompanyServicesOK, error)
2023-05-28 16:22:37 +00:00
SetTransport(transport runtime.ClientTransport)
}
/*
2023-05-29 15:13:02 +00:00
DeleteCompanyService deletes a company service
2023-05-28 16:22:37 +00:00
2023-05-29 15:13:02 +00:00
Delete CompanyService record
2023-05-28 16:22:37 +00:00
*/
2023-05-29 15:13:02 +00:00
func (a *Client) DeleteCompanyService(params *DeleteCompanyServiceParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteCompanyServiceOK, error) {
2023-05-28 16:22:37 +00:00
// TODO: Validate the params before sending
if params == nil {
2023-05-29 15:13:02 +00:00
params = NewDeleteCompanyServiceParams()
2023-05-28 16:22:37 +00:00
}
op := &runtime.ClientOperation{
2023-05-29 15:13:02 +00:00
ID: "deleteCompanyService",
Method: "DELETE",
2023-05-28 16:22:37 +00:00
PathPattern: "/companyservices",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
2023-05-29 15:13:02 +00:00
Reader: &DeleteCompanyServiceReader{formats: a.formats},
2023-05-28 16:22:37 +00:00
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
2023-05-29 15:13:02 +00:00
success, ok := result.(*DeleteCompanyServiceOK)
2023-05-28 16:22:37 +00:00
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
2023-05-29 15:13:02 +00:00
msg := fmt.Sprintf("unexpected success response for deleteCompanyService: API contract not enforced by server. Client expected to get an error, but got: %T", result)
2023-05-28 16:22:37 +00:00
panic(msg)
}
/*
2023-05-29 15:13:02 +00:00
GetCompanyServices gets a list of company services
2023-05-28 16:22:37 +00:00
2023-05-29 15:13:02 +00:00
Return a list of all available CompanyServices
2023-05-28 16:22:37 +00:00
*/
2023-05-29 15:13:02 +00:00
func (a *Client) GetCompanyServices(params *GetCompanyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GetCompanyServicesOK, error) {
2023-05-28 16:22:37 +00:00
// TODO: Validate the params before sending
if params == nil {
2023-05-29 15:13:02 +00:00
params = NewGetCompanyServicesParams()
2023-05-28 16:22:37 +00:00
}
op := &runtime.ClientOperation{
2023-05-29 15:13:02 +00:00
ID: "getCompanyServices",
Method: "GET",
2023-05-28 16:22:37 +00:00
PathPattern: "/companyservices",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
2023-05-29 15:13:02 +00:00
Reader: &GetCompanyServicesReader{formats: a.formats},
2023-05-28 16:22:37 +00:00
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
2023-05-29 15:13:02 +00:00
success, ok := result.(*GetCompanyServicesOK)
2023-05-28 16:22:37 +00:00
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
2023-05-29 15:13:02 +00:00
msg := fmt.Sprintf("unexpected success response for getCompanyServices: API contract not enforced by server. Client expected to get an error, but got: %T", result)
2023-05-28 16:22:37 +00:00
panic(msg)
}
/*
2023-05-29 15:13:02 +00:00
PostCompanyServices creates a new company service
2023-05-28 16:22:37 +00:00
2023-05-29 15:13:02 +00:00
Create a new CompanyService record
2023-05-28 16:22:37 +00:00
*/
2023-05-29 15:13:02 +00:00
func (a *Client) PostCompanyServices(params *PostCompanyServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PostCompanyServicesOK, error) {
2023-05-28 16:22:37 +00:00
// TODO: Validate the params before sending
if params == nil {
2023-05-29 15:13:02 +00:00
params = NewPostCompanyServicesParams()
2023-05-28 16:22:37 +00:00
}
op := &runtime.ClientOperation{
2023-05-29 15:13:02 +00:00
ID: "postCompanyServices",
Method: "POST",
2023-05-28 16:22:37 +00:00
PathPattern: "/companyservices",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"http"},
Params: params,
2023-05-29 15:13:02 +00:00
Reader: &PostCompanyServicesReader{formats: a.formats},
2023-05-28 16:22:37 +00:00
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
2023-05-29 15:13:02 +00:00
success, ok := result.(*PostCompanyServicesOK)
2023-05-28 16:22:37 +00:00
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
2023-05-29 15:13:02 +00:00
msg := fmt.Sprintf("unexpected success response for postCompanyServices: API contract not enforced by server. Client expected to get an error, but got: %T", result)
2023-05-28 16:22:37 +00:00
panic(msg)
}
// SetTransport changes the transport on the client
func (a *Client) SetTransport(transport runtime.ClientTransport) {
a.transport = transport
}