jkawamoto/roadie

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

Summary

Maintainability
F
3 days
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"
)

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

        timeout: cr.DefaultTimeout,
    }
}

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

        timeout: timeout,
    }
}

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

        Context: ctx,
    }
}

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

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

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

    */
    APIVersion string
    /*ParentResourcePath
      The parent resource identity.

    */
    ParentResourcePath string
    /*ResourceGroupName
      The name of the resource group that contains the resource to delete. The name is case insensitive.

    */
    ResourceGroupName string
    /*ResourceName
      The name of the resource to delete.

    */
    ResourceName string
    /*ResourceProviderNamespace
      The namespace of the resource provider.

    */
    ResourceProviderNamespace string
    /*ResourceType
      The resource type.

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

// SetTimeout adds the timeout to the resources delete params
func (o *ResourcesDeleteParams) SetTimeout(timeout time.Duration) {
    o.timeout = timeout
}

// WithContext adds the context to the resources delete params
func (o *ResourcesDeleteParams) WithContext(ctx context.Context) *ResourcesDeleteParams {
    o.SetContext(ctx)
    return o
}

// SetContext adds the context to the resources delete params
func (o *ResourcesDeleteParams) SetContext(ctx context.Context) {
    o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the resources delete params
func (o *ResourcesDeleteParams) WithHTTPClient(client *http.Client) *ResourcesDeleteParams {
    o.SetHTTPClient(client)
    return o
}

// SetHTTPClient adds the HTTPClient to the resources delete params
func (o *ResourcesDeleteParams) SetHTTPClient(client *http.Client) {
    o.HTTPClient = client
}

// WithAPIVersion adds the aPIVersion to the resources delete params
func (o *ResourcesDeleteParams) WithAPIVersion(aPIVersion string) *ResourcesDeleteParams {
    o.SetAPIVersion(aPIVersion)
    return o
}

// SetAPIVersion adds the apiVersion to the resources delete params
func (o *ResourcesDeleteParams) SetAPIVersion(aPIVersion string) {
    o.APIVersion = aPIVersion
}

// WithParentResourcePath adds the parentResourcePath to the resources delete params
func (o *ResourcesDeleteParams) WithParentResourcePath(parentResourcePath string) *ResourcesDeleteParams {
    o.SetParentResourcePath(parentResourcePath)
    return o
}

// SetParentResourcePath adds the parentResourcePath to the resources delete params
func (o *ResourcesDeleteParams) SetParentResourcePath(parentResourcePath string) {
    o.ParentResourcePath = parentResourcePath
}

// WithResourceGroupName adds the resourceGroupName to the resources delete params
func (o *ResourcesDeleteParams) WithResourceGroupName(resourceGroupName string) *ResourcesDeleteParams {
    o.SetResourceGroupName(resourceGroupName)
    return o
}

// SetResourceGroupName adds the resourceGroupName to the resources delete params
func (o *ResourcesDeleteParams) SetResourceGroupName(resourceGroupName string) {
    o.ResourceGroupName = resourceGroupName
}

// WithResourceName adds the resourceName to the resources delete params
func (o *ResourcesDeleteParams) WithResourceName(resourceName string) *ResourcesDeleteParams {
    o.SetResourceName(resourceName)
    return o
}

// SetResourceName adds the resourceName to the resources delete params
func (o *ResourcesDeleteParams) SetResourceName(resourceName string) {
    o.ResourceName = resourceName
}

// WithResourceProviderNamespace adds the resourceProviderNamespace to the resources delete params
func (o *ResourcesDeleteParams) WithResourceProviderNamespace(resourceProviderNamespace string) *ResourcesDeleteParams {
    o.SetResourceProviderNamespace(resourceProviderNamespace)
    return o
}

// SetResourceProviderNamespace adds the resourceProviderNamespace to the resources delete params
func (o *ResourcesDeleteParams) SetResourceProviderNamespace(resourceProviderNamespace string) {
    o.ResourceProviderNamespace = resourceProviderNamespace
}

// WithResourceType adds the resourceType to the resources delete params
func (o *ResourcesDeleteParams) WithResourceType(resourceType string) *ResourcesDeleteParams {
    o.SetResourceType(resourceType)
    return o
}

// SetResourceType adds the resourceType to the resources delete params
func (o *ResourcesDeleteParams) SetResourceType(resourceType string) {
    o.ResourceType = resourceType
}

// WithSubscriptionID adds the subscriptionID to the resources delete params
func (o *ResourcesDeleteParams) WithSubscriptionID(subscriptionID string) *ResourcesDeleteParams {
    o.SetSubscriptionID(subscriptionID)
    return o
}

// SetSubscriptionID adds the subscriptionId to the resources delete params
func (o *ResourcesDeleteParams) SetSubscriptionID(subscriptionID string) {
    o.SubscriptionID = subscriptionID
}

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

    // path param resourceGroupName
    if err := r.SetPathParam("resourceGroupName", o.ResourceGroupName); err != nil {
        return err
    }

    // path param resourceName
    if err := r.SetPathParam("resourceName", o.ResourceName); err != nil {
        return err
    }

    // path param resourceProviderNamespace
    if err := r.SetPathParam("resourceProviderNamespace", o.ResourceProviderNamespace); err != nil {
        return err
    }

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