From d0cf2310b1d3ca3b5fe03cbdeb14ad399f52c9bb Mon Sep 17 00:00:00 2001 From: powervs-ibm <137309855+powervs-ibm@users.noreply.github.com> Date: Mon, 17 Jun 2024 10:48:01 -0500 Subject: [PATCH] Generated Swagger client from service-broker commit f19df27ca2e676ba6cb9f5e73036f4536d5c050c (#407) --- .../v1_snapshots_getall_responses.go | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/power/client/snapshots/v1_snapshots_getall_responses.go b/power/client/snapshots/v1_snapshots_getall_responses.go index 36b8f3ee..5c4ebf06 100644 --- a/power/client/snapshots/v1_snapshots_getall_responses.go +++ b/power/client/snapshots/v1_snapshots_getall_responses.go @@ -54,6 +54,12 @@ func (o *V1SnapshotsGetallReader) ReadResponse(response runtime.ClientResponse, return nil, err } return nil, result + case 503: + result := NewV1SnapshotsGetallServiceUnavailable() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result default: return nil, runtime.NewAPIError("[GET /v1/snapshots] v1.snapshots.getall", response, response.Code()) } @@ -408,3 +414,73 @@ func (o *V1SnapshotsGetallInternalServerError) readResponse(response runtime.Cli return nil } + +// NewV1SnapshotsGetallServiceUnavailable creates a V1SnapshotsGetallServiceUnavailable with default headers values +func NewV1SnapshotsGetallServiceUnavailable() *V1SnapshotsGetallServiceUnavailable { + return &V1SnapshotsGetallServiceUnavailable{} +} + +/* +V1SnapshotsGetallServiceUnavailable describes a response with status code 503, with default header values. + +Service Unavailable +*/ +type V1SnapshotsGetallServiceUnavailable struct { + Payload *models.Error +} + +// IsSuccess returns true when this v1 snapshots getall service unavailable response has a 2xx status code +func (o *V1SnapshotsGetallServiceUnavailable) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this v1 snapshots getall service unavailable response has a 3xx status code +func (o *V1SnapshotsGetallServiceUnavailable) IsRedirect() bool { + return false +} + +// IsClientError returns true when this v1 snapshots getall service unavailable response has a 4xx status code +func (o *V1SnapshotsGetallServiceUnavailable) IsClientError() bool { + return false +} + +// IsServerError returns true when this v1 snapshots getall service unavailable response has a 5xx status code +func (o *V1SnapshotsGetallServiceUnavailable) IsServerError() bool { + return true +} + +// IsCode returns true when this v1 snapshots getall service unavailable response a status code equal to that given +func (o *V1SnapshotsGetallServiceUnavailable) IsCode(code int) bool { + return code == 503 +} + +// Code gets the status code for the v1 snapshots getall service unavailable response +func (o *V1SnapshotsGetallServiceUnavailable) Code() int { + return 503 +} + +func (o *V1SnapshotsGetallServiceUnavailable) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallServiceUnavailable %s", 503, payload) +} + +func (o *V1SnapshotsGetallServiceUnavailable) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /v1/snapshots][%d] v1SnapshotsGetallServiceUnavailable %s", 503, payload) +} + +func (o *V1SnapshotsGetallServiceUnavailable) GetPayload() *models.Error { + return o.Payload +} + +func (o *V1SnapshotsGetallServiceUnavailable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +}