cloud/azure/resource/client/deployments/deployments_cancel_parameters.go
package deployments
// 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"
)
// NewDeploymentsCancelParams creates a new DeploymentsCancelParams object
// with the default values initialized.
func NewDeploymentsCancelParams() *DeploymentsCancelParams {
var ()
return &DeploymentsCancelParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeploymentsCancelParamsWithTimeout creates a new DeploymentsCancelParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewDeploymentsCancelParamsWithTimeout(timeout time.Duration) *DeploymentsCancelParams {
var ()
return &DeploymentsCancelParams{
timeout: timeout,
}
}
// NewDeploymentsCancelParamsWithContext creates a new DeploymentsCancelParams object
// with the default values initialized, and the ability to set a context for a request
func NewDeploymentsCancelParamsWithContext(ctx context.Context) *DeploymentsCancelParams {
var ()
return &DeploymentsCancelParams{
Context: ctx,
}
}
// NewDeploymentsCancelParamsWithHTTPClient creates a new DeploymentsCancelParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDeploymentsCancelParamsWithHTTPClient(client *http.Client) *DeploymentsCancelParams {
var ()
return &DeploymentsCancelParams{
HTTPClient: client,
}
}
/*DeploymentsCancelParams contains all the parameters to send to the API endpoint
for the deployments cancel operation typically these are written to a http.Request
*/
type DeploymentsCancelParams struct {
/*APIVersion
The API version to use for this operation.
*/
APIVersion string
/*DeploymentName
The name of the deployment to cancel.
*/
DeploymentName string
/*ResourceGroupName
The name of the resource group. The name is case insensitive.
*/
ResourceGroupName string
/*SubscriptionID
The ID of the target subscription.
*/
SubscriptionID string
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the deployments cancel params
func (o *DeploymentsCancelParams) WithTimeout(timeout time.Duration) *DeploymentsCancelParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the deployments cancel params
func (o *DeploymentsCancelParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the deployments cancel params
func (o *DeploymentsCancelParams) WithContext(ctx context.Context) *DeploymentsCancelParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the deployments cancel params
func (o *DeploymentsCancelParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the deployments cancel params
func (o *DeploymentsCancelParams) WithHTTPClient(client *http.Client) *DeploymentsCancelParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the deployments cancel params
func (o *DeploymentsCancelParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAPIVersion adds the aPIVersion to the deployments cancel params
func (o *DeploymentsCancelParams) WithAPIVersion(aPIVersion string) *DeploymentsCancelParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the deployments cancel params
func (o *DeploymentsCancelParams) SetAPIVersion(aPIVersion string) {
o.APIVersion = aPIVersion
}
// WithDeploymentName adds the deploymentName to the deployments cancel params
func (o *DeploymentsCancelParams) WithDeploymentName(deploymentName string) *DeploymentsCancelParams {
o.SetDeploymentName(deploymentName)
return o
}
// SetDeploymentName adds the deploymentName to the deployments cancel params
func (o *DeploymentsCancelParams) SetDeploymentName(deploymentName string) {
o.DeploymentName = deploymentName
}
// WithResourceGroupName adds the resourceGroupName to the deployments cancel params
func (o *DeploymentsCancelParams) WithResourceGroupName(resourceGroupName string) *DeploymentsCancelParams {
o.SetResourceGroupName(resourceGroupName)
return o
}
// SetResourceGroupName adds the resourceGroupName to the deployments cancel params
func (o *DeploymentsCancelParams) SetResourceGroupName(resourceGroupName string) {
o.ResourceGroupName = resourceGroupName
}
// WithSubscriptionID adds the subscriptionID to the deployments cancel params
func (o *DeploymentsCancelParams) WithSubscriptionID(subscriptionID string) *DeploymentsCancelParams {
o.SetSubscriptionID(subscriptionID)
return o
}
// SetSubscriptionID adds the subscriptionId to the deployments cancel params
func (o *DeploymentsCancelParams) SetSubscriptionID(subscriptionID string) {
o.SubscriptionID = subscriptionID
}
// WriteToRequest writes these params to a swagger request
func (o *DeploymentsCancelParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
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 deploymentName
if err := r.SetPathParam("deploymentName", o.DeploymentName); 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
}