mirror of
https://github.com/hanzozt/edge-api.git
synced 2026-10-30 14:44:05 +00:00
* 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
624 lines
23 KiB
Go
624 lines
23 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 edge_router
|
|
|
|
// 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 edge router API client.
|
|
func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
|
|
return &Client{transport: transport, formats: formats}
|
|
}
|
|
|
|
// New creates a new edge router 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 edge router 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 edge router 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 {
|
|
CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterCreated, error)
|
|
|
|
DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterOK, error)
|
|
|
|
DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterOK, error)
|
|
|
|
ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterEdgeRouterPoliciesOK, error)
|
|
|
|
ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterIdentitiesOK, error)
|
|
|
|
ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServiceEdgeRouterPoliciesOK, error)
|
|
|
|
ListEdgeRouterServices(params *ListEdgeRouterServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServicesOK, error)
|
|
|
|
ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRoutersOK, error)
|
|
|
|
PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterOK, error)
|
|
|
|
ReEnrollEdgeRouter(params *ReEnrollEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReEnrollEdgeRouterOK, error)
|
|
|
|
UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterOK, error)
|
|
|
|
SetTransport(transport runtime.ClientTransport)
|
|
}
|
|
|
|
/*
|
|
CreateEdgeRouter creates an edge router
|
|
|
|
Create a edge router resource. Requires admin access.
|
|
*/
|
|
func (a *Client) CreateEdgeRouter(params *CreateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateEdgeRouterCreated, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewCreateEdgeRouterParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "createEdgeRouter",
|
|
Method: "POST",
|
|
PathPattern: "/edge-routers",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &CreateEdgeRouterReader{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.(*CreateEdgeRouterCreated)
|
|
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 createEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
DeleteEdgeRouter deletes an edge router
|
|
|
|
Delete an edge router by id. Requires admin access.
|
|
*/
|
|
func (a *Client) DeleteEdgeRouter(params *DeleteEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteEdgeRouterOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewDeleteEdgeRouterParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "deleteEdgeRouter",
|
|
Method: "DELETE",
|
|
PathPattern: "/edge-routers/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &DeleteEdgeRouterReader{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.(*DeleteEdgeRouterOK)
|
|
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 deleteEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
DetailEdgeRouter retrieves a single edge router
|
|
|
|
Retrieves a single edge router by id. Requires admin access.
|
|
*/
|
|
func (a *Client) DetailEdgeRouter(params *DetailEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DetailEdgeRouterOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewDetailEdgeRouterParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "detailEdgeRouter",
|
|
Method: "GET",
|
|
PathPattern: "/edge-routers/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &DetailEdgeRouterReader{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.(*DetailEdgeRouterOK)
|
|
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 detailEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ListEdgeRouterEdgeRouterPolicies lists the edge router policies that affect an edge router
|
|
|
|
Retrieves a list of edge router policies that apply to the specified edge router.
|
|
*/
|
|
func (a *Client) ListEdgeRouterEdgeRouterPolicies(params *ListEdgeRouterEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterEdgeRouterPoliciesOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewListEdgeRouterEdgeRouterPoliciesParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "listEdgeRouterEdgeRouterPolicies",
|
|
Method: "GET",
|
|
PathPattern: "/edge-routers/{id}/edge-router-policies",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListEdgeRouterEdgeRouterPoliciesReader{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.(*ListEdgeRouterEdgeRouterPoliciesOK)
|
|
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 listEdgeRouterEdgeRouterPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ListEdgeRouterIdentities lists associated identities
|
|
|
|
Retrieves a list of identities that may access services via the given edge router. Supports filtering, sorting, and pagination. Requires admin access.
|
|
*/
|
|
func (a *Client) ListEdgeRouterIdentities(params *ListEdgeRouterIdentitiesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterIdentitiesOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewListEdgeRouterIdentitiesParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "listEdgeRouterIdentities",
|
|
Method: "GET",
|
|
PathPattern: "/edge-routers/{id}/identities",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListEdgeRouterIdentitiesReader{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.(*ListEdgeRouterIdentitiesOK)
|
|
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 listEdgeRouterIdentities: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ListEdgeRouterServiceEdgeRouterPolicies lists the service policies that affect an edge router
|
|
|
|
Retrieves a list of service policies policies that apply to the specified edge router.
|
|
*/
|
|
func (a *Client) ListEdgeRouterServiceEdgeRouterPolicies(params *ListEdgeRouterServiceEdgeRouterPoliciesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServiceEdgeRouterPoliciesOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewListEdgeRouterServiceEdgeRouterPoliciesParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "listEdgeRouterServiceEdgeRouterPolicies",
|
|
Method: "GET",
|
|
PathPattern: "/edge-routers/{id}/service-edge-router-policies",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListEdgeRouterServiceEdgeRouterPoliciesReader{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.(*ListEdgeRouterServiceEdgeRouterPoliciesOK)
|
|
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 listEdgeRouterServiceEdgeRouterPolicies: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ListEdgeRouterServices lists associated services
|
|
|
|
Retrieves a list of services that may be accessed via the given edge router. Supports filtering, sorting, and pagination. Requires admin access.
|
|
*/
|
|
func (a *Client) ListEdgeRouterServices(params *ListEdgeRouterServicesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRouterServicesOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewListEdgeRouterServicesParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "listEdgeRouterServices",
|
|
Method: "GET",
|
|
PathPattern: "/edge-routers/{id}/services",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListEdgeRouterServicesReader{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.(*ListEdgeRouterServicesOK)
|
|
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 listEdgeRouterServices: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ListEdgeRouters lists edge routers
|
|
|
|
Retrieves a list of edge router resources; supports filtering, sorting, and pagination. Requires admin access.
|
|
*/
|
|
func (a *Client) ListEdgeRouters(params *ListEdgeRoutersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListEdgeRoutersOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewListEdgeRoutersParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "listEdgeRouters",
|
|
Method: "GET",
|
|
PathPattern: "/edge-routers",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ListEdgeRoutersReader{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.(*ListEdgeRoutersOK)
|
|
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 listEdgeRouters: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
PatchEdgeRouter updates the supplied fields on an edge router
|
|
|
|
Update the supplied fields on an edge router. Requires admin access.
|
|
*/
|
|
func (a *Client) PatchEdgeRouter(params *PatchEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*PatchEdgeRouterOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewPatchEdgeRouterParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "patchEdgeRouter",
|
|
Method: "PATCH",
|
|
PathPattern: "/edge-routers/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &PatchEdgeRouterReader{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.(*PatchEdgeRouterOK)
|
|
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 patchEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
ReEnrollEdgeRouter res enroll an edge router
|
|
|
|
Removes current certificate based authentication mechanisms and reverts the edge router into a state where enrollment must be performed.
|
|
|
|
The router retains all other properties and associations. If the router is currently connected, it will be disconnected and any
|
|
attemps to reconnect will fail until the enrollment process is completed with the newly generated JWT.
|
|
|
|
If the edge router has an existing outstanding enrollment JWT it will be replaced. The previous JWT will no longer be usable to
|
|
complete the enrollment process.
|
|
*/
|
|
func (a *Client) ReEnrollEdgeRouter(params *ReEnrollEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ReEnrollEdgeRouterOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewReEnrollEdgeRouterParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "reEnrollEdgeRouter",
|
|
Method: "POST",
|
|
PathPattern: "/edge-routers/{id}/re-enroll",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &ReEnrollEdgeRouterReader{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.(*ReEnrollEdgeRouterOK)
|
|
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 reEnrollEdgeRouter: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
|
panic(msg)
|
|
}
|
|
|
|
/*
|
|
UpdateEdgeRouter updates all fields on an edge router
|
|
|
|
Update all fields on an edge router by id. Requires admin access.
|
|
*/
|
|
func (a *Client) UpdateEdgeRouter(params *UpdateEdgeRouterParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateEdgeRouterOK, error) {
|
|
// NOTE: parameters are not validated before sending
|
|
if params == nil {
|
|
params = NewUpdateEdgeRouterParams()
|
|
}
|
|
op := &runtime.ClientOperation{
|
|
ID: "updateEdgeRouter",
|
|
Method: "PUT",
|
|
PathPattern: "/edge-routers/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"https"},
|
|
Params: params,
|
|
Reader: &UpdateEdgeRouterReader{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.(*UpdateEdgeRouterOK)
|
|
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 updateEdgeRouter: 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
|
|
}
|