jkawamoto/roadie

View on GitHub
cloud/azure/compute/client/images/images_get_parameters.go

Summary

Maintainability
D
2 days
Test Coverage
package images

// 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"
)

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

/*ImagesGetParams contains all the parameters to send to the API endpoint
for the images get operation typically these are written to a http.Request
*/
type ImagesGetParams struct {

    /*NrDollarExpand
      The expand expression to apply on the operation.

    */
    DollarExpand *string
    /*APIVersion
      Client Api Version.

    */
    APIVersion string
    /*ImageName
      The name of the image.

    */
    ImageName 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

    timeout    time.Duration
    Context    context.Context
    HTTPClient *http.Client
}

// WithTimeout adds the timeout to the images get params
func (o *ImagesGetParams) WithTimeout(timeout time.Duration) *ImagesGetParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the images get params
func (o *ImagesGetParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the images get params
func (o *ImagesGetParams) WithContext(ctx context.Context) *ImagesGetParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the images get params
func (o *ImagesGetParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithDollarExpand adds the dollarExpand to the images get params
func (o *ImagesGetParams) WithDollarExpand(dollarExpand *string) *ImagesGetParams {
    o.SetDollarExpand(dollarExpand)
    return o
}

// SetDollarExpand adds the dollarExpand to the images get params
func (o *ImagesGetParams) SetDollarExpand(dollarExpand *string) {
    o.DollarExpand = dollarExpand
}

// WithAPIVersion adds the aPIVersion to the images get params
func (o *ImagesGetParams) WithAPIVersion(aPIVersion string) *ImagesGetParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the images get params
func (o *ImagesGetParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithImageName adds the imageName to the images get params
func (o *ImagesGetParams) WithImageName(imageName string) *ImagesGetParams {
    o.SetImageName(imageName)
    return o
}

// SetImageName adds the imageName to the images get params
func (o *ImagesGetParams) SetImageName(imageName string) {
    o.ImageName = imageName
}

// WithResourceGroupName adds the resourceGroupName to the images get params
func (o *ImagesGetParams) WithResourceGroupName(resourceGroupName string) *ImagesGetParams {
    o.SetResourceGroupName(resourceGroupName)
    return o
}

// SetResourceGroupName adds the resourceGroupName to the images get params
func (o *ImagesGetParams) SetResourceGroupName(resourceGroupName string) {
    o.ResourceGroupName = resourceGroupName
}

// WithSubscriptionID adds the subscriptionID to the images get params
func (o *ImagesGetParams) WithSubscriptionID(subscriptionID string) *ImagesGetParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

// SetSubscriptionID adds the subscriptionId to the images get params
func (o *ImagesGetParams) SetSubscriptionID(subscriptionID string) {
    o.SubscriptionID = subscriptionID
}

// WriteToRequest writes these params to a swagger request
func (o *ImagesGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

    r.SetTimeout(o.timeout)
    var res []error

    if o.DollarExpand != nil {

        // query param $expand
        var qrNrDollarExpand string
        if o.DollarExpand != nil {
            qrNrDollarExpand = *o.DollarExpand
        }
        qNrDollarExpand := qrNrDollarExpand
        if qNrDollarExpand != "" {
            if err := r.SetQueryParam("$expand", qNrDollarExpand); err != nil {
                return err
            }
        }

    }

    // query param api-version
    qrAPIVersion := o.APIVersion
    qAPIVersion := qrAPIVersion
    if qAPIVersion != "" {
        if err := r.SetQueryParam("api-version", qAPIVersion); err != nil {
            return err
        }
    }

    // path param imageName
    if err := r.SetPathParam("imageName", o.ImageName); 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
}