cloud/azure/compute/client/virtual_machines/virtual_machines_get_parameters.go
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"
)
// NewVirtualMachinesGetParams creates a new VirtualMachinesGetParams object
// with the default values initialized.
func NewVirtualMachinesGetParams() *VirtualMachinesGetParams {
var ()
return &VirtualMachinesGetParams{
timeout: cr.DefaultTimeout,
}
}
// NewVirtualMachinesGetParamsWithTimeout creates a new VirtualMachinesGetParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewVirtualMachinesGetParamsWithTimeout(timeout time.Duration) *VirtualMachinesGetParams {
var ()
return &VirtualMachinesGetParams{
timeout: timeout,
}
}
// NewVirtualMachinesGetParamsWithContext creates a new VirtualMachinesGetParams object
// with the default values initialized, and the ability to set a context for a request
func NewVirtualMachinesGetParamsWithContext(ctx context.Context) *VirtualMachinesGetParams {
var ()
return &VirtualMachinesGetParams{
Context: ctx,
}
}
/*VirtualMachinesGetParams contains all the parameters to send to the API endpoint
for the virtual machines get operation typically these are written to a http.Request
*/
type VirtualMachinesGetParams struct {
/*NrDollarExpand
The expand expression to apply on the operation.
*/
DollarExpand *string
/*APIVersion
Client Api Version.
*/
APIVersion 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
/*VMName
The name of the virtual machine.
*/
VMName string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the virtual machines get params
func (o *VirtualMachinesGetParams) WithTimeout(timeout time.Duration) *VirtualMachinesGetParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the virtual machines get params
func (o *VirtualMachinesGetParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the virtual machines get params
func (o *VirtualMachinesGetParams) WithContext(ctx context.Context) *VirtualMachinesGetParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the virtual machines get params
func (o *VirtualMachinesGetParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithDollarExpand adds the dollarExpand to the virtual machines get params
func (o *VirtualMachinesGetParams) WithDollarExpand(dollarExpand *string) *VirtualMachinesGetParams {
o.SetDollarExpand(dollarExpand)
return o
}
// SetDollarExpand adds the dollarExpand to the virtual machines get params
func (o *VirtualMachinesGetParams) SetDollarExpand(dollarExpand *string) {
o.DollarExpand = dollarExpand
}
// WithAPIVersion adds the aPIVersion to the virtual machines get params
func (o *VirtualMachinesGetParams) WithAPIVersion(aPIVersion string) *VirtualMachinesGetParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the virtual machines get params
func (o *VirtualMachinesGetParams) SetAPIVersion(aPIVersion string) {
o.APIVersion = aPIVersion
}
// WithResourceGroupName adds the resourceGroupName to the virtual machines get params
func (o *VirtualMachinesGetParams) WithResourceGroupName(resourceGroupName string) *VirtualMachinesGetParams {
o.SetResourceGroupName(resourceGroupName)
return o
}
// SetResourceGroupName adds the resourceGroupName to the virtual machines get params
func (o *VirtualMachinesGetParams) SetResourceGroupName(resourceGroupName string) {
o.ResourceGroupName = resourceGroupName
}
// WithSubscriptionID adds the subscriptionID to the virtual machines get params
func (o *VirtualMachinesGetParams) WithSubscriptionID(subscriptionID string) *VirtualMachinesGetParams {
o.SetSubscriptionID(subscriptionID)
return o
}
// SetSubscriptionID adds the subscriptionId to the virtual machines get params
func (o *VirtualMachinesGetParams) SetSubscriptionID(subscriptionID string) {
o.SubscriptionID = subscriptionID
}
// WithVMName adds the vMName to the virtual machines get params
func (o *VirtualMachinesGetParams) WithVMName(vMName string) *VirtualMachinesGetParams {
o.SetVMName(vMName)
return o
}
// SetVMName adds the vmName to the virtual machines get params
func (o *VirtualMachinesGetParams) SetVMName(vMName string) {
o.VMName = vMName
}
// WriteToRequest writes these params to a swagger request
func (o *VirtualMachinesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
if o.DollarExpand != nil {
// query param $expand
var qrNrDollarExpand string
if o.DollarExpand != nil {
qrNrDollarExpand = *o.DollarExpand
}
qNrDollarExpand := qrNrDollarExpand
if qNrDollarExpand != "" {
if err := r.SetQueryParam("$expand", qNrDollarExpand); err != nil {
return err
}
}
}
// query param api-version
qrAPIVersion := o.APIVersion
qAPIVersion := qrAPIVersion
if qAPIVersion != "" {
if err := r.SetQueryParam("api-version", qAPIVersion); 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 vmName
if err := r.SetPathParam("vmName", o.VMName); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}