jkawamoto/roadie

View on GitHub
cloud/azure/resource/client/deployments/deployments_delete_parameters.go

Summary

Maintainability
D
2 days
Test Coverage
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"
)

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

// NewDeploymentsDeleteParamsWithHTTPClient creates a new DeploymentsDeleteParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDeploymentsDeleteParamsWithHTTPClient(client *http.Client) *DeploymentsDeleteParams {
    var ()
    return &DeploymentsDeleteParams{
        HTTPClient: client,
    }
}

/*DeploymentsDeleteParams contains all the parameters to send to the API endpoint
for the deployments delete operation typically these are written to a http.Request
*/
type DeploymentsDeleteParams struct {

    /*APIVersion
      The API version to use for this operation.

    */
    APIVersion string
    /*DeploymentName
      The name of the deployment to delete.

    */
    DeploymentName string
    /*ResourceGroupName
      The name of the resource group with the deployment to delete. 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 delete params
func (o *DeploymentsDeleteParams) WithTimeout(timeout time.Duration) *DeploymentsDeleteParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the deployments delete params
func (o *DeploymentsDeleteParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the deployments delete params
func (o *DeploymentsDeleteParams) WithContext(ctx context.Context) *DeploymentsDeleteParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the deployments delete params
func (o *DeploymentsDeleteParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the deployments delete params
func (o *DeploymentsDeleteParams) WithHTTPClient(client *http.Client) *DeploymentsDeleteParams {
    o.SetHTTPClient(client)
    return o
}

// SetHTTPClient adds the HTTPClient to the deployments delete params
func (o *DeploymentsDeleteParams) SetHTTPClient(client *http.Client) {
    o.HTTPClient = client
}

// WithAPIVersion adds the aPIVersion to the deployments delete params
func (o *DeploymentsDeleteParams) WithAPIVersion(aPIVersion string) *DeploymentsDeleteParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the deployments delete params
func (o *DeploymentsDeleteParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithDeploymentName adds the deploymentName to the deployments delete params
func (o *DeploymentsDeleteParams) WithDeploymentName(deploymentName string) *DeploymentsDeleteParams {
    o.SetDeploymentName(deploymentName)
    return o
}

// SetDeploymentName adds the deploymentName to the deployments delete params
func (o *DeploymentsDeleteParams) SetDeploymentName(deploymentName string) {
    o.DeploymentName = deploymentName
}

// WithResourceGroupName adds the resourceGroupName to the deployments delete params
func (o *DeploymentsDeleteParams) WithResourceGroupName(resourceGroupName string) *DeploymentsDeleteParams {
    o.SetResourceGroupName(resourceGroupName)
    return o
}

// SetResourceGroupName adds the resourceGroupName to the deployments delete params
func (o *DeploymentsDeleteParams) SetResourceGroupName(resourceGroupName string) {
    o.ResourceGroupName = resourceGroupName
}

// WithSubscriptionID adds the subscriptionID to the deployments delete params
func (o *DeploymentsDeleteParams) WithSubscriptionID(subscriptionID string) *DeploymentsDeleteParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

// SetSubscriptionID adds the subscriptionId to the deployments delete params
func (o *DeploymentsDeleteParams) SetSubscriptionID(subscriptionID string) {
    o.SubscriptionID = subscriptionID
}

// WriteToRequest writes these params to a swagger request
func (o *DeploymentsDeleteParams) 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
}