cloud/azure/resource/client/resource_groups/resource_groups_patch_parameters.go
package resource_groups
// 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"
"github.com/jkawamoto/roadie/cloud/azure/resource/models"
)
// NewResourceGroupsPatchParams creates a new ResourceGroupsPatchParams object
// with the default values initialized.
func NewResourceGroupsPatchParams() *ResourceGroupsPatchParams {
var ()
return &ResourceGroupsPatchParams{
timeout: cr.DefaultTimeout,
}
}
// NewResourceGroupsPatchParamsWithTimeout creates a new ResourceGroupsPatchParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewResourceGroupsPatchParamsWithTimeout(timeout time.Duration) *ResourceGroupsPatchParams {
var ()
return &ResourceGroupsPatchParams{
timeout: timeout,
}
}
// NewResourceGroupsPatchParamsWithContext creates a new ResourceGroupsPatchParams object
// with the default values initialized, and the ability to set a context for a request
func NewResourceGroupsPatchParamsWithContext(ctx context.Context) *ResourceGroupsPatchParams {
var ()
return &ResourceGroupsPatchParams{
Context: ctx,
}
}
// NewResourceGroupsPatchParamsWithHTTPClient creates a new ResourceGroupsPatchParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewResourceGroupsPatchParamsWithHTTPClient(client *http.Client) *ResourceGroupsPatchParams {
var ()
return &ResourceGroupsPatchParams{
HTTPClient: client,
}
}
/*ResourceGroupsPatchParams contains all the parameters to send to the API endpoint
for the resource groups patch operation typically these are written to a http.Request
*/
type ResourceGroupsPatchParams struct {
/*APIVersion
The API version to use for this operation.
*/
APIVersion string
/*Parameters
Parameters supplied to update a resource group.
*/
Parameters *models.ResourceGroup
/*ResourceGroupName
The name of the resource group to update. The name is case insensitive.
*/
ResourceGroupName 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 resource groups patch params
func (o *ResourceGroupsPatchParams) WithTimeout(timeout time.Duration) *ResourceGroupsPatchParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the resource groups patch params
func (o *ResourceGroupsPatchParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the resource groups patch params
func (o *ResourceGroupsPatchParams) WithContext(ctx context.Context) *ResourceGroupsPatchParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the resource groups patch params
func (o *ResourceGroupsPatchParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the resource groups patch params
func (o *ResourceGroupsPatchParams) WithHTTPClient(client *http.Client) *ResourceGroupsPatchParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the resource groups patch params
func (o *ResourceGroupsPatchParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithAPIVersion adds the aPIVersion to the resource groups patch params
func (o *ResourceGroupsPatchParams) WithAPIVersion(aPIVersion string) *ResourceGroupsPatchParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the resource groups patch params
func (o *ResourceGroupsPatchParams) SetAPIVersion(aPIVersion string) {
o.APIVersion = aPIVersion
}
// WithParameters adds the parameters to the resource groups patch params
func (o *ResourceGroupsPatchParams) WithParameters(parameters *models.ResourceGroup) *ResourceGroupsPatchParams {
o.SetParameters(parameters)
return o
}
// SetParameters adds the parameters to the resource groups patch params
func (o *ResourceGroupsPatchParams) SetParameters(parameters *models.ResourceGroup) {
o.Parameters = parameters
}
// WithResourceGroupName adds the resourceGroupName to the resource groups patch params
func (o *ResourceGroupsPatchParams) WithResourceGroupName(resourceGroupName string) *ResourceGroupsPatchParams {
o.SetResourceGroupName(resourceGroupName)
return o
}
// SetResourceGroupName adds the resourceGroupName to the resource groups patch params
func (o *ResourceGroupsPatchParams) SetResourceGroupName(resourceGroupName string) {
o.ResourceGroupName = resourceGroupName
}
// WithSubscriptionID adds the subscriptionID to the resource groups patch params
func (o *ResourceGroupsPatchParams) WithSubscriptionID(subscriptionID string) *ResourceGroupsPatchParams {
o.SetSubscriptionID(subscriptionID)
return o
}
// SetSubscriptionID adds the subscriptionId to the resource groups patch params
func (o *ResourceGroupsPatchParams) SetSubscriptionID(subscriptionID string) {
o.SubscriptionID = subscriptionID
}
// WriteToRequest writes these params to a swagger request
func (o *ResourceGroupsPatchParams) 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
}
}
if o.Parameters == nil {
o.Parameters = new(models.ResourceGroup)
}
if err := r.SetBodyParam(o.Parameters); err != nil {
return err
}
// path param resourceGroupName
if err := r.SetPathParam("resourceGroupName", o.ResourceGroupName); 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
}