// 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"
	"encoding/json"
	"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"
)

// GetAccesspointReader is a Reader for the GetAccesspoint structure.
type GetAccesspointReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *GetAccesspointReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewGetAccesspointOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 400:
		result := NewGetAccesspointBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 401:
		result := NewGetAccesspointUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 403:
		result := NewGetAccesspointForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewGetAccesspointNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 429:
		result := NewGetAccesspointTooManyRequests()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 500:
		result := NewGetAccesspointInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewGetAccesspointDefault(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
	}
}

// NewGetAccesspointOK creates a GetAccesspointOK with default headers values
func NewGetAccesspointOK() *GetAccesspointOK {
	return &GetAccesspointOK{}
}

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

A successful response.
*/
type GetAccesspointOK struct {
	Payload *GetAccesspointOKBody
}

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

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

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

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

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

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

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

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

func (o *GetAccesspointOK) GetPayload() *GetAccesspointOKBody {
	return o.Payload
}

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

	o.Payload = new(GetAccesspointOKBody)

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

	return nil
}

// NewGetAccesspointBadRequest creates a GetAccesspointBadRequest with default headers values
func NewGetAccesspointBadRequest() *GetAccesspointBadRequest {
	return &GetAccesspointBadRequest{}
}

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

A request field is invalid.
*/
type GetAccesspointBadRequest struct {
	Payload *GetAccesspointBadRequestBody
}

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

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

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

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

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

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

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

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

func (o *GetAccesspointBadRequest) GetPayload() *GetAccesspointBadRequestBody {
	return o.Payload
}

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

	o.Payload = new(GetAccesspointBadRequestBody)

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

	return nil
}

// NewGetAccesspointUnauthorized creates a GetAccesspointUnauthorized with default headers values
func NewGetAccesspointUnauthorized() *GetAccesspointUnauthorized {
	return &GetAccesspointUnauthorized{}
}

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

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

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

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

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

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

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

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

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

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

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

func (o *GetAccesspointUnauthorized) 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
}

// NewGetAccesspointForbidden creates a GetAccesspointForbidden with default headers values
func NewGetAccesspointForbidden() *GetAccesspointForbidden {
	return &GetAccesspointForbidden{}
}

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

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

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

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

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

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

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

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

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

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

func (o *GetAccesspointForbidden) GetPayload() *GetAccesspointForbiddenBody {
	return o.Payload
}

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

	o.Payload = new(GetAccesspointForbiddenBody)

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

	return nil
}

// NewGetAccesspointNotFound creates a GetAccesspointNotFound with default headers values
func NewGetAccesspointNotFound() *GetAccesspointNotFound {
	return &GetAccesspointNotFound{}
}

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

The requested resource does not exist.
*/
type GetAccesspointNotFound struct {
	Payload *GetAccesspointNotFoundBody
}

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

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

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

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

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

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

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

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

func (o *GetAccesspointNotFound) GetPayload() *GetAccesspointNotFoundBody {
	return o.Payload
}

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

	o.Payload = new(GetAccesspointNotFoundBody)

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

	return nil
}

// NewGetAccesspointTooManyRequests creates a GetAccesspointTooManyRequests with default headers values
func NewGetAccesspointTooManyRequests() *GetAccesspointTooManyRequests {
	return &GetAccesspointTooManyRequests{}
}

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

You have exceed the rate limit.
*/
type GetAccesspointTooManyRequests struct {
	Payload *GetAccesspointTooManyRequestsBody
}

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

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

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

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

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

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

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

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

func (o *GetAccesspointTooManyRequests) GetPayload() *GetAccesspointTooManyRequestsBody {
	return o.Payload
}

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

	o.Payload = new(GetAccesspointTooManyRequestsBody)

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

	return nil
}

// NewGetAccesspointInternalServerError creates a GetAccesspointInternalServerError with default headers values
func NewGetAccesspointInternalServerError() *GetAccesspointInternalServerError {
	return &GetAccesspointInternalServerError{}
}

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

Server error.
*/
type GetAccesspointInternalServerError struct {
	Payload *GetAccesspointInternalServerErrorBody
}

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

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

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

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

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

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

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

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

func (o *GetAccesspointInternalServerError) GetPayload() *GetAccesspointInternalServerErrorBody {
	return o.Payload
}

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

	o.Payload = new(GetAccesspointInternalServerErrorBody)

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

	return nil
}

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

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

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

	Payload *GetAccesspointDefaultBody
}

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

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

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

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

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

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

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

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

func (o *GetAccesspointDefault) GetPayload() *GetAccesspointDefaultBody {
	return o.Payload
}

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

	o.Payload = new(GetAccesspointDefaultBody)

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

	return nil
}

/*
GetAccesspointBadRequestBody get accesspoint bad request body
swagger:model GetAccesspointBadRequestBody
*/
type GetAccesspointBadRequestBody 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 get accesspoint bad request body
func (o *GetAccesspointBadRequestBody) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

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

/*
GetAccesspointDefaultBody get accesspoint default body
swagger:model GetAccesspointDefaultBody
*/
type GetAccesspointDefaultBody struct {

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

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

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

// Validate validates this get accesspoint default body
func (o *GetAccesspointDefaultBody) 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 *GetAccesspointDefaultBody) 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("GetAccesspoint default" + "." + "details" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("GetAccesspoint default" + "." + "details" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

// ContextValidate validate this get accesspoint default body based on the context it is used
func (o *GetAccesspointDefaultBody) 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 *GetAccesspointDefaultBody) 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("GetAccesspoint default" + "." + "details" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("GetAccesspoint default" + "." + "details" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

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

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

/*
GetAccesspointDefaultBodyDetailsItems0 get accesspoint default body details items0
swagger:model GetAccesspointDefaultBodyDetailsItems0
*/
type GetAccesspointDefaultBodyDetailsItems0 struct {

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

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

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

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

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

/*
GetAccesspointForbiddenBody get accesspoint forbidden body
swagger:model GetAccesspointForbiddenBody
*/
type GetAccesspointForbiddenBody 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 get accesspoint forbidden body
func (o *GetAccesspointForbiddenBody) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

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

/*
GetAccesspointInternalServerErrorBody get accesspoint internal server error body
swagger:model GetAccesspointInternalServerErrorBody
*/
type GetAccesspointInternalServerErrorBody 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 get accesspoint internal server error body
func (o *GetAccesspointInternalServerErrorBody) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

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

/*
GetAccesspointNotFoundBody get accesspoint not found body
swagger:model GetAccesspointNotFoundBody
*/
type GetAccesspointNotFoundBody 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 get accesspoint not found body
func (o *GetAccesspointNotFoundBody) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

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

/*
GetAccesspointOKBody Accesspoint
//
// Accesspoint
swagger:model GetAccesspointOKBody
*/
type GetAccesspointOKBody struct {

	// The ID of the cluster.
	// Example: 1
	// Required: true
	ClusterID *string `json:"cluster_id"`

	// 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
	// Required: true
	// Pattern: ^[A-Za-z0-9][-A-Za-z0-9]{2,62}[A-Za-z0-9]$
	DisplayName *string `json:"display_name"`

	// The ID of the accesspoint.
	// Example: 1
	// Required: true
	ID *string `json:"id"`

	// private endpoint
	PrivateEndpoint *GetAccesspointOKBodyPrivateEndpoint `json:"private_endpoint,omitempty"`

	// The ID of the project. You can get the project ID from the response of [List all accessible projects](#tag/Project/operation/ListProjects).
	// Example: 1
	// Required: true
	ProjectID *string `json:"project_id"`

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

	// The number of tidb nodes in the accesspoint.
	// Example: 2
	TidbNodeQuantity int32 `json:"tidb_node_quantity,omitempty"`

	// vpc peering endpoint
	VpcPeeringEndpoint *GetAccesspointOKBodyVpcPeeringEndpoint `json:"vpc_peering_endpoint,omitempty"`
}

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

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

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

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

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

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

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

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

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

func (o *GetAccesspointOKBody) validateClusterID(formats strfmt.Registry) error {

	if err := validate.Required("getAccesspointOK"+"."+"cluster_id", "body", o.ClusterID); err != nil {
		return err
	}

	return nil
}

func (o *GetAccesspointOKBody) validateDisplayName(formats strfmt.Registry) error {

	if err := validate.Required("getAccesspointOK"+"."+"display_name", "body", o.DisplayName); err != nil {
		return err
	}

	if err := validate.Pattern("getAccesspointOK"+"."+"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 *GetAccesspointOKBody) validateID(formats strfmt.Registry) error {

	if err := validate.Required("getAccesspointOK"+"."+"id", "body", o.ID); err != nil {
		return err
	}

	return nil
}

func (o *GetAccesspointOKBody) validatePrivateEndpoint(formats strfmt.Registry) error {
	if swag.IsZero(o.PrivateEndpoint) { // not required
		return nil
	}

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

	return nil
}

func (o *GetAccesspointOKBody) validateProjectID(formats strfmt.Registry) error {

	if err := validate.Required("getAccesspointOK"+"."+"project_id", "body", o.ProjectID); err != nil {
		return err
	}

	return nil
}

func (o *GetAccesspointOKBody) 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("getAccesspointOK" + "." + "public_endpoint")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("getAccesspointOK" + "." + "public_endpoint")
			}
			return err
		}
	}

	return nil
}

func (o *GetAccesspointOKBody) validateVpcPeeringEndpoint(formats strfmt.Registry) error {
	if swag.IsZero(o.VpcPeeringEndpoint) { // not required
		return nil
	}

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

	return nil
}

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

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

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

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

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

func (o *GetAccesspointOKBody) contextValidatePrivateEndpoint(ctx context.Context, formats strfmt.Registry) error {

	if o.PrivateEndpoint != nil {

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

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

	return nil
}

func (o *GetAccesspointOKBody) 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("getAccesspointOK" + "." + "public_endpoint")
			} else if ce, ok := err.(*errors.CompositeError); ok {
				return ce.ValidateName("getAccesspointOK" + "." + "public_endpoint")
			}
			return err
		}
	}

	return nil
}

func (o *GetAccesspointOKBody) contextValidateVpcPeeringEndpoint(ctx context.Context, formats strfmt.Registry) error {

	if o.VpcPeeringEndpoint != nil {

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

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

	return nil
}

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

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

/*
GetAccesspointOKBodyPrivateEndpoint The private endpoint.
swagger:model GetAccesspointOKBodyPrivateEndpoint
*/
type GetAccesspointOKBodyPrivateEndpoint struct {

	// Availability zones for the private endpoint service. This field is only applicable when the `cloud_provider` is `"AWS"`.
	// Example: ["usw2-az2","usw2-az1"]
	AzIds []string `json:"az_ids"`

	// The DNS name of the private endpoint service.
	// Example: privatelink-tidb.01234567890.clusters.tidb-cloud.com
	Host string `json:"host,omitempty"`

	// The port of the private endpoint service.
	// Example: 4000
	Port int32 `json:"port,omitempty"`

	// private link service
	PrivateLinkService *GetAccesspointOKBodyPrivateEndpointPrivateLinkService `json:"private_link_service,omitempty"`
}

// Validate validates this get accesspoint o k body private endpoint
func (o *GetAccesspointOKBodyPrivateEndpoint) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (o *GetAccesspointOKBodyPrivateEndpoint) validatePrivateLinkService(formats strfmt.Registry) error {
	if swag.IsZero(o.PrivateLinkService) { // not required
		return nil
	}

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

	return nil
}

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

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

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

func (o *GetAccesspointOKBodyPrivateEndpoint) contextValidatePrivateLinkService(ctx context.Context, formats strfmt.Registry) error {

	if o.PrivateLinkService != nil {

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

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

	return nil
}

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

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

/*
GetAccesspointOKBodyPrivateEndpointPrivateLinkService The private endpoint service.
swagger:model GetAccesspointOKBodyPrivateEndpointPrivateLinkService
*/
type GetAccesspointOKBodyPrivateEndpointPrivateLinkService struct {

	// The name of the private endpoint service, which is used for connection.
	// Example: com.amazonaws.vpce.us-west-2.vpce-svc-01234567890123456
	ServiceName string `json:"service_name,omitempty"`

	// The status of the private endpoint service.
	// Example: ACTIVE
	// Enum: [CREATING ACTIVE DELETING]
	Status string `json:"status,omitempty"`
}

// Validate validates this get accesspoint o k body private endpoint private link service
func (o *GetAccesspointOKBodyPrivateEndpointPrivateLinkService) Validate(formats strfmt.Registry) error {
	var res []error

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

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

var getAccesspointOKBodyPrivateEndpointPrivateLinkServiceTypeStatusPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["CREATING","ACTIVE","DELETING"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		getAccesspointOKBodyPrivateEndpointPrivateLinkServiceTypeStatusPropEnum = append(getAccesspointOKBodyPrivateEndpointPrivateLinkServiceTypeStatusPropEnum, v)
	}
}

const (

	// GetAccesspointOKBodyPrivateEndpointPrivateLinkServiceStatusCREATING captures enum value "CREATING"
	GetAccesspointOKBodyPrivateEndpointPrivateLinkServiceStatusCREATING string = "CREATING"

	// GetAccesspointOKBodyPrivateEndpointPrivateLinkServiceStatusACTIVE captures enum value "ACTIVE"
	GetAccesspointOKBodyPrivateEndpointPrivateLinkServiceStatusACTIVE string = "ACTIVE"

	// GetAccesspointOKBodyPrivateEndpointPrivateLinkServiceStatusDELETING captures enum value "DELETING"
	GetAccesspointOKBodyPrivateEndpointPrivateLinkServiceStatusDELETING string = "DELETING"
)

// prop value enum
func (o *GetAccesspointOKBodyPrivateEndpointPrivateLinkService) validateStatusEnum(path, location string, value string) error {
	if err := validate.EnumCase(path, location, value, getAccesspointOKBodyPrivateEndpointPrivateLinkServiceTypeStatusPropEnum, true); err != nil {
		return err
	}
	return nil
}

func (o *GetAccesspointOKBodyPrivateEndpointPrivateLinkService) validateStatus(formats strfmt.Registry) error {
	if swag.IsZero(o.Status) { // not required
		return nil
	}

	// value enum
	if err := o.validateStatusEnum("getAccesspointOK"+"."+"private_endpoint"+"."+"private_link_service"+"."+"status", "body", o.Status); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this get accesspoint o k body private endpoint private link service based on context it is used
func (o *GetAccesspointOKBodyPrivateEndpointPrivateLinkService) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

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

	// The host of standard connection.
	// Example: tidb.f69f3808.acea1f2a.us-east-1.shared.aws.tidbcloud.com
	Host string `json:"host,omitempty"`

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

	// The TiDB port for connection. The port must be in the range of 1024-65535 except 10080.
	//
	// Example: 4000
	// Maximum: 65535
	// Minimum: 1024
	Port int32 `json:"port,omitempty"`
}

// Validate validates this get accesspoint o k body public endpoint
func (o *GetAccesspointOKBodyPublicEndpoint) Validate(formats strfmt.Registry) error {
	var res []error

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

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

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

func (o *GetAccesspointOKBodyPublicEndpoint) 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("getAccesspointOK" + "." + "public_endpoint" + "." + "ip_allowlist" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("getAccesspointOK" + "." + "public_endpoint" + "." + "ip_allowlist" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

func (o *GetAccesspointOKBodyPublicEndpoint) validatePort(formats strfmt.Registry) error {
	if swag.IsZero(o.Port) { // not required
		return nil
	}

	if err := validate.MinimumInt("getAccesspointOK"+"."+"public_endpoint"+"."+"port", "body", int64(o.Port), 1024, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("getAccesspointOK"+"."+"public_endpoint"+"."+"port", "body", int64(o.Port), 65535, false); err != nil {
		return err
	}

	return nil
}

// ContextValidate validate this get accesspoint o k body public endpoint based on the context it is used
func (o *GetAccesspointOKBodyPublicEndpoint) 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 *GetAccesspointOKBodyPublicEndpoint) 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("getAccesspointOK" + "." + "public_endpoint" + "." + "ip_allowlist" + "." + strconv.Itoa(i))
				} else if ce, ok := err.(*errors.CompositeError); ok {
					return ce.ValidateName("getAccesspointOK" + "." + "public_endpoint" + "." + "ip_allowlist" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

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

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

/*
GetAccesspointOKBodyPublicEndpointIPAllowlistItems0 get accesspoint o k body public endpoint IP allowlist items0
swagger:model GetAccesspointOKBodyPublicEndpointIPAllowlistItems0
*/
type GetAccesspointOKBodyPublicEndpointIPAllowlistItems0 struct {

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

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

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

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

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

/*
GetAccesspointOKBodyVpcPeeringEndpoint The VPC peering endpoint.
swagger:model GetAccesspointOKBodyVpcPeeringEndpoint
*/
type GetAccesspointOKBodyVpcPeeringEndpoint struct {

	// The host of VPC peering connection.
	// Example: private-tidb.f69f3808.acea1f2a.us-east-1.shared.aws.tidbcloud.com
	Host string `json:"host,omitempty"`

	// The TiDB port for connection. The port must be in the range of 1024-65535 except 10080.
	//
	// Example: 4000
	// Maximum: 65535
	// Minimum: 1024
	Port int32 `json:"port,omitempty"`
}

// Validate validates this get accesspoint o k body vpc peering endpoint
func (o *GetAccesspointOKBodyVpcPeeringEndpoint) Validate(formats strfmt.Registry) error {
	var res []error

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

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

func (o *GetAccesspointOKBodyVpcPeeringEndpoint) validatePort(formats strfmt.Registry) error {
	if swag.IsZero(o.Port) { // not required
		return nil
	}

	if err := validate.MinimumInt("getAccesspointOK"+"."+"vpc_peering_endpoint"+"."+"port", "body", int64(o.Port), 1024, false); err != nil {
		return err
	}

	if err := validate.MaximumInt("getAccesspointOK"+"."+"vpc_peering_endpoint"+"."+"port", "body", int64(o.Port), 65535, false); err != nil {
		return err
	}

	return nil
}

// ContextValidate validates this get accesspoint o k body vpc peering endpoint based on context it is used
func (o *GetAccesspointOKBodyVpcPeeringEndpoint) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
	return nil
}

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

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

/*
GetAccesspointTooManyRequestsBody get accesspoint too many requests body
swagger:model GetAccesspointTooManyRequestsBody
*/
type GetAccesspointTooManyRequestsBody 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 get accesspoint too many requests body
func (o *GetAccesspointTooManyRequestsBody) Validate(formats strfmt.Registry) error {
	return nil
}

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

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

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