Files
Andrew MartinezandGitHub 2a12985526 Fix.openziti.ziti.3356.www.authenticate.headers (#169)
* for openziti/ziti#3356 add www-authenticate headers

- adds www-authenticate headers to all responses
- moves to swagger 0.33.1
- updates readme
- updates version checking in powershell and bash
2026-02-12 13:41:23 -05:00

760 lines
26 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
//
// Copyright NetFoundry Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// __ __ _
// \ \ / / (_)
// \ \ /\ / /_ _ _ __ _ __ _ _ __ __ _
// \ \/ \/ / _` | '__| '_ \| | '_ \ / _` |
// \ /\ / (_| | | | | | | | | | | (_| | : This file is generated, do not edit it.
// \/ \/ \__,_|_| |_| |_|_|_| |_|\__, |
// __/ |
// |___/
package config
// 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"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// New creates a new config API client.
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
// New creates a new config API client with basic auth credentials.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - user: user for basic authentication header.
// - password: password for basic authentication header.
func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BasicAuth(user, password)
return &Client{transport: transport, formats: strfmt.Default}
}
// New creates a new config API client with a bearer token for authentication.
// It takes the following parameters:
// - host: http host (github.com).
// - basePath: any base path for the API client ("/v1", "/v3").
// - scheme: http scheme ("http", "https").
// - bearerToken: bearer token for Bearer authentication header.
func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService {
transport := httptransport.New(host, basePath, []string{scheme})
transport.DefaultAuthentication = httptransport.BearerToken(bearerToken)
return &Client{transport: transport, formats: strfmt.Default}
}
/*
Client for config API
*/
type Client struct {
transport runtime.ClientTransport
formats strfmt.Registry
}
// ClientOption may be used to customize the behavior of Client methods.
type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
CreateConfig(params *CreateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigCreated, error)
CreateConfigType(params *CreateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigTypeCreated, error)
DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigOK, error)
DeleteConfigType(params *DeleteConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigTypeOK, error)
DetailConfig(params *DetailConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigOK, error)
DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigTypeOK, error)
ListConfigServices(params *ListConfigServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigServicesOK, error)
ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigTypesOK, error)
ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error)
ListConfigsForConfigType(params *ListConfigsForConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsForConfigTypeOK, error)
PatchConfig(params *PatchConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigOK, error)
PatchConfigType(params *PatchConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigTypeOK, error)
UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigOK, error)
UpdateConfigType(params *UpdateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigTypeOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
CreateConfig creates a config resource
Create a config resource. Requires admin access.
*/
func (a *Client) CreateConfig(params *CreateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigCreated, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewCreateConfigParams()
}
op := &runtime.ClientOperation{
ID: "createConfig",
Method: "POST",
PathPattern: "/configs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &CreateConfigReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*CreateConfigCreated)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CreateConfigType creates a config type requires admin access
*/
func (a *Client) CreateConfigType(params *CreateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateConfigTypeCreated, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewCreateConfigTypeParams()
}
op := &runtime.ClientOperation{
ID: "createConfigType",
Method: "POST",
PathPattern: "/config-types",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &CreateConfigTypeReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*CreateConfigTypeCreated)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteConfig deletes a config
Delete a config by id. Requires admin access.
*/
func (a *Client) DeleteConfig(params *DeleteConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewDeleteConfigParams()
}
op := &runtime.ClientOperation{
ID: "deleteConfig",
Method: "DELETE",
PathPattern: "/configs/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &DeleteConfigReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*DeleteConfigOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteConfigType deletes a config type
Delete a config-type by id. Removing a configuration type that are in use will result in a 409 conflict HTTP status code and error. All configurations of a type must be removed first.
*/
func (a *Client) DeleteConfigType(params *DeleteConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteConfigTypeOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewDeleteConfigTypeParams()
}
op := &runtime.ClientOperation{
ID: "deleteConfigType",
Method: "DELETE",
PathPattern: "/config-types/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &DeleteConfigTypeReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*DeleteConfigTypeOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DetailConfig retrieves a single config
Retrieves a single config by id. Requires admin access.
*/
func (a *Client) DetailConfig(params *DetailConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewDetailConfigParams()
}
op := &runtime.ClientOperation{
ID: "detailConfig",
Method: "GET",
PathPattern: "/configs/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &DetailConfigReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*DetailConfigOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for detailConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DetailConfigType retrieves a single config type
Retrieves a single config-type by id. Requires admin access.
*/
func (a *Client) DetailConfigType(params *DetailConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailConfigTypeOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewDetailConfigTypeParams()
}
op := &runtime.ClientOperation{
ID: "detailConfigType",
Method: "GET",
PathPattern: "/config-types/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &DetailConfigTypeReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*DetailConfigTypeOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for detailConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListConfigServices lists services referenced by a config
Retrieves a list of service resources that reference a given config; supports filtering, sorting, and pagination. Requires admin access.
*/
func (a *Client) ListConfigServices(params *ListConfigServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigServicesOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewListConfigServicesParams()
}
op := &runtime.ClientOperation{
ID: "listConfigServices",
Method: "GET",
PathPattern: "/configs/{id}/services",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &ListConfigServicesReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*ListConfigServicesOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listConfigServices: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListConfigTypes lists config types
Retrieves a list of config-type resources; supports filtering, sorting, and pagination. Requires admin access.
*/
func (a *Client) ListConfigTypes(params *ListConfigTypesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigTypesOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewListConfigTypesParams()
}
op := &runtime.ClientOperation{
ID: "listConfigTypes",
Method: "GET",
PathPattern: "/config-types",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &ListConfigTypesReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*ListConfigTypesOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listConfigTypes: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListConfigs lists configs
Retrieves a list of config resources; supports filtering, sorting, and pagination. Requires admin access.
*/
func (a *Client) ListConfigs(params *ListConfigsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewListConfigsParams()
}
op := &runtime.ClientOperation{
ID: "listConfigs",
Method: "GET",
PathPattern: "/configs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &ListConfigsReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*ListConfigsOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listConfigs: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListConfigsForConfigType lists the configs of a specific config type
Lists the configs associated to a config-type. Requires admin access.
*/
func (a *Client) ListConfigsForConfigType(params *ListConfigsForConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListConfigsForConfigTypeOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewListConfigsForConfigTypeParams()
}
op := &runtime.ClientOperation{
ID: "listConfigsForConfigType",
Method: "GET",
PathPattern: "/config-types/{id}/configs",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &ListConfigsForConfigTypeReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*ListConfigsForConfigTypeOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listConfigsForConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PatchConfig updates the supplied fields on a config
Update the supplied fields on a config. Requires admin access.
*/
func (a *Client) PatchConfig(params *PatchConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewPatchConfigParams()
}
op := &runtime.ClientOperation{
ID: "patchConfig",
Method: "PATCH",
PathPattern: "/configs/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &PatchConfigReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*PatchConfigOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for patchConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
PatchConfigType updates the supplied fields on a config type
Update the supplied fields on a config-type. Requires admin access.
*/
func (a *Client) PatchConfigType(params *PatchConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchConfigTypeOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewPatchConfigTypeParams()
}
op := &runtime.ClientOperation{
ID: "patchConfigType",
Method: "PATCH",
PathPattern: "/config-types/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &PatchConfigTypeReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*PatchConfigTypeOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for patchConfigType: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateConfig updates all fields on a config
Update all fields on a config by id. Requires admin access.
*/
func (a *Client) UpdateConfig(params *UpdateConfigParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewUpdateConfigParams()
}
op := &runtime.ClientOperation{
ID: "updateConfig",
Method: "PUT",
PathPattern: "/configs/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &UpdateConfigReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*UpdateConfigOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for updateConfig: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateConfigType updates all fields on a config type
Update all fields on a config-type by id. Requires admin access.
*/
func (a *Client) UpdateConfigType(params *UpdateConfigTypeParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateConfigTypeOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewUpdateConfigTypeParams()
}
op := &runtime.ClientOperation{
ID: "updateConfigType",
Method: "PUT",
PathPattern: "/config-types/{id}",
ProducesMediaTypes: []string{"application/json"},
ConsumesMediaTypes: []string{"application/json"},
Schemes: []string{"https"},
Params: params,
Reader: &UpdateConfigTypeReader{formats: a.formats},
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
}
// only one success response has to be checked
success, ok := result.(*UpdateConfigTypeOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for updateConfigType: 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
}