jkawamoto/roadie

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

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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