cloud/azure/resource/client/resources/resources_check_existence_parameters.go
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"
)
// NewResourcesCheckExistenceParams creates a new ResourcesCheckExistenceParams object
// with the default values initialized.
func NewResourcesCheckExistenceParams() *ResourcesCheckExistenceParams {
var ()
return &ResourcesCheckExistenceParams{
timeout: cr.DefaultTimeout,
}
}
// NewResourcesCheckExistenceParamsWithTimeout creates a new ResourcesCheckExistenceParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewResourcesCheckExistenceParamsWithTimeout(timeout time.Duration) *ResourcesCheckExistenceParams {
var ()
return &ResourcesCheckExistenceParams{
timeout: timeout,
}
}
// NewResourcesCheckExistenceParamsWithContext creates a new ResourcesCheckExistenceParams object
// with the default values initialized, and the ability to set a context for a request
func NewResourcesCheckExistenceParamsWithContext(ctx context.Context) *ResourcesCheckExistenceParams {
var ()
return &ResourcesCheckExistenceParams{
Context: ctx,
}
}
// NewResourcesCheckExistenceParamsWithHTTPClient creates a new ResourcesCheckExistenceParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewResourcesCheckExistenceParamsWithHTTPClient(client *http.Client) *ResourcesCheckExistenceParams {
var ()
return &ResourcesCheckExistenceParams{
HTTPClient: client,
}
}
/*ResourcesCheckExistenceParams contains all the parameters to send to the API endpoint
for the resources check existence operation typically these are written to a http.Request
*/
type ResourcesCheckExistenceParams 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 containing the resource to check. The name is case insensitive.
*/
ResourceGroupName string
/*ResourceName
The name of the resource to check whether it exists.
*/
ResourceName string
/*ResourceProviderNamespace
The resource provider of the resource to check.
*/
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 check existence params
func (o *ResourcesCheckExistenceParams) WithTimeout(timeout time.Duration) *ResourcesCheckExistenceParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithContext(ctx context.Context) *ResourcesCheckExistenceParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithHTTPClient(client *http.Client) *ResourcesCheckExistenceParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAPIVersion adds the aPIVersion to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithAPIVersion(aPIVersion string) *ResourcesCheckExistenceParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetAPIVersion(aPIVersion string) {
o.APIVersion = aPIVersion
}
// WithParentResourcePath adds the parentResourcePath to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithParentResourcePath(parentResourcePath string) *ResourcesCheckExistenceParams {
o.SetParentResourcePath(parentResourcePath)
return o
}
// SetParentResourcePath adds the parentResourcePath to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetParentResourcePath(parentResourcePath string) {
o.ParentResourcePath = parentResourcePath
}
// WithResourceGroupName adds the resourceGroupName to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithResourceGroupName(resourceGroupName string) *ResourcesCheckExistenceParams {
o.SetResourceGroupName(resourceGroupName)
return o
}
// SetResourceGroupName adds the resourceGroupName to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetResourceGroupName(resourceGroupName string) {
o.ResourceGroupName = resourceGroupName
}
// WithResourceName adds the resourceName to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithResourceName(resourceName string) *ResourcesCheckExistenceParams {
o.SetResourceName(resourceName)
return o
}
// SetResourceName adds the resourceName to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetResourceName(resourceName string) {
o.ResourceName = resourceName
}
// WithResourceProviderNamespace adds the resourceProviderNamespace to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithResourceProviderNamespace(resourceProviderNamespace string) *ResourcesCheckExistenceParams {
o.SetResourceProviderNamespace(resourceProviderNamespace)
return o
}
// SetResourceProviderNamespace adds the resourceProviderNamespace to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetResourceProviderNamespace(resourceProviderNamespace string) {
o.ResourceProviderNamespace = resourceProviderNamespace
}
// WithResourceType adds the resourceType to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithResourceType(resourceType string) *ResourcesCheckExistenceParams {
o.SetResourceType(resourceType)
return o
}
// SetResourceType adds the resourceType to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetResourceType(resourceType string) {
o.ResourceType = resourceType
}
// WithSubscriptionID adds the subscriptionID to the resources check existence params
func (o *ResourcesCheckExistenceParams) WithSubscriptionID(subscriptionID string) *ResourcesCheckExistenceParams {
o.SetSubscriptionID(subscriptionID)
return o
}
// SetSubscriptionID adds the subscriptionId to the resources check existence params
func (o *ResourcesCheckExistenceParams) SetSubscriptionID(subscriptionID string) {
o.SubscriptionID = subscriptionID
}
// WriteToRequest writes these params to a swagger request
func (o *ResourcesCheckExistenceParams) 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
}