mirror of https://github.com/vernonkeenan/lib
444 lines
14 KiB
Go
444 lines
14 KiB
Go
// 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 cors
|
|
|
|
// 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 cors API client.
|
|
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
|
return &Client{transport: transport, formats: formats}
|
|
}
|
|
|
|
/*
|
|
Client for cors 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 {
|
|
ClusterOptions(params *ClusterOptionsParams, opts ...ClientOption) (*ClusterOptionsOK, error)
|
|
|
|
ClustersOptions(params *ClustersOptionsParams, opts ...ClientOption) (*ClustersOptionsOK, error)
|
|
|
|
DatabaseOptions(params *DatabaseOptionsParams, opts ...ClientOption) (*DatabaseOptionsOK, error)
|
|
|
|
DatabasesOptions(params *DatabasesOptionsParams, opts ...ClientOption) (*DatabasesOptionsOK, error)
|
|
|
|
TemplateOptions(params *TemplateOptionsParams, opts ...ClientOption) (*TemplateOptionsOK, error)
|
|
|
|
TemplatesOptions(params *TemplatesOptionsParams, opts ...ClientOption) (*TemplatesOptionsOK, error)
|
|
|
|
TenantOptions(params *TenantOptionsParams, opts ...ClientOption) (*TenantOptionsOK, error)
|
|
|
|
TenantsOptions(params *TenantsOptionsParams, opts ...ClientOption) (*TenantsOptionsOK, error)
|
|
|
|
UserOptions(params *UserOptionsParams, opts ...ClientOption) (*UserOptionsOK, error)
|
|
|
|
UsersOptions(params *UsersOptionsParams, opts ...ClientOption) (*UsersOptionsOK, error)
|
|
|
|
SetTransport(transport runtime.ClientTransport)
|
|
}
|
|
|
|
/*
|
|
ClusterOptions CORS support
|
|
*/
|
|
func (a *Client) ClusterOptions(params *ClusterOptionsParams, opts ...ClientOption) (*ClusterOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewClusterOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "clusterOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/clusters/observable",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &ClusterOptionsReader{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.(*ClusterOptionsOK)
|
|
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 clusterOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ClustersOptions CORS support
|
|
*/
|
|
func (a *Client) ClustersOptions(params *ClustersOptionsParams, opts ...ClientOption) (*ClustersOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewClustersOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "clustersOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/clusters",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &ClustersOptionsReader{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.(*ClustersOptionsOK)
|
|
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 clustersOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
DatabaseOptions CORS support
|
|
*/
|
|
func (a *Client) DatabaseOptions(params *DatabaseOptionsParams, opts ...ClientOption) (*DatabaseOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewDatabaseOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "databaseOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/databases/observable",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &DatabaseOptionsReader{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.(*DatabaseOptionsOK)
|
|
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 databaseOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
DatabasesOptions CORS support
|
|
*/
|
|
func (a *Client) DatabasesOptions(params *DatabasesOptionsParams, opts ...ClientOption) (*DatabasesOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewDatabasesOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "databasesOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/databases",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &DatabasesOptionsReader{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.(*DatabasesOptionsOK)
|
|
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 databasesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
TemplateOptions CORS support
|
|
*/
|
|
func (a *Client) TemplateOptions(params *TemplateOptionsParams, opts ...ClientOption) (*TemplateOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewTemplateOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "templateOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/templates/observable",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &TemplateOptionsReader{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.(*TemplateOptionsOK)
|
|
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 templateOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
TemplatesOptions CORS support
|
|
*/
|
|
func (a *Client) TemplatesOptions(params *TemplatesOptionsParams, opts ...ClientOption) (*TemplatesOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewTemplatesOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "templatesOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/templates",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &TemplatesOptionsReader{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.(*TemplatesOptionsOK)
|
|
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 templatesOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
TenantOptions CORS support
|
|
*/
|
|
func (a *Client) TenantOptions(params *TenantOptionsParams, opts ...ClientOption) (*TenantOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewTenantOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "tenantOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/tenants/observable",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &TenantOptionsReader{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.(*TenantOptionsOK)
|
|
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 tenantOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
TenantsOptions CORS support
|
|
*/
|
|
func (a *Client) TenantsOptions(params *TenantsOptionsParams, opts ...ClientOption) (*TenantsOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewTenantsOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "tenantsOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/tenants",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &TenantsOptionsReader{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.(*TenantsOptionsOK)
|
|
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 tenantsOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
UserOptions CORS support
|
|
*/
|
|
func (a *Client) UserOptions(params *UserOptionsParams, opts ...ClientOption) (*UserOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewUserOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "userOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/users/observable",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &UserOptionsReader{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.(*UserOptionsOK)
|
|
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 userOptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
UsersOptions CORS support
|
|
*/
|
|
func (a *Client) UsersOptions(params *UsersOptionsParams, opts ...ClientOption) (*UsersOptionsOK, error) {
|
|
// TODO: Validate the params before sending
|
|
if params == nil {
|
|
params = NewUsersOptionsParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "usersOptions",
|
|
Method: "OPTIONS",
|
|
PathPattern: "/users",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http"},
|
|
Params: params,
|
|
Reader: &UsersOptionsReader{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.(*UsersOptionsOK)
|
|
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 usersOptions: 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
|
|
}
|