jkawamoto/roadie

View on GitHub
cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_deallocate_responses.go

Summary

Maintainability
C
1 day
Test Coverage
package virtual_machine_scale_set_vms

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

import (
    "fmt"
    "io"

    "github.com/go-openapi/runtime"

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

    "github.com/jkawamoto/roadie/cloud/azure/compute/models"
)

// VirtualMachineScaleSetVmsDeallocateReader is a Reader for the VirtualMachineScaleSetVmsDeallocate structure.
type VirtualMachineScaleSetVmsDeallocateReader struct {
    formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *VirtualMachineScaleSetVmsDeallocateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    switch response.Code() {

    case 200:
        result := NewVirtualMachineScaleSetVmsDeallocateOK()
        if err := result.readResponse(response, consumer, o.formats); err != nil {
            return nil, err
        }
        return result, nil

    case 202:
        result := NewVirtualMachineScaleSetVmsDeallocateAccepted()
        if err := result.readResponse(response, consumer, o.formats); err != nil {
            return nil, err
        }
        return result, nil

    default:
        return nil, runtime.NewAPIError("unknown error", response, response.Code())
    }
}

// NewVirtualMachineScaleSetVmsDeallocateOK creates a VirtualMachineScaleSetVmsDeallocateOK with default headers values
func NewVirtualMachineScaleSetVmsDeallocateOK() *VirtualMachineScaleSetVmsDeallocateOK {
    return &VirtualMachineScaleSetVmsDeallocateOK{}
}

/*VirtualMachineScaleSetVmsDeallocateOK handles this case with default header values.

OK
*/
type VirtualMachineScaleSetVmsDeallocateOK struct {
    Payload *models.OperationStatusResponse
}

func (o *VirtualMachineScaleSetVmsDeallocateOK) Error() string {
    return fmt.Sprintf("[POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate][%d] virtualMachineScaleSetVmsDeallocateOK  %+v", 200, o.Payload)
}

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

    o.Payload = new(models.OperationStatusResponse)

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

    return nil
}

// NewVirtualMachineScaleSetVmsDeallocateAccepted creates a VirtualMachineScaleSetVmsDeallocateAccepted with default headers values
func NewVirtualMachineScaleSetVmsDeallocateAccepted() *VirtualMachineScaleSetVmsDeallocateAccepted {
    return &VirtualMachineScaleSetVmsDeallocateAccepted{}
}

/*VirtualMachineScaleSetVmsDeallocateAccepted handles this case with default header values.

Accepted
*/
type VirtualMachineScaleSetVmsDeallocateAccepted struct {
}

func (o *VirtualMachineScaleSetVmsDeallocateAccepted) Error() string {
    return fmt.Sprintf("[POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate][%d] virtualMachineScaleSetVmsDeallocateAccepted ", 202)
}

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

    return nil
}