jkawamoto/roadie

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

Summary

Maintainability
D
2 days
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 (
    "net/http"
    "time"

    "golang.org/x/net/context"

    "github.com/go-openapi/errors"
    "github.com/go-openapi/runtime"
    cr "github.com/go-openapi/runtime/client"

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

// NewVirtualMachineScaleSetVmsPowerOffParams creates a new VirtualMachineScaleSetVmsPowerOffParams object
// with the default values initialized.
func NewVirtualMachineScaleSetVmsPowerOffParams() *VirtualMachineScaleSetVmsPowerOffParams {
    var ()
    return &VirtualMachineScaleSetVmsPowerOffParams{

        timeout: cr.DefaultTimeout,
    }
}

// NewVirtualMachineScaleSetVmsPowerOffParamsWithTimeout creates a new VirtualMachineScaleSetVmsPowerOffParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewVirtualMachineScaleSetVmsPowerOffParamsWithTimeout(timeout time.Duration) *VirtualMachineScaleSetVmsPowerOffParams {
    var ()
    return &VirtualMachineScaleSetVmsPowerOffParams{

        timeout: timeout,
    }
}

// NewVirtualMachineScaleSetVmsPowerOffParamsWithContext creates a new VirtualMachineScaleSetVmsPowerOffParams object
// with the default values initialized, and the ability to set a context for a request
func NewVirtualMachineScaleSetVmsPowerOffParamsWithContext(ctx context.Context) *VirtualMachineScaleSetVmsPowerOffParams {
    var ()
    return &VirtualMachineScaleSetVmsPowerOffParams{

        Context: ctx,
    }
}

/*VirtualMachineScaleSetVmsPowerOffParams contains all the parameters to send to the API endpoint
for the virtual machine scale set vms power off operation typically these are written to a http.Request
*/
type VirtualMachineScaleSetVmsPowerOffParams struct {

    /*APIVersion
      Client Api Version.

    */
    APIVersion string
    /*InstanceID
      The instance ID of the virtual machine.

    */
    InstanceID string
    /*ResourceGroupName
      The name of the resource group.

    */
    ResourceGroupName string
    /*SubscriptionID
      Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

    */
    SubscriptionID string
    /*VMScaleSetName
      The name of the VM scale set.

    */
    VMScaleSetName string

    timeout    time.Duration
    Context    context.Context
    HTTPClient *http.Client
}

// WithTimeout adds the timeout to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) WithTimeout(timeout time.Duration) *VirtualMachineScaleSetVmsPowerOffParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) WithContext(ctx context.Context) *VirtualMachineScaleSetVmsPowerOffParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithAPIVersion adds the aPIVersion to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) WithAPIVersion(aPIVersion string) *VirtualMachineScaleSetVmsPowerOffParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithInstanceID adds the instanceID to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) WithInstanceID(instanceID string) *VirtualMachineScaleSetVmsPowerOffParams {
    o.SetInstanceID(instanceID)
    return o
}

// SetInstanceID adds the instanceId to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) SetInstanceID(instanceID string) {
    o.InstanceID = instanceID
}

// WithResourceGroupName adds the resourceGroupName to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) WithResourceGroupName(resourceGroupName string) *VirtualMachineScaleSetVmsPowerOffParams {
    o.SetResourceGroupName(resourceGroupName)
    return o
}

// SetResourceGroupName adds the resourceGroupName to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) SetResourceGroupName(resourceGroupName string) {
    o.ResourceGroupName = resourceGroupName
}

// WithSubscriptionID adds the subscriptionID to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) WithSubscriptionID(subscriptionID string) *VirtualMachineScaleSetVmsPowerOffParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

// SetSubscriptionID adds the subscriptionId to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) SetSubscriptionID(subscriptionID string) {
    o.SubscriptionID = subscriptionID
}

// WithVMScaleSetName adds the vMScaleSetName to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) WithVMScaleSetName(vMScaleSetName string) *VirtualMachineScaleSetVmsPowerOffParams {
    o.SetVMScaleSetName(vMScaleSetName)
    return o
}

// SetVMScaleSetName adds the vmScaleSetName to the virtual machine scale set vms power off params
func (o *VirtualMachineScaleSetVmsPowerOffParams) SetVMScaleSetName(vMScaleSetName string) {
    o.VMScaleSetName = vMScaleSetName
}

// WriteToRequest writes these params to a swagger request
func (o *VirtualMachineScaleSetVmsPowerOffParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

    r.SetTimeout(o.timeout)
    var res []error

    // query param api-version
    qrAPIVersion := o.APIVersion
    qAPIVersion := qrAPIVersion
    if qAPIVersion != "" {
        if err := r.SetQueryParam("api-version", qAPIVersion); err != nil {
            return err
        }
    }

    // path param instanceId
    if err := r.SetPathParam("instanceId", o.InstanceID); err != nil {
        return err
    }

    // path param resourceGroupName
    if err := r.SetPathParam("resourceGroupName", o.ResourceGroupName); err != nil {
        return err
    }

    // path param subscriptionId
    if err := r.SetPathParam("subscriptionId", o.SubscriptionID); err != nil {
        return err
    }

    // path param vmScaleSetName
    if err := r.SetPathParam("vmScaleSetName", o.VMScaleSetName); err != nil {
        return err
    }

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