jkawamoto/roadie

View on GitHub
cloud/azure/resource/client/providers/providers_register_parameters.go

Summary

Maintainability
D
2 days
Test Coverage
package providers

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

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

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

/*ProvidersRegisterParams contains all the parameters to send to the API endpoint
for the providers register operation typically these are written to a http.Request
*/
type ProvidersRegisterParams struct {

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

    */
    APIVersion string
    /*ResourceProviderNamespace
      The namespace of the resource provider to register.

    */
    ResourceProviderNamespace 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 providers register params
func (o *ProvidersRegisterParams) WithTimeout(timeout time.Duration) *ProvidersRegisterParams {
    o.SetTimeout(timeout)
    return o
}

// SetTimeout adds the timeout to the providers register params
func (o *ProvidersRegisterParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the providers register params
func (o *ProvidersRegisterParams) WithContext(ctx context.Context) *ProvidersRegisterParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the providers register params
func (o *ProvidersRegisterParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the providers register params
func (o *ProvidersRegisterParams) WithHTTPClient(client *http.Client) *ProvidersRegisterParams {
    o.SetHTTPClient(client)
    return o
}

// SetHTTPClient adds the HTTPClient to the providers register params
func (o *ProvidersRegisterParams) SetHTTPClient(client *http.Client) {
    o.HTTPClient = client
}

// WithAPIVersion adds the aPIVersion to the providers register params
func (o *ProvidersRegisterParams) WithAPIVersion(aPIVersion string) *ProvidersRegisterParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the providers register params
func (o *ProvidersRegisterParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithResourceProviderNamespace adds the resourceProviderNamespace to the providers register params
func (o *ProvidersRegisterParams) WithResourceProviderNamespace(resourceProviderNamespace string) *ProvidersRegisterParams {
    o.SetResourceProviderNamespace(resourceProviderNamespace)
    return o
}

// SetResourceProviderNamespace adds the resourceProviderNamespace to the providers register params
func (o *ProvidersRegisterParams) SetResourceProviderNamespace(resourceProviderNamespace string) {
    o.ResourceProviderNamespace = resourceProviderNamespace
}

// WithSubscriptionID adds the subscriptionID to the providers register params
func (o *ProvidersRegisterParams) WithSubscriptionID(subscriptionID string) *ProvidersRegisterParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

// SetSubscriptionID adds the subscriptionId to the providers register params
func (o *ProvidersRegisterParams) SetSubscriptionID(subscriptionID string) {
    o.SubscriptionID = subscriptionID
}

// WriteToRequest writes these params to a swagger request
func (o *ProvidersRegisterParams) 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 resourceProviderNamespace
    if err := r.SetPathParam("resourceProviderNamespace", o.ResourceProviderNamespace); 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
}