jkawamoto/roadie

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

    "github.com/jkawamoto/roadie/cloud/azure/resource/models"
)

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

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

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

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

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

    */
    DeploymentName string
    /*Parameters
      Additional parameters supplied to the operation.

    */
    Parameters *models.Deployment
    /*ResourceGroupName
      The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist.

    */
    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 create or update params
func (o *DeploymentsCreateOrUpdateParams) WithTimeout(timeout time.Duration) *DeploymentsCreateOrUpdateParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) WithContext(ctx context.Context) *DeploymentsCreateOrUpdateParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) WithHTTPClient(client *http.Client) *DeploymentsCreateOrUpdateParams {
    o.SetHTTPClient(client)
    return o
}

// SetHTTPClient adds the HTTPClient to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) SetHTTPClient(client *http.Client) {
    o.HTTPClient = client
}

// WithAPIVersion adds the aPIVersion to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) WithAPIVersion(aPIVersion string) *DeploymentsCreateOrUpdateParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithDeploymentName adds the deploymentName to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) WithDeploymentName(deploymentName string) *DeploymentsCreateOrUpdateParams {
    o.SetDeploymentName(deploymentName)
    return o
}

// SetDeploymentName adds the deploymentName to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) SetDeploymentName(deploymentName string) {
    o.DeploymentName = deploymentName
}

// WithParameters adds the parameters to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) WithParameters(parameters *models.Deployment) *DeploymentsCreateOrUpdateParams {
    o.SetParameters(parameters)
    return o
}

// SetParameters adds the parameters to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) SetParameters(parameters *models.Deployment) {
    o.Parameters = parameters
}

// WithResourceGroupName adds the resourceGroupName to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) WithResourceGroupName(resourceGroupName string) *DeploymentsCreateOrUpdateParams {
    o.SetResourceGroupName(resourceGroupName)
    return o
}

// SetResourceGroupName adds the resourceGroupName to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) SetResourceGroupName(resourceGroupName string) {
    o.ResourceGroupName = resourceGroupName
}

// WithSubscriptionID adds the subscriptionID to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) WithSubscriptionID(subscriptionID string) *DeploymentsCreateOrUpdateParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

// SetSubscriptionID adds the subscriptionId to the deployments create or update params
func (o *DeploymentsCreateOrUpdateParams) SetSubscriptionID(subscriptionID string) {
    o.SubscriptionID = subscriptionID
}

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

    if o.Parameters == nil {
        o.Parameters = new(models.Deployment)
    }

    if err := r.SetBodyParam(o.Parameters); 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
}