jkawamoto/roadie

View on GitHub
cloud/azure/resource/client/deployments/deployments_export_template_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"
)

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

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

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

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

    */
    APIVersion string
    /*DeploymentName
      The name of the deployment from which to get the template.

    */
    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 export template params
func (o *DeploymentsExportTemplateParams) WithTimeout(timeout time.Duration) *DeploymentsExportTemplateParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the deployments export template params
func (o *DeploymentsExportTemplateParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

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

// SetContext adds the context to the deployments export template params
func (o *DeploymentsExportTemplateParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

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

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

// WithAPIVersion adds the aPIVersion to the deployments export template params
func (o *DeploymentsExportTemplateParams) WithAPIVersion(aPIVersion string) *DeploymentsExportTemplateParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

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

// WithDeploymentName adds the deploymentName to the deployments export template params
func (o *DeploymentsExportTemplateParams) WithDeploymentName(deploymentName string) *DeploymentsExportTemplateParams {
    o.SetDeploymentName(deploymentName)
    return o
}

// SetDeploymentName adds the deploymentName to the deployments export template params
func (o *DeploymentsExportTemplateParams) SetDeploymentName(deploymentName string) {
    o.DeploymentName = deploymentName
}

// WithResourceGroupName adds the resourceGroupName to the deployments export template params
func (o *DeploymentsExportTemplateParams) WithResourceGroupName(resourceGroupName string) *DeploymentsExportTemplateParams {
    o.SetResourceGroupName(resourceGroupName)
    return o
}

// SetResourceGroupName adds the resourceGroupName to the deployments export template params
func (o *DeploymentsExportTemplateParams) SetResourceGroupName(resourceGroupName string) {
    o.ResourceGroupName = resourceGroupName
}

// WithSubscriptionID adds the subscriptionID to the deployments export template params
func (o *DeploymentsExportTemplateParams) WithSubscriptionID(subscriptionID string) *DeploymentsExportTemplateParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

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

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