jkawamoto/roadie

View on GitHub
cloud/azure/compute/client/virtual_machine_scale_sets/virtual_machine_scale_sets_create_or_update_parameters.go

Summary

Maintainability
D
2 days
Test Coverage
package virtual_machine_scale_sets

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

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

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

/*VirtualMachineScaleSetsCreateOrUpdateParams contains all the parameters to send to the API endpoint
for the virtual machine scale sets create or update operation typically these are written to a http.Request
*/
type VirtualMachineScaleSetsCreateOrUpdateParams struct {

    /*APIVersion
      Client Api Version.

    */
    APIVersion string
    /*Name
      The name of the VM scale set to create or update.

    */
    Name string
    /*Parameters
      The scale set object.

    */
    Parameters *models.VirtualMachineScaleSet
    /*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

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

// WithTimeout adds the timeout to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) WithTimeout(timeout time.Duration) *VirtualMachineScaleSetsCreateOrUpdateParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) WithContext(ctx context.Context) *VirtualMachineScaleSetsCreateOrUpdateParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithAPIVersion adds the aPIVersion to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) WithAPIVersion(aPIVersion string) *VirtualMachineScaleSetsCreateOrUpdateParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithName adds the name to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) WithName(name string) *VirtualMachineScaleSetsCreateOrUpdateParams {
    o.SetName(name)
    return o
}

// SetName adds the name to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) SetName(name string) {
    o.Name = name
}

// WithParameters adds the parameters to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) WithParameters(parameters *models.VirtualMachineScaleSet) *VirtualMachineScaleSetsCreateOrUpdateParams {
    o.SetParameters(parameters)
    return o
}

// SetParameters adds the parameters to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) SetParameters(parameters *models.VirtualMachineScaleSet) {
    o.Parameters = parameters
}

// WithResourceGroupName adds the resourceGroupName to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) WithResourceGroupName(resourceGroupName string) *VirtualMachineScaleSetsCreateOrUpdateParams {
    o.SetResourceGroupName(resourceGroupName)
    return o
}

// SetResourceGroupName adds the resourceGroupName to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) SetResourceGroupName(resourceGroupName string) {
    o.ResourceGroupName = resourceGroupName
}

// WithSubscriptionID adds the subscriptionID to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) WithSubscriptionID(subscriptionID string) *VirtualMachineScaleSetsCreateOrUpdateParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

// SetSubscriptionID adds the subscriptionId to the virtual machine scale sets create or update params
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) SetSubscriptionID(subscriptionID string) {
    o.SubscriptionID = subscriptionID
}

// WriteToRequest writes these params to a swagger request
func (o *VirtualMachineScaleSetsCreateOrUpdateParams) 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 name
    if err := r.SetPathParam("name", o.Name); err != nil {
        return err
    }

    if o.Parameters == nil {
        o.Parameters = new(models.VirtualMachineScaleSet)
    }

    if err := r.SetBodyParam(o.Parameters); 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
    }

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