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

package network_service

// 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"
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	cloud "github.com/hashicorp/hcp-sdk-go/clients/cloud-shared/v1/models"
)

// AssociateHVNWithAWSRoute53PrivateHostedZoneReader is a Reader for the AssociateHVNWithAWSRoute53PrivateHostedZone structure.
type AssociateHVNWithAWSRoute53PrivateHostedZoneReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewAssociateHVNWithAWSRoute53PrivateHostedZoneOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	default:
		result := NewAssociateHVNWithAWSRoute53PrivateHostedZoneDefault(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
	}
}

// NewAssociateHVNWithAWSRoute53PrivateHostedZoneOK creates a AssociateHVNWithAWSRoute53PrivateHostedZoneOK with default headers values
func NewAssociateHVNWithAWSRoute53PrivateHostedZoneOK() *AssociateHVNWithAWSRoute53PrivateHostedZoneOK {
	return &AssociateHVNWithAWSRoute53PrivateHostedZoneOK{}
}

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

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

// IsSuccess returns true when this associate h v n with a w s route53 private hosted zone o k response has a 2xx status code
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneOK) IsSuccess() bool {
	return true
}

// IsRedirect returns true when this associate h v n with a w s route53 private hosted zone o k response has a 3xx status code
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneOK) IsRedirect() bool {
	return false
}

// IsClientError returns true when this associate h v n with a w s route53 private hosted zone o k response has a 4xx status code
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneOK) IsClientError() bool {
	return false
}

// IsServerError returns true when this associate h v n with a w s route53 private hosted zone o k response has a 5xx status code
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneOK) IsServerError() bool {
	return false
}

// IsCode returns true when this associate h v n with a w s route53 private hosted zone o k response a status code equal to that given
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneOK) IsCode(code int) bool {
	return code == 200
}

// Code gets the status code for the associate h v n with a w s route53 private hosted zone o k response
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneOK) Code() int {
	return 200
}

func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneOK) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{hvn_id}/aws-route53-private-hosted-zone-associations][%d] associateHVNWithAWSRoute53PrivateHostedZoneOK %s", 200, payload)
}

func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneOK) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{hvn_id}/aws-route53-private-hosted-zone-associations][%d] associateHVNWithAWSRoute53PrivateHostedZoneOK %s", 200, payload)
}

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

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

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

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

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

	Payload *cloud.GrpcGatewayRuntimeError
}

// IsSuccess returns true when this associate h v n with a w s route53 private hosted zone default response has a 2xx status code
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) IsSuccess() bool {
	return o._statusCode/100 == 2
}

// IsRedirect returns true when this associate h v n with a w s route53 private hosted zone default response has a 3xx status code
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) IsRedirect() bool {
	return o._statusCode/100 == 3
}

// IsClientError returns true when this associate h v n with a w s route53 private hosted zone default response has a 4xx status code
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) IsClientError() bool {
	return o._statusCode/100 == 4
}

// IsServerError returns true when this associate h v n with a w s route53 private hosted zone default response has a 5xx status code
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) IsServerError() bool {
	return o._statusCode/100 == 5
}

// IsCode returns true when this associate h v n with a w s route53 private hosted zone default response a status code equal to that given
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) IsCode(code int) bool {
	return o._statusCode == code
}

// Code gets the status code for the associate h v n with a w s route53 private hosted zone default response
func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) Code() int {
	return o._statusCode
}

func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) Error() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{hvn_id}/aws-route53-private-hosted-zone-associations][%d] AssociateHVNWithAWSRoute53PrivateHostedZone default %s", o._statusCode, payload)
}

func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) String() string {
	payload, _ := json.Marshal(o.Payload)
	return fmt.Sprintf("[POST /network/2020-09-07/organizations/{location.organization_id}/projects/{location.project_id}/networks/{hvn_id}/aws-route53-private-hosted-zone-associations][%d] AssociateHVNWithAWSRoute53PrivateHostedZone default %s", o._statusCode, payload)
}

func (o *AssociateHVNWithAWSRoute53PrivateHostedZoneDefault) GetPayload() *cloud.GrpcGatewayRuntimeError {
	return o.Payload
}

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

	o.Payload = new(cloud.GrpcGatewayRuntimeError)

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

	return nil
}
