cloud/azure/resource/client/deployments/deployments_list_parameters.go
package deployments
// 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"
"github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
)
// NewDeploymentsListParams creates a new DeploymentsListParams object
// with the default values initialized.
func NewDeploymentsListParams() *DeploymentsListParams {
var ()
return &DeploymentsListParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeploymentsListParamsWithTimeout creates a new DeploymentsListParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewDeploymentsListParamsWithTimeout(timeout time.Duration) *DeploymentsListParams {
var ()
return &DeploymentsListParams{
timeout: timeout,
}
}
// NewDeploymentsListParamsWithContext creates a new DeploymentsListParams object
// with the default values initialized, and the ability to set a context for a request
func NewDeploymentsListParamsWithContext(ctx context.Context) *DeploymentsListParams {
var ()
return &DeploymentsListParams{
Context: ctx,
}
}
// NewDeploymentsListParamsWithHTTPClient creates a new DeploymentsListParams object
// with the default values initialized, and the ability to set a custom HTTPClient for a request
func NewDeploymentsListParamsWithHTTPClient(client *http.Client) *DeploymentsListParams {
var ()
return &DeploymentsListParams{
HTTPClient: client,
}
}
/*DeploymentsListParams contains all the parameters to send to the API endpoint
for the deployments list operation typically these are written to a http.Request
*/
type DeploymentsListParams struct {
/*NrDollarFilter
The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'.
*/
DollarFilter *string
/*NrDollarTop
The number of results to get. If null is passed, returns all deployments.
*/
DollarTop *int32
/*APIVersion
The API version to use for this operation.
*/
APIVersion string
/*ResourceGroupName
The name of the resource group with the deployments to get. 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 deployments list params
func (o *DeploymentsListParams) WithTimeout(timeout time.Duration) *DeploymentsListParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the deployments list params
func (o *DeploymentsListParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the deployments list params
func (o *DeploymentsListParams) WithContext(ctx context.Context) *DeploymentsListParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the deployments list params
func (o *DeploymentsListParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the deployments list params
func (o *DeploymentsListParams) WithHTTPClient(client *http.Client) *DeploymentsListParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the deployments list params
func (o *DeploymentsListParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithDollarFilter adds the dollarFilter to the deployments list params
func (o *DeploymentsListParams) WithDollarFilter(dollarFilter *string) *DeploymentsListParams {
o.SetDollarFilter(dollarFilter)
return o
}
// SetDollarFilter adds the dollarFilter to the deployments list params
func (o *DeploymentsListParams) SetDollarFilter(dollarFilter *string) {
o.DollarFilter = dollarFilter
}
// WithDollarTop adds the dollarTop to the deployments list params
func (o *DeploymentsListParams) WithDollarTop(dollarTop *int32) *DeploymentsListParams {
o.SetDollarTop(dollarTop)
return o
}
// SetDollarTop adds the dollarTop to the deployments list params
func (o *DeploymentsListParams) SetDollarTop(dollarTop *int32) {
o.DollarTop = dollarTop
}
// WithAPIVersion adds the aPIVersion to the deployments list params
func (o *DeploymentsListParams) WithAPIVersion(aPIVersion string) *DeploymentsListParams {
o.SetAPIVersion(aPIVersion)
return o
}
// SetAPIVersion adds the apiVersion to the deployments list params
func (o *DeploymentsListParams) SetAPIVersion(aPIVersion string) {
o.APIVersion = aPIVersion
}
// WithResourceGroupName adds the resourceGroupName to the deployments list params
func (o *DeploymentsListParams) WithResourceGroupName(resourceGroupName string) *DeploymentsListParams {
o.SetResourceGroupName(resourceGroupName)
return o
}
// SetResourceGroupName adds the resourceGroupName to the deployments list params
func (o *DeploymentsListParams) SetResourceGroupName(resourceGroupName string) {
o.ResourceGroupName = resourceGroupName
}
// WithSubscriptionID adds the subscriptionID to the deployments list params
func (o *DeploymentsListParams) WithSubscriptionID(subscriptionID string) *DeploymentsListParams {
o.SetSubscriptionID(subscriptionID)
return o
}
// SetSubscriptionID adds the subscriptionId to the deployments list params
func (o *DeploymentsListParams) SetSubscriptionID(subscriptionID string) {
o.SubscriptionID = subscriptionID
}
// WriteToRequest writes these params to a swagger request
func (o *DeploymentsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.DollarFilter != nil {
// query param $filter
var qrNrDollarFilter string
if o.DollarFilter != nil {
qrNrDollarFilter = *o.DollarFilter
}
qNrDollarFilter := qrNrDollarFilter
if qNrDollarFilter != "" {
if err := r.SetQueryParam("$filter", qNrDollarFilter); err != nil {
return err
}
}
}
if o.DollarTop != nil {
// query param $top
var qrNrDollarTop int32
if o.DollarTop != nil {
qrNrDollarTop = *o.DollarTop
}
qNrDollarTop := swag.FormatInt32(qrNrDollarTop)
if qNrDollarTop != "" {
if err := r.SetQueryParam("$top", qNrDollarTop); err != nil {
return err
}
}
}
// query param api-version
qrAPIVersion := o.APIVersion
qAPIVersion := qrAPIVersion
if qAPIVersion != "" {
if err := r.SetQueryParam("api-version", qAPIVersion); 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
}