cloud/azure/compute/client/virtual_machines/virtual_machines_delete_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"
)
// NewVirtualMachinesDeleteParams creates a new VirtualMachinesDeleteParams object
// with the default values initialized.
func NewVirtualMachinesDeleteParams() *VirtualMachinesDeleteParams {
var ()
return &VirtualMachinesDeleteParams{
timeout: cr.DefaultTimeout,
}
}
// NewVirtualMachinesDeleteParamsWithTimeout creates a new VirtualMachinesDeleteParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewVirtualMachinesDeleteParamsWithTimeout(timeout time.Duration) *VirtualMachinesDeleteParams {
var ()
return &VirtualMachinesDeleteParams{
timeout: timeout,
}
}
// NewVirtualMachinesDeleteParamsWithContext creates a new VirtualMachinesDeleteParams object
// with the default values initialized, and the ability to set a context for a request
func NewVirtualMachinesDeleteParamsWithContext(ctx context.Context) *VirtualMachinesDeleteParams {
var ()
return &VirtualMachinesDeleteParams{
Context: ctx,
}
}
/*VirtualMachinesDeleteParams contains all the parameters to send to the API endpoint
for the virtual machines delete operation typically these are written to a http.Request
*/
type VirtualMachinesDeleteParams struct {
/*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 delete params
func (o *VirtualMachinesDeleteParams) WithTimeout(timeout time.Duration) *VirtualMachinesDeleteParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) WithContext(ctx context.Context) *VirtualMachinesDeleteParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithAPIVersion adds the aPIVersion to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) WithAPIVersion(aPIVersion string) *VirtualMachinesDeleteParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) SetAPIVersion(aPIVersion string) {
o.APIVersion = aPIVersion
}
// WithResourceGroupName adds the resourceGroupName to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) WithResourceGroupName(resourceGroupName string) *VirtualMachinesDeleteParams {
o.SetResourceGroupName(resourceGroupName)
return o
}
// SetResourceGroupName adds the resourceGroupName to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) SetResourceGroupName(resourceGroupName string) {
o.ResourceGroupName = resourceGroupName
}
// WithSubscriptionID adds the subscriptionID to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) WithSubscriptionID(subscriptionID string) *VirtualMachinesDeleteParams {
o.SetSubscriptionID(subscriptionID)
return o
}
// SetSubscriptionID adds the subscriptionId to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) SetSubscriptionID(subscriptionID string) {
o.SubscriptionID = subscriptionID
}
// WithVMName adds the vMName to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) WithVMName(vMName string) *VirtualMachinesDeleteParams {
o.SetVMName(vMName)
return o
}
// SetVMName adds the vmName to the virtual machines delete params
func (o *VirtualMachinesDeleteParams) SetVMName(vMName string) {
o.VMName = vMName
}
// WriteToRequest writes these params to a swagger request
func (o *VirtualMachinesDeleteParams) 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 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
}