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