jkawamoto/roadie

View on GitHub
cloud/azure/compute/client/virtual_machines/virtual_machines_list_all_parameters.go

Summary

Maintainability
C
1 day
Test Coverage
package virtual_machines

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

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

/*VirtualMachinesListAllParams contains all the parameters to send to the API endpoint
for the virtual machines list all operation typically these are written to a http.Request
*/
type VirtualMachinesListAllParams struct {

    /*APIVersion
      Client Api Version.

    */
    APIVersion 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 machines list all params
func (o *VirtualMachinesListAllParams) WithTimeout(timeout time.Duration) *VirtualMachinesListAllParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the virtual machines list all params
func (o *VirtualMachinesListAllParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the virtual machines list all params
func (o *VirtualMachinesListAllParams) WithContext(ctx context.Context) *VirtualMachinesListAllParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the virtual machines list all params
func (o *VirtualMachinesListAllParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithAPIVersion adds the aPIVersion to the virtual machines list all params
func (o *VirtualMachinesListAllParams) WithAPIVersion(aPIVersion string) *VirtualMachinesListAllParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the virtual machines list all params
func (o *VirtualMachinesListAllParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithSubscriptionID adds the subscriptionID to the virtual machines list all params
func (o *VirtualMachinesListAllParams) WithSubscriptionID(subscriptionID string) *VirtualMachinesListAllParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

// SetSubscriptionID adds the subscriptionId to the virtual machines list all params
func (o *VirtualMachinesListAllParams) SetSubscriptionID(subscriptionID string) {
    o.SubscriptionID = subscriptionID
}

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

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