cloud/azure/compute/client/virtual_machine_scale_set_vms/virtual_machine_scale_set_vms_restart_parameters.go
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"
)
// NewVirtualMachineScaleSetVmsRestartParams creates a new VirtualMachineScaleSetVmsRestartParams object
// with the default values initialized.
func NewVirtualMachineScaleSetVmsRestartParams() *VirtualMachineScaleSetVmsRestartParams {
var ()
return &VirtualMachineScaleSetVmsRestartParams{
timeout: cr.DefaultTimeout,
}
}
// NewVirtualMachineScaleSetVmsRestartParamsWithTimeout creates a new VirtualMachineScaleSetVmsRestartParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewVirtualMachineScaleSetVmsRestartParamsWithTimeout(timeout time.Duration) *VirtualMachineScaleSetVmsRestartParams {
var ()
return &VirtualMachineScaleSetVmsRestartParams{
timeout: timeout,
}
}
// NewVirtualMachineScaleSetVmsRestartParamsWithContext creates a new VirtualMachineScaleSetVmsRestartParams object
// with the default values initialized, and the ability to set a context for a request
func NewVirtualMachineScaleSetVmsRestartParamsWithContext(ctx context.Context) *VirtualMachineScaleSetVmsRestartParams {
var ()
return &VirtualMachineScaleSetVmsRestartParams{
Context: ctx,
}
}
/*VirtualMachineScaleSetVmsRestartParams contains all the parameters to send to the API endpoint
for the virtual machine scale set vms restart operation typically these are written to a http.Request
*/
type VirtualMachineScaleSetVmsRestartParams 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 restart params
func (o *VirtualMachineScaleSetVmsRestartParams) WithTimeout(timeout time.Duration) *VirtualMachineScaleSetVmsRestartParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) WithContext(ctx context.Context) *VirtualMachineScaleSetVmsRestartParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithAPIVersion adds the aPIVersion to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) WithAPIVersion(aPIVersion string) *VirtualMachineScaleSetVmsRestartParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) SetAPIVersion(aPIVersion string) {
o.APIVersion = aPIVersion
}
// WithInstanceID adds the instanceID to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) WithInstanceID(instanceID string) *VirtualMachineScaleSetVmsRestartParams {
o.SetInstanceID(instanceID)
return o
}
// SetInstanceID adds the instanceId to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) SetInstanceID(instanceID string) {
o.InstanceID = instanceID
}
// WithResourceGroupName adds the resourceGroupName to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) WithResourceGroupName(resourceGroupName string) *VirtualMachineScaleSetVmsRestartParams {
o.SetResourceGroupName(resourceGroupName)
return o
}
// SetResourceGroupName adds the resourceGroupName to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) SetResourceGroupName(resourceGroupName string) {
o.ResourceGroupName = resourceGroupName
}
// WithSubscriptionID adds the subscriptionID to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) WithSubscriptionID(subscriptionID string) *VirtualMachineScaleSetVmsRestartParams {
o.SetSubscriptionID(subscriptionID)
return o
}
// SetSubscriptionID adds the subscriptionId to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) SetSubscriptionID(subscriptionID string) {
o.SubscriptionID = subscriptionID
}
// WithVMScaleSetName adds the vMScaleSetName to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) WithVMScaleSetName(vMScaleSetName string) *VirtualMachineScaleSetVmsRestartParams {
o.SetVMScaleSetName(vMScaleSetName)
return o
}
// SetVMScaleSetName adds the vmScaleSetName to the virtual machine scale set vms restart params
func (o *VirtualMachineScaleSetVmsRestartParams) SetVMScaleSetName(vMScaleSetName string) {
o.VMScaleSetName = vMScaleSetName
}
// WriteToRequest writes these params to a swagger request
func (o *VirtualMachineScaleSetVmsRestartParams) 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
}