Files
zeekay b7d8ccb10f rebrand: openziti → hanzozt (Hanzo Zero Trust)
Global rebrand of all OpenZiti references to Hanzo ZT:
- Go module paths: github.com/openziti/* → github.com/hanzozt/*
- Docker images: openziti/* → hanzozt/*
- Java packages: org.openziti.* → org.hanzozt.*
- Brand: OpenZiti → Hanzo ZT
- URLs: openziti.io → hanzozt.dev
2026-02-18 16:13:41 -08:00

862 lines
24 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 enroll
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
stderrors "errors"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/hanzozt/edge-api/rest_model"
)
// EnrollReader is a Reader for the Enroll structure.
type EnrollReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *EnrollReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
switch response.Code() {
case 200:
result := NewEnrollOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 400:
result := NewEnrollBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewEnrollNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 409:
result := NewEnrollConflict()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 410:
result := NewEnrollGone()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 429:
result := NewEnrollTooManyRequests()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 503:
result := NewEnrollServiceUnavailable()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /enroll] enroll", response, response.Code())
}
}
// NewEnrollOK creates a EnrollOK with default headers values
func NewEnrollOK() *EnrollOK {
return &EnrollOK{}
}
/*
EnrollOK describes a response with status code 200, with default header values.
A response containing and identities client certificate chains
*/
type EnrollOK struct {
/* Denotes different type of security token related information
*/
WWWAuthenticate []string
Payload *rest_model.EnrollmentCertsEnvelope
}
// IsSuccess returns true when this enroll o k response has a 2xx status code
func (o *EnrollOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this enroll o k response has a 3xx status code
func (o *EnrollOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this enroll o k response has a 4xx status code
func (o *EnrollOK) IsClientError() bool {
return false
}
// IsServerError returns true when this enroll o k response has a 5xx status code
func (o *EnrollOK) IsServerError() bool {
return false
}
// IsCode returns true when this enroll o k response a status code equal to that given
func (o *EnrollOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the enroll o k response
func (o *EnrollOK) Code() int {
return 200
}
func (o *EnrollOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollOK %s", 200, payload)
}
func (o *EnrollOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollOK %s", 200, payload)
}
func (o *EnrollOK) GetPayload() *rest_model.EnrollmentCertsEnvelope {
return o.Payload
}
func (o *EnrollOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header WWW-Authenticate
hdrWWWAuthenticate := response.GetHeader("WWW-Authenticate")
if hdrWWWAuthenticate != "" {
// binding header items for WWW-Authenticate
valWWWAuthenticate, err := o.bindHeaderWWWAuthenticate(hdrWWWAuthenticate, formats)
if err != nil {
return err
}
o.WWWAuthenticate = valWWWAuthenticate
}
o.Payload = new(rest_model.EnrollmentCertsEnvelope)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// bindHeaderEnrollOK binds the response header WWW-Authenticate
func (o *EnrollOK) bindHeaderWWWAuthenticate(hdr string, formats strfmt.Registry) ([]string, error) {
wWWAuthenticateIV := hdr
var (
wWWAuthenticateIC []string
)
// items.CollectionFormat: ""
wWWAuthenticateIR := swag.SplitByFormat(wWWAuthenticateIV, "")
for _, wWWAuthenticateIIV := range wWWAuthenticateIR {
// convert split string to string
wWWAuthenticateIIC := wWWAuthenticateIIV // string as string
wWWAuthenticateIC = append(wWWAuthenticateIC, wWWAuthenticateIIC) // roll-up string into []string
}
return wWWAuthenticateIC, nil
}
// NewEnrollBadRequest creates a EnrollBadRequest with default headers values
func NewEnrollBadRequest() *EnrollBadRequest {
return &EnrollBadRequest{}
}
/*
EnrollBadRequest describes a response with status code 400, with default header values.
The supplied request contains invalid fields or could not be parsed (json and non-json bodies). The error's code, message, and cause fields can be inspected for further information
*/
type EnrollBadRequest struct {
/* Denotes different type of security token related information
*/
WWWAuthenticate []string
Payload *rest_model.APIErrorEnvelope
}
// IsSuccess returns true when this enroll bad request response has a 2xx status code
func (o *EnrollBadRequest) IsSuccess() bool {
return false
}
// IsRedirect returns true when this enroll bad request response has a 3xx status code
func (o *EnrollBadRequest) IsRedirect() bool {
return false
}
// IsClientError returns true when this enroll bad request response has a 4xx status code
func (o *EnrollBadRequest) IsClientError() bool {
return true
}
// IsServerError returns true when this enroll bad request response has a 5xx status code
func (o *EnrollBadRequest) IsServerError() bool {
return false
}
// IsCode returns true when this enroll bad request response a status code equal to that given
func (o *EnrollBadRequest) IsCode(code int) bool {
return code == 400
}
// Code gets the status code for the enroll bad request response
func (o *EnrollBadRequest) Code() int {
return 400
}
func (o *EnrollBadRequest) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollBadRequest %s", 400, payload)
}
func (o *EnrollBadRequest) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollBadRequest %s", 400, payload)
}
func (o *EnrollBadRequest) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *EnrollBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header WWW-Authenticate
hdrWWWAuthenticate := response.GetHeader("WWW-Authenticate")
if hdrWWWAuthenticate != "" {
// binding header items for WWW-Authenticate
valWWWAuthenticate, err := o.bindHeaderWWWAuthenticate(hdrWWWAuthenticate, formats)
if err != nil {
return err
}
o.WWWAuthenticate = valWWWAuthenticate
}
o.Payload = new(rest_model.APIErrorEnvelope)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// bindHeaderEnrollBadRequest binds the response header WWW-Authenticate
func (o *EnrollBadRequest) bindHeaderWWWAuthenticate(hdr string, formats strfmt.Registry) ([]string, error) {
wWWAuthenticateIV := hdr
var (
wWWAuthenticateIC []string
)
// items.CollectionFormat: ""
wWWAuthenticateIR := swag.SplitByFormat(wWWAuthenticateIV, "")
for _, wWWAuthenticateIIV := range wWWAuthenticateIR {
// convert split string to string
wWWAuthenticateIIC := wWWAuthenticateIIV // string as string
wWWAuthenticateIC = append(wWWAuthenticateIC, wWWAuthenticateIIC) // roll-up string into []string
}
return wWWAuthenticateIC, nil
}
// NewEnrollNotFound creates a EnrollNotFound with default headers values
func NewEnrollNotFound() *EnrollNotFound {
return &EnrollNotFound{}
}
/*
EnrollNotFound describes a response with status code 404, with default header values.
The requested resource does not exist
*/
type EnrollNotFound struct {
/* Denotes different type of security token related information
*/
WWWAuthenticate []string
Payload *rest_model.APIErrorEnvelope
}
// IsSuccess returns true when this enroll not found response has a 2xx status code
func (o *EnrollNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this enroll not found response has a 3xx status code
func (o *EnrollNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this enroll not found response has a 4xx status code
func (o *EnrollNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this enroll not found response has a 5xx status code
func (o *EnrollNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this enroll not found response a status code equal to that given
func (o *EnrollNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the enroll not found response
func (o *EnrollNotFound) Code() int {
return 404
}
func (o *EnrollNotFound) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollNotFound %s", 404, payload)
}
func (o *EnrollNotFound) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollNotFound %s", 404, payload)
}
func (o *EnrollNotFound) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *EnrollNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header WWW-Authenticate
hdrWWWAuthenticate := response.GetHeader("WWW-Authenticate")
if hdrWWWAuthenticate != "" {
// binding header items for WWW-Authenticate
valWWWAuthenticate, err := o.bindHeaderWWWAuthenticate(hdrWWWAuthenticate, formats)
if err != nil {
return err
}
o.WWWAuthenticate = valWWWAuthenticate
}
o.Payload = new(rest_model.APIErrorEnvelope)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// bindHeaderEnrollNotFound binds the response header WWW-Authenticate
func (o *EnrollNotFound) bindHeaderWWWAuthenticate(hdr string, formats strfmt.Registry) ([]string, error) {
wWWAuthenticateIV := hdr
var (
wWWAuthenticateIC []string
)
// items.CollectionFormat: ""
wWWAuthenticateIR := swag.SplitByFormat(wWWAuthenticateIV, "")
for _, wWWAuthenticateIIV := range wWWAuthenticateIR {
// convert split string to string
wWWAuthenticateIIC := wWWAuthenticateIIV // string as string
wWWAuthenticateIC = append(wWWAuthenticateIC, wWWAuthenticateIIC) // roll-up string into []string
}
return wWWAuthenticateIC, nil
}
// NewEnrollConflict creates a EnrollConflict with default headers values
func NewEnrollConflict() *EnrollConflict {
return &EnrollConflict{}
}
/*
EnrollConflict describes a response with status code 409, with default header values.
The request could not be completed due to a conflict of configuration or state
*/
type EnrollConflict struct {
/* Denotes different type of security token related information
*/
WWWAuthenticate []string
Payload *rest_model.APIErrorEnvelope
}
// IsSuccess returns true when this enroll conflict response has a 2xx status code
func (o *EnrollConflict) IsSuccess() bool {
return false
}
// IsRedirect returns true when this enroll conflict response has a 3xx status code
func (o *EnrollConflict) IsRedirect() bool {
return false
}
// IsClientError returns true when this enroll conflict response has a 4xx status code
func (o *EnrollConflict) IsClientError() bool {
return true
}
// IsServerError returns true when this enroll conflict response has a 5xx status code
func (o *EnrollConflict) IsServerError() bool {
return false
}
// IsCode returns true when this enroll conflict response a status code equal to that given
func (o *EnrollConflict) IsCode(code int) bool {
return code == 409
}
// Code gets the status code for the enroll conflict response
func (o *EnrollConflict) Code() int {
return 409
}
func (o *EnrollConflict) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollConflict %s", 409, payload)
}
func (o *EnrollConflict) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollConflict %s", 409, payload)
}
func (o *EnrollConflict) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *EnrollConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header WWW-Authenticate
hdrWWWAuthenticate := response.GetHeader("WWW-Authenticate")
if hdrWWWAuthenticate != "" {
// binding header items for WWW-Authenticate
valWWWAuthenticate, err := o.bindHeaderWWWAuthenticate(hdrWWWAuthenticate, formats)
if err != nil {
return err
}
o.WWWAuthenticate = valWWWAuthenticate
}
o.Payload = new(rest_model.APIErrorEnvelope)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// bindHeaderEnrollConflict binds the response header WWW-Authenticate
func (o *EnrollConflict) bindHeaderWWWAuthenticate(hdr string, formats strfmt.Registry) ([]string, error) {
wWWAuthenticateIV := hdr
var (
wWWAuthenticateIC []string
)
// items.CollectionFormat: ""
wWWAuthenticateIR := swag.SplitByFormat(wWWAuthenticateIV, "")
for _, wWWAuthenticateIIV := range wWWAuthenticateIR {
// convert split string to string
wWWAuthenticateIIC := wWWAuthenticateIIV // string as string
wWWAuthenticateIC = append(wWWAuthenticateIC, wWWAuthenticateIIC) // roll-up string into []string
}
return wWWAuthenticateIC, nil
}
// NewEnrollGone creates a EnrollGone with default headers values
func NewEnrollGone() *EnrollGone {
return &EnrollGone{}
}
/*
EnrollGone describes a response with status code 410, with default header values.
The request could not be completed as the resource is no longer available
*/
type EnrollGone struct {
/* Denotes different type of security token related information
*/
WWWAuthenticate []string
Payload *rest_model.APIErrorEnvelope
}
// IsSuccess returns true when this enroll gone response has a 2xx status code
func (o *EnrollGone) IsSuccess() bool {
return false
}
// IsRedirect returns true when this enroll gone response has a 3xx status code
func (o *EnrollGone) IsRedirect() bool {
return false
}
// IsClientError returns true when this enroll gone response has a 4xx status code
func (o *EnrollGone) IsClientError() bool {
return true
}
// IsServerError returns true when this enroll gone response has a 5xx status code
func (o *EnrollGone) IsServerError() bool {
return false
}
// IsCode returns true when this enroll gone response a status code equal to that given
func (o *EnrollGone) IsCode(code int) bool {
return code == 410
}
// Code gets the status code for the enroll gone response
func (o *EnrollGone) Code() int {
return 410
}
func (o *EnrollGone) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollGone %s", 410, payload)
}
func (o *EnrollGone) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollGone %s", 410, payload)
}
func (o *EnrollGone) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *EnrollGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header WWW-Authenticate
hdrWWWAuthenticate := response.GetHeader("WWW-Authenticate")
if hdrWWWAuthenticate != "" {
// binding header items for WWW-Authenticate
valWWWAuthenticate, err := o.bindHeaderWWWAuthenticate(hdrWWWAuthenticate, formats)
if err != nil {
return err
}
o.WWWAuthenticate = valWWWAuthenticate
}
o.Payload = new(rest_model.APIErrorEnvelope)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// bindHeaderEnrollGone binds the response header WWW-Authenticate
func (o *EnrollGone) bindHeaderWWWAuthenticate(hdr string, formats strfmt.Registry) ([]string, error) {
wWWAuthenticateIV := hdr
var (
wWWAuthenticateIC []string
)
// items.CollectionFormat: ""
wWWAuthenticateIR := swag.SplitByFormat(wWWAuthenticateIV, "")
for _, wWWAuthenticateIIV := range wWWAuthenticateIR {
// convert split string to string
wWWAuthenticateIIC := wWWAuthenticateIIV // string as string
wWWAuthenticateIC = append(wWWAuthenticateIC, wWWAuthenticateIIC) // roll-up string into []string
}
return wWWAuthenticateIC, nil
}
// NewEnrollTooManyRequests creates a EnrollTooManyRequests with default headers values
func NewEnrollTooManyRequests() *EnrollTooManyRequests {
return &EnrollTooManyRequests{}
}
/*
EnrollTooManyRequests describes a response with status code 429, with default header values.
The resource requested is rate limited and the rate limit has been exceeded
*/
type EnrollTooManyRequests struct {
/* Denotes different type of security token related information
*/
WWWAuthenticate []string
Payload *rest_model.APIErrorEnvelope
}
// IsSuccess returns true when this enroll too many requests response has a 2xx status code
func (o *EnrollTooManyRequests) IsSuccess() bool {
return false
}
// IsRedirect returns true when this enroll too many requests response has a 3xx status code
func (o *EnrollTooManyRequests) IsRedirect() bool {
return false
}
// IsClientError returns true when this enroll too many requests response has a 4xx status code
func (o *EnrollTooManyRequests) IsClientError() bool {
return true
}
// IsServerError returns true when this enroll too many requests response has a 5xx status code
func (o *EnrollTooManyRequests) IsServerError() bool {
return false
}
// IsCode returns true when this enroll too many requests response a status code equal to that given
func (o *EnrollTooManyRequests) IsCode(code int) bool {
return code == 429
}
// Code gets the status code for the enroll too many requests response
func (o *EnrollTooManyRequests) Code() int {
return 429
}
func (o *EnrollTooManyRequests) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollTooManyRequests %s", 429, payload)
}
func (o *EnrollTooManyRequests) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollTooManyRequests %s", 429, payload)
}
func (o *EnrollTooManyRequests) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *EnrollTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header WWW-Authenticate
hdrWWWAuthenticate := response.GetHeader("WWW-Authenticate")
if hdrWWWAuthenticate != "" {
// binding header items for WWW-Authenticate
valWWWAuthenticate, err := o.bindHeaderWWWAuthenticate(hdrWWWAuthenticate, formats)
if err != nil {
return err
}
o.WWWAuthenticate = valWWWAuthenticate
}
o.Payload = new(rest_model.APIErrorEnvelope)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// bindHeaderEnrollTooManyRequests binds the response header WWW-Authenticate
func (o *EnrollTooManyRequests) bindHeaderWWWAuthenticate(hdr string, formats strfmt.Registry) ([]string, error) {
wWWAuthenticateIV := hdr
var (
wWWAuthenticateIC []string
)
// items.CollectionFormat: ""
wWWAuthenticateIR := swag.SplitByFormat(wWWAuthenticateIV, "")
for _, wWWAuthenticateIIV := range wWWAuthenticateIR {
// convert split string to string
wWWAuthenticateIIC := wWWAuthenticateIIV // string as string
wWWAuthenticateIC = append(wWWAuthenticateIC, wWWAuthenticateIIC) // roll-up string into []string
}
return wWWAuthenticateIC, nil
}
// NewEnrollServiceUnavailable creates a EnrollServiceUnavailable with default headers values
func NewEnrollServiceUnavailable() *EnrollServiceUnavailable {
return &EnrollServiceUnavailable{}
}
/*
EnrollServiceUnavailable describes a response with status code 503, with default header values.
The request could not be completed due to the server being busy or in a temporarily bad state
*/
type EnrollServiceUnavailable struct {
/* Denotes different type of security token related information
*/
WWWAuthenticate []string
Payload *rest_model.APIErrorEnvelope
}
// IsSuccess returns true when this enroll service unavailable response has a 2xx status code
func (o *EnrollServiceUnavailable) IsSuccess() bool {
return false
}
// IsRedirect returns true when this enroll service unavailable response has a 3xx status code
func (o *EnrollServiceUnavailable) IsRedirect() bool {
return false
}
// IsClientError returns true when this enroll service unavailable response has a 4xx status code
func (o *EnrollServiceUnavailable) IsClientError() bool {
return false
}
// IsServerError returns true when this enroll service unavailable response has a 5xx status code
func (o *EnrollServiceUnavailable) IsServerError() bool {
return true
}
// IsCode returns true when this enroll service unavailable response a status code equal to that given
func (o *EnrollServiceUnavailable) IsCode(code int) bool {
return code == 503
}
// Code gets the status code for the enroll service unavailable response
func (o *EnrollServiceUnavailable) Code() int {
return 503
}
func (o *EnrollServiceUnavailable) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollServiceUnavailable %s", 503, payload)
}
func (o *EnrollServiceUnavailable) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /enroll][%d] enrollServiceUnavailable %s", 503, payload)
}
func (o *EnrollServiceUnavailable) GetPayload() *rest_model.APIErrorEnvelope {
return o.Payload
}
func (o *EnrollServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// hydrates response header WWW-Authenticate
hdrWWWAuthenticate := response.GetHeader("WWW-Authenticate")
if hdrWWWAuthenticate != "" {
// binding header items for WWW-Authenticate
valWWWAuthenticate, err := o.bindHeaderWWWAuthenticate(hdrWWWAuthenticate, formats)
if err != nil {
return err
}
o.WWWAuthenticate = valWWWAuthenticate
}
o.Payload = new(rest_model.APIErrorEnvelope)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// bindHeaderEnrollServiceUnavailable binds the response header WWW-Authenticate
func (o *EnrollServiceUnavailable) bindHeaderWWWAuthenticate(hdr string, formats strfmt.Registry) ([]string, error) {
wWWAuthenticateIV := hdr
var (
wWWAuthenticateIC []string
)
// items.CollectionFormat: ""
wWWAuthenticateIR := swag.SplitByFormat(wWWAuthenticateIV, "")
for _, wWWAuthenticateIIV := range wWWAuthenticateIR {
// convert split string to string
wWWAuthenticateIIC := wWWAuthenticateIIV // string as string
wWWAuthenticateIC = append(wWWAuthenticateIC, wWWAuthenticateIIC) // roll-up string into []string
}
return wWWAuthenticateIC, nil
}