jkawamoto/roadie

View on GitHub
cloud/azure/resource/client/resources/resources_get_by_id_parameters.go

Summary

Maintainability
D
1 day
Test Coverage
package resources

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

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

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

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

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

    */
    APIVersion string
    /*ResourceID
      The fully qualified ID of the resource, including the resource name and resource type. Use the format, /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}

    */
    ResourceID string

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

// WithTimeout adds the timeout to the resources get by Id params
func (o *ResourcesGetByIDParams) WithTimeout(timeout time.Duration) *ResourcesGetByIDParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the resources get by Id params
func (o *ResourcesGetByIDParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the resources get by Id params
func (o *ResourcesGetByIDParams) WithContext(ctx context.Context) *ResourcesGetByIDParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the resources get by Id params
func (o *ResourcesGetByIDParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the resources get by Id params
func (o *ResourcesGetByIDParams) WithHTTPClient(client *http.Client) *ResourcesGetByIDParams {
    o.SetHTTPClient(client)
    return o
}

// SetHTTPClient adds the HTTPClient to the resources get by Id params
func (o *ResourcesGetByIDParams) SetHTTPClient(client *http.Client) {
    o.HTTPClient = client
}

// WithAPIVersion adds the aPIVersion to the resources get by Id params
func (o *ResourcesGetByIDParams) WithAPIVersion(aPIVersion string) *ResourcesGetByIDParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the resources get by Id params
func (o *ResourcesGetByIDParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithResourceID adds the resourceID to the resources get by Id params
func (o *ResourcesGetByIDParams) WithResourceID(resourceID string) *ResourcesGetByIDParams {
    o.SetResourceID(resourceID)
    return o
}

// SetResourceID adds the resourceId to the resources get by Id params
func (o *ResourcesGetByIDParams) SetResourceID(resourceID string) {
    o.ResourceID = resourceID
}

// WriteToRequest writes these params to a swagger request
func (o *ResourcesGetByIDParams) 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 resourceId
    if err := r.SetPathParam("resourceId", o.ResourceID); err != nil {
        return err
    }

    if len(res) > 0 {
        return errors.CompositeValidationError(res...)
    }
    return nil
}