// Code generated by go-swagger; DO NOT EDIT.

package cluster

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"context"
	"fmt"
	"io"
	"strconv"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// UpdateAccesspointReader is a Reader for the UpdateAccesspoint structure.
type UpdateAccesspointReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *UpdateAccesspointReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewUpdateAccesspointOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewUpdateAccesspointBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewUpdateAccesspointUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewUpdateAccesspointForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewUpdateAccesspointNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 429:
		result := NewUpdateAccesspointTooManyRequests()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewUpdateAccesspointInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewUpdateAccesspointDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewUpdateAccesspointOK creates a UpdateAccesspointOK with default headers values
func NewUpdateAccesspointOK() *UpdateAccesspointOK {
	return &UpdateAccesspointOK{}
}

/*
UpdateAccesspointOK describes a response with status code 200, with default header values.

A successful response.
*/
type UpdateAccesspointOK struct {
	Payload interface{}
}

// IsSuccess returns true when this update accesspoint o k response has a 2xx status code
func (o *UpdateAccesspointOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this update accesspoint o k response has a 3xx status code
func (o *UpdateAccesspointOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update accesspoint o k response has a 4xx status code
func (o *UpdateAccesspointOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this update accesspoint o k response has a 5xx status code
func (o *UpdateAccesspointOK) IsServerError() bool {
	return false
}

// IsCode returns true when this update accesspoint o k response a status code equal to that given
func (o *UpdateAccesspointOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the update accesspoint o k response
func (o *UpdateAccesspointOK) Code() int {
	return 200
}

func (o *UpdateAccesspointOK) Error() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointOK  %+v", 200, o.Payload)
}

func (o *UpdateAccesspointOK) String() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointOK  %+v", 200, o.Payload)
}

func (o *UpdateAccesspointOK) GetPayload() interface{} {
	return o.Payload
}

func (o *UpdateAccesspointOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewUpdateAccesspointBadRequest creates a UpdateAccesspointBadRequest with default headers values
func NewUpdateAccesspointBadRequest() *UpdateAccesspointBadRequest {
	return &UpdateAccesspointBadRequest{}
}

/*
UpdateAccesspointBadRequest describes a response with status code 400, with default header values.

A request field is invalid.
*/
type UpdateAccesspointBadRequest struct {
	Payload *UpdateAccesspointBadRequestBody
}

// IsSuccess returns true when this update accesspoint bad request response has a 2xx status code
func (o *UpdateAccesspointBadRequest) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update accesspoint bad request response has a 3xx status code
func (o *UpdateAccesspointBadRequest) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update accesspoint bad request response has a 4xx status code
func (o *UpdateAccesspointBadRequest) IsClientError() bool {
	return true
}

// IsServerError returns true when this update accesspoint bad request response has a 5xx status code
func (o *UpdateAccesspointBadRequest) IsServerError() bool {
	return false
}

// IsCode returns true when this update accesspoint bad request response a status code equal to that given
func (o *UpdateAccesspointBadRequest) IsCode(code int) bool {
	return code == 400
}

// Code gets the status code for the update accesspoint bad request response
func (o *UpdateAccesspointBadRequest) Code() int {
	return 400
}

func (o *UpdateAccesspointBadRequest) Error() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointBadRequest  %+v", 400, o.Payload)
}

func (o *UpdateAccesspointBadRequest) String() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointBadRequest  %+v", 400, o.Payload)
}

func (o *UpdateAccesspointBadRequest) GetPayload() *UpdateAccesspointBadRequestBody {
	return o.Payload
}

func (o *UpdateAccesspointBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(UpdateAccesspointBadRequestBody)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewUpdateAccesspointUnauthorized creates a UpdateAccesspointUnauthorized with default headers values
func NewUpdateAccesspointUnauthorized() *UpdateAccesspointUnauthorized {
	return &UpdateAccesspointUnauthorized{}
}

/*
UpdateAccesspointUnauthorized describes a response with status code 401, with default header values.

The API key cannot be authenticated.
*/
type UpdateAccesspointUnauthorized struct {
	Payload interface{}
}

// IsSuccess returns true when this update accesspoint unauthorized response has a 2xx status code
func (o *UpdateAccesspointUnauthorized) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update accesspoint unauthorized response has a 3xx status code
func (o *UpdateAccesspointUnauthorized) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update accesspoint unauthorized response has a 4xx status code
func (o *UpdateAccesspointUnauthorized) IsClientError() bool {
	return true
}

// IsServerError returns true when this update accesspoint unauthorized response has a 5xx status code
func (o *UpdateAccesspointUnauthorized) IsServerError() bool {
	return false
}

// IsCode returns true when this update accesspoint unauthorized response a status code equal to that given
func (o *UpdateAccesspointUnauthorized) IsCode(code int) bool {
	return code == 401
}

// Code gets the status code for the update accesspoint unauthorized response
func (o *UpdateAccesspointUnauthorized) Code() int {
	return 401
}

func (o *UpdateAccesspointUnauthorized) Error() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointUnauthorized  %+v", 401, o.Payload)
}

func (o *UpdateAccesspointUnauthorized) String() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointUnauthorized  %+v", 401, o.Payload)
}

func (o *UpdateAccesspointUnauthorized) GetPayload() interface{} {
	return o.Payload
}

func (o *UpdateAccesspointUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewUpdateAccesspointForbidden creates a UpdateAccesspointForbidden with default headers values
func NewUpdateAccesspointForbidden() *UpdateAccesspointForbidden {
	return &UpdateAccesspointForbidden{}
}

/*
UpdateAccesspointForbidden describes a response with status code 403, with default header values.

The API key does not have permission to access the resource.
*/
type UpdateAccesspointForbidden struct {
	Payload *UpdateAccesspointForbiddenBody
}

// IsSuccess returns true when this update accesspoint forbidden response has a 2xx status code
func (o *UpdateAccesspointForbidden) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update accesspoint forbidden response has a 3xx status code
func (o *UpdateAccesspointForbidden) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update accesspoint forbidden response has a 4xx status code
func (o *UpdateAccesspointForbidden) IsClientError() bool {
	return true
}

// IsServerError returns true when this update accesspoint forbidden response has a 5xx status code
func (o *UpdateAccesspointForbidden) IsServerError() bool {
	return false
}

// IsCode returns true when this update accesspoint forbidden response a status code equal to that given
func (o *UpdateAccesspointForbidden) IsCode(code int) bool {
	return code == 403
}

// Code gets the status code for the update accesspoint forbidden response
func (o *UpdateAccesspointForbidden) Code() int {
	return 403
}

func (o *UpdateAccesspointForbidden) Error() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointForbidden  %+v", 403, o.Payload)
}

func (o *UpdateAccesspointForbidden) String() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointForbidden  %+v", 403, o.Payload)
}

func (o *UpdateAccesspointForbidden) GetPayload() *UpdateAccesspointForbiddenBody {
	return o.Payload
}

func (o *UpdateAccesspointForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(UpdateAccesspointForbiddenBody)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewUpdateAccesspointNotFound creates a UpdateAccesspointNotFound with default headers values
func NewUpdateAccesspointNotFound() *UpdateAccesspointNotFound {
	return &UpdateAccesspointNotFound{}
}

/*
UpdateAccesspointNotFound describes a response with status code 404, with default header values.

The requested resource does not exist.
*/
type UpdateAccesspointNotFound struct {
	Payload *UpdateAccesspointNotFoundBody
}

// IsSuccess returns true when this update accesspoint not found response has a 2xx status code
func (o *UpdateAccesspointNotFound) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update accesspoint not found response has a 3xx status code
func (o *UpdateAccesspointNotFound) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update accesspoint not found response has a 4xx status code
func (o *UpdateAccesspointNotFound) IsClientError() bool {
	return true
}

// IsServerError returns true when this update accesspoint not found response has a 5xx status code
func (o *UpdateAccesspointNotFound) IsServerError() bool {
	return false
}

// IsCode returns true when this update accesspoint not found response a status code equal to that given
func (o *UpdateAccesspointNotFound) IsCode(code int) bool {
	return code == 404
}

// Code gets the status code for the update accesspoint not found response
func (o *UpdateAccesspointNotFound) Code() int {
	return 404
}

func (o *UpdateAccesspointNotFound) Error() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointNotFound  %+v", 404, o.Payload)
}

func (o *UpdateAccesspointNotFound) String() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointNotFound  %+v", 404, o.Payload)
}

func (o *UpdateAccesspointNotFound) GetPayload() *UpdateAccesspointNotFoundBody {
	return o.Payload
}

func (o *UpdateAccesspointNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(UpdateAccesspointNotFoundBody)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewUpdateAccesspointTooManyRequests creates a UpdateAccesspointTooManyRequests with default headers values
func NewUpdateAccesspointTooManyRequests() *UpdateAccesspointTooManyRequests {
	return &UpdateAccesspointTooManyRequests{}
}

/*
UpdateAccesspointTooManyRequests describes a response with status code 429, with default header values.

You have exceed the rate limit.
*/
type UpdateAccesspointTooManyRequests struct {
	Payload *UpdateAccesspointTooManyRequestsBody
}

// IsSuccess returns true when this update accesspoint too many requests response has a 2xx status code
func (o *UpdateAccesspointTooManyRequests) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update accesspoint too many requests response has a 3xx status code
func (o *UpdateAccesspointTooManyRequests) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update accesspoint too many requests response has a 4xx status code
func (o *UpdateAccesspointTooManyRequests) IsClientError() bool {
	return true
}

// IsServerError returns true when this update accesspoint too many requests response has a 5xx status code
func (o *UpdateAccesspointTooManyRequests) IsServerError() bool {
	return false
}

// IsCode returns true when this update accesspoint too many requests response a status code equal to that given
func (o *UpdateAccesspointTooManyRequests) IsCode(code int) bool {
	return code == 429
}

// Code gets the status code for the update accesspoint too many requests response
func (o *UpdateAccesspointTooManyRequests) Code() int {
	return 429
}

func (o *UpdateAccesspointTooManyRequests) Error() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointTooManyRequests  %+v", 429, o.Payload)
}

func (o *UpdateAccesspointTooManyRequests) String() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointTooManyRequests  %+v", 429, o.Payload)
}

func (o *UpdateAccesspointTooManyRequests) GetPayload() *UpdateAccesspointTooManyRequestsBody {
	return o.Payload
}

func (o *UpdateAccesspointTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(UpdateAccesspointTooManyRequestsBody)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewUpdateAccesspointInternalServerError creates a UpdateAccesspointInternalServerError with default headers values
func NewUpdateAccesspointInternalServerError() *UpdateAccesspointInternalServerError {
	return &UpdateAccesspointInternalServerError{}
}

/*
UpdateAccesspointInternalServerError describes a response with status code 500, with default header values.

Server error.
*/
type UpdateAccesspointInternalServerError struct {
	Payload *UpdateAccesspointInternalServerErrorBody
}

// IsSuccess returns true when this update accesspoint internal server error response has a 2xx status code
func (o *UpdateAccesspointInternalServerError) IsSuccess() bool {
	return false
}

// IsRedirect returns true when this update accesspoint internal server error response has a 3xx status code
func (o *UpdateAccesspointInternalServerError) IsRedirect() bool {
	return false
}

// IsClientError returns true when this update accesspoint internal server error response has a 4xx status code
func (o *UpdateAccesspointInternalServerError) IsClientError() bool {
	return false
}

// IsServerError returns true when this update accesspoint internal server error response has a 5xx status code
func (o *UpdateAccesspointInternalServerError) IsServerError() bool {
	return true
}

// IsCode returns true when this update accesspoint internal server error response a status code equal to that given
func (o *UpdateAccesspointInternalServerError) IsCode(code int) bool {
	return code == 500
}

// Code gets the status code for the update accesspoint internal server error response
func (o *UpdateAccesspointInternalServerError) Code() int {
	return 500
}

func (o *UpdateAccesspointInternalServerError) Error() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointInternalServerError  %+v", 500, o.Payload)
}

func (o *UpdateAccesspointInternalServerError) String() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] updateAccesspointInternalServerError  %+v", 500, o.Payload)
}

func (o *UpdateAccesspointInternalServerError) GetPayload() *UpdateAccesspointInternalServerErrorBody {
	return o.Payload
}

func (o *UpdateAccesspointInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(UpdateAccesspointInternalServerErrorBody)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewUpdateAccesspointDefault creates a UpdateAccesspointDefault with default headers values
func NewUpdateAccesspointDefault(code int) *UpdateAccesspointDefault {
	return &UpdateAccesspointDefault{
		_statusCode: code,
	}
}

/*
UpdateAccesspointDefault describes a response with status code -1, with default header values.

An unexpected error response.
*/
type UpdateAccesspointDefault struct {
	_statusCode int

	Payload *UpdateAccesspointDefaultBody
}

// IsSuccess returns true when this update accesspoint default response has a 2xx status code
func (o *UpdateAccesspointDefault) IsSuccess() bool {
	return o._statusCode/100 == 2
}

// IsRedirect returns true when this update accesspoint default response has a 3xx status code
func (o *UpdateAccesspointDefault) IsRedirect() bool {
	return o._statusCode/100 == 3
}

// IsClientError returns true when this update accesspoint default response has a 4xx status code
func (o *UpdateAccesspointDefault) IsClientError() bool {
	return o._statusCode/100 == 4
}

// IsServerError returns true when this update accesspoint default response has a 5xx status code
func (o *UpdateAccesspointDefault) IsServerError() bool {
	return o._statusCode/100 == 5
}

// IsCode returns true when this update accesspoint default response a status code equal to that given
func (o *UpdateAccesspointDefault) IsCode(code int) bool {
	return o._statusCode == code
}

// Code gets the status code for the update accesspoint default response
func (o *UpdateAccesspointDefault) Code() int {
	return o._statusCode
}

func (o *UpdateAccesspointDefault) Error() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] UpdateAccesspoint default  %+v", o._statusCode, o.Payload)
}

func (o *UpdateAccesspointDefault) String() string {
	return fmt.Sprintf("[PATCH /api/v1beta/projects/{project_id}/clusters/{cluster_id}/accesspoints/{accesspoint_id}][%d] UpdateAccesspoint default  %+v", o._statusCode, o.Payload)
}

func (o *UpdateAccesspointDefault) GetPayload() *UpdateAccesspointDefaultBody {
	return o.Payload
}

func (o *UpdateAccesspointDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(UpdateAccesspointDefaultBody)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

/*
UpdateAccesspointBadRequestBody update accesspoint bad request body
swagger:model UpdateAccesspointBadRequestBody
*/
type UpdateAccesspointBadRequestBody struct {

	// code
	//
	// Error code returned with this error.
	Code int64 `json:"code,omitempty"`

	// details
	//
	// Error details returned with this error.
	Details []string `json:"details"`

	// message
	//
	// Error message returned with this error.
	Message string `json:"message,omitempty"`
}

// Validate validates this update accesspoint bad request body
func (o *UpdateAccesspointBadRequestBody) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this update accesspoint bad request body based on context it is used
func (o *UpdateAccesspointBadRequestBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointBadRequestBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointBadRequestBody) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointBadRequestBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointBody UpdateAccesspointReq
//
// UpdateAccesspointReq is the request for updating an accesspoint for a cluster.
swagger:model UpdateAccesspointBody
*/
type UpdateAccesspointBody struct {

	// The display name of the accesspoint. The name must be 4-64 characters that can only include numbers, letters, and hyphens, and the first and last character must be a letter or number.
	// Example: Accesspoint
	// Pattern: ^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$
	DisplayName string `json:"display_name,omitempty"`

	// public endpoint
	PublicEndpoint *UpdateAccesspointParamsBodyPublicEndpoint `json:"public_endpoint,omitempty"`
}

// Validate validates this update accesspoint body
func (o *UpdateAccesspointBody) Validate(formats strfmt.Registry) error {
	var res []error

	if err := o.validateDisplayName(formats); err != nil {
		res = append(res, err)
	}

	if err := o.validatePublicEndpoint(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *UpdateAccesspointBody) validateDisplayName(formats strfmt.Registry) error {
	if swag.IsZero(o.DisplayName) { // not required
		return nil
	}

	if err := validate.Pattern("body"+"."+"display_name", "body", o.DisplayName, `^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$`); err != nil {
		return err
	}

	return nil
}

func (o *UpdateAccesspointBody) validatePublicEndpoint(formats strfmt.Registry) error {
	if swag.IsZero(o.PublicEndpoint) { // not required
		return nil
	}

	if o.PublicEndpoint != nil {
		if err := o.PublicEndpoint.Validate(formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("body" + "." + "public_endpoint")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("body" + "." + "public_endpoint")
			}
			return err
		}
	}

	return nil
}

// ContextValidate validate this update accesspoint body based on the context it is used
func (o *UpdateAccesspointBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	if err := o.contextValidatePublicEndpoint(ctx, formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *UpdateAccesspointBody) contextValidatePublicEndpoint(ctx context.Context, formats strfmt.Registry) error {

	if o.PublicEndpoint != nil {

		if swag.IsZero(o.PublicEndpoint) { // not required
			return nil
		}

		if err := o.PublicEndpoint.ContextValidate(ctx, formats); err != nil {
			if ve, ok := err.(*errors.Validation); ok {
				return ve.ValidateName("body" + "." + "public_endpoint")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("body" + "." + "public_endpoint")
			}
			return err
		}
	}

	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointBody) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointDefaultBody update accesspoint default body
swagger:model UpdateAccesspointDefaultBody
*/
type UpdateAccesspointDefaultBody struct {

	// code
	Code int32 `json:"code,omitempty"`

	// details
	Details []*UpdateAccesspointDefaultBodyDetailsItems0 `json:"details"`

	// message
	Message string `json:"message,omitempty"`
}

// Validate validates this update accesspoint default body
func (o *UpdateAccesspointDefaultBody) Validate(formats strfmt.Registry) error {
	var res []error

	if err := o.validateDetails(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *UpdateAccesspointDefaultBody) validateDetails(formats strfmt.Registry) error {
	if swag.IsZero(o.Details) { // not required
		return nil
	}

	for i := 0; i < len(o.Details); i++ {
		if swag.IsZero(o.Details[i]) { // not required
			continue
		}

		if o.Details[i] != nil {
			if err := o.Details[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("UpdateAccesspoint default" + "." + "details" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("UpdateAccesspoint default" + "." + "details" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

// ContextValidate validate this update accesspoint default body based on the context it is used
func (o *UpdateAccesspointDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	if err := o.contextValidateDetails(ctx, formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *UpdateAccesspointDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(o.Details); i++ {

		if o.Details[i] != nil {

			if swag.IsZero(o.Details[i]) { // not required
				return nil
			}

			if err := o.Details[i].ContextValidate(ctx, formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("UpdateAccesspoint default" + "." + "details" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("UpdateAccesspoint default" + "." + "details" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointDefaultBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointDefaultBody) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointDefaultBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointDefaultBodyDetailsItems0 update accesspoint default body details items0
swagger:model UpdateAccesspointDefaultBodyDetailsItems0
*/
type UpdateAccesspointDefaultBodyDetailsItems0 struct {

	// at type
	AtType string `json:"@type,omitempty"`
}

// Validate validates this update accesspoint default body details items0
func (o *UpdateAccesspointDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this update accesspoint default body details items0 based on context it is used
func (o *UpdateAccesspointDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointDefaultBodyDetailsItems0
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointForbiddenBody update accesspoint forbidden body
swagger:model UpdateAccesspointForbiddenBody
*/
type UpdateAccesspointForbiddenBody struct {

	// code
	//
	// Error code returned with this error.
	Code int64 `json:"code,omitempty"`

	// details
	//
	// Error details returned with this error.
	Details []string `json:"details"`

	// message
	//
	// Error message returned with this error.
	Message string `json:"message,omitempty"`
}

// Validate validates this update accesspoint forbidden body
func (o *UpdateAccesspointForbiddenBody) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this update accesspoint forbidden body based on context it is used
func (o *UpdateAccesspointForbiddenBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointForbiddenBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointForbiddenBody) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointForbiddenBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointInternalServerErrorBody update accesspoint internal server error body
swagger:model UpdateAccesspointInternalServerErrorBody
*/
type UpdateAccesspointInternalServerErrorBody struct {

	// code
	//
	// Error code returned with this error.
	Code int64 `json:"code,omitempty"`

	// details
	//
	// Error details returned with this error.
	Details []string `json:"details"`

	// message
	//
	// Error message returned with this error.
	Message string `json:"message,omitempty"`
}

// Validate validates this update accesspoint internal server error body
func (o *UpdateAccesspointInternalServerErrorBody) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this update accesspoint internal server error body based on context it is used
func (o *UpdateAccesspointInternalServerErrorBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointInternalServerErrorBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointInternalServerErrorBody) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointInternalServerErrorBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointNotFoundBody update accesspoint not found body
swagger:model UpdateAccesspointNotFoundBody
*/
type UpdateAccesspointNotFoundBody struct {

	// code
	//
	// Error code returned with this error.
	Code int64 `json:"code,omitempty"`

	// details
	//
	// Error details returned with this error.
	Details []string `json:"details"`

	// message
	//
	// Error message returned with this error.
	Message string `json:"message,omitempty"`
}

// Validate validates this update accesspoint not found body
func (o *UpdateAccesspointNotFoundBody) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this update accesspoint not found body based on context it is used
func (o *UpdateAccesspointNotFoundBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointNotFoundBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointNotFoundBody) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointNotFoundBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointParamsBodyPublicEndpoint The public endpoint.
swagger:model UpdateAccesspointParamsBodyPublicEndpoint
*/
type UpdateAccesspointParamsBodyPublicEndpoint struct {

	// The IP allowlist for the public endpoint.
	IPAllowlist []*UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0 `json:"ip_allowlist"`
}

// Validate validates this update accesspoint params body public endpoint
func (o *UpdateAccesspointParamsBodyPublicEndpoint) Validate(formats strfmt.Registry) error {
	var res []error

	if err := o.validateIPAllowlist(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *UpdateAccesspointParamsBodyPublicEndpoint) validateIPAllowlist(formats strfmt.Registry) error {
	if swag.IsZero(o.IPAllowlist) { // not required
		return nil
	}

	for i := 0; i < len(o.IPAllowlist); i++ {
		if swag.IsZero(o.IPAllowlist[i]) { // not required
			continue
		}

		if o.IPAllowlist[i] != nil {
			if err := o.IPAllowlist[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("body" + "." + "public_endpoint" + "." + "ip_allowlist" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("body" + "." + "public_endpoint" + "." + "ip_allowlist" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

// ContextValidate validate this update accesspoint params body public endpoint based on the context it is used
func (o *UpdateAccesspointParamsBodyPublicEndpoint) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	var res []error

	if err := o.contextValidateIPAllowlist(ctx, formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

func (o *UpdateAccesspointParamsBodyPublicEndpoint) contextValidateIPAllowlist(ctx context.Context, formats strfmt.Registry) error {

	for i := 0; i < len(o.IPAllowlist); i++ {

		if o.IPAllowlist[i] != nil {

			if swag.IsZero(o.IPAllowlist[i]) { // not required
				return nil
			}

			if err := o.IPAllowlist[i].ContextValidate(ctx, formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("body" + "." + "public_endpoint" + "." + "ip_allowlist" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("body" + "." + "public_endpoint" + "." + "ip_allowlist" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointParamsBodyPublicEndpoint) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointParamsBodyPublicEndpoint) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointParamsBodyPublicEndpoint
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0 update accesspoint params body public endpoint IP allowlist items0
swagger:model UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0
*/
type UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0 struct {

	// CIDR.
	// Example: 0.0.0.0/0
	Cidr string `json:"cidr,omitempty"`
}

// Validate validates this update accesspoint params body public endpoint IP allowlist items0
func (o *UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this update accesspoint params body public endpoint IP allowlist items0 based on context it is used
func (o *UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointParamsBodyPublicEndpointIPAllowlistItems0
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}

/*
UpdateAccesspointTooManyRequestsBody update accesspoint too many requests body
swagger:model UpdateAccesspointTooManyRequestsBody
*/
type UpdateAccesspointTooManyRequestsBody struct {

	// code
	//
	// Error code returned with this error.
	Code int64 `json:"code,omitempty"`

	// details
	//
	// Error details returned with this error.
	Details []string `json:"details"`

	// message
	//
	// Error message returned with this error.
	Message string `json:"message,omitempty"`
}

// Validate validates this update accesspoint too many requests body
func (o *UpdateAccesspointTooManyRequestsBody) Validate(formats strfmt.Registry) error {
	return nil
}

// ContextValidate validates this update accesspoint too many requests body based on context it is used
func (o *UpdateAccesspointTooManyRequestsBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

// MarshalBinary interface implementation
func (o *UpdateAccesspointTooManyRequestsBody) MarshalBinary() ([]byte, error) {
	if o == nil {
		return nil, nil
	}
	return swag.WriteJSON(o)
}

// UnmarshalBinary interface implementation
func (o *UpdateAccesspointTooManyRequestsBody) UnmarshalBinary(b []byte) error {
	var res UpdateAccesspointTooManyRequestsBody
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*o = res
	return nil
}
