zrok/rest_client_zrok/metadata/get_environment_metrics_parameters.go

181 lines
5.2 KiB
Go
Raw Normal View History

2023-05-09 20:16:01 +02:00
// Code generated by go-swagger; DO NOT EDIT.
package metadata
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
2023-05-09 22:36:50 +02:00
"github.com/go-openapi/swag"
2023-05-09 20:16:01 +02:00
)
// NewGetEnvironmentMetricsParams creates a new GetEnvironmentMetricsParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewGetEnvironmentMetricsParams() *GetEnvironmentMetricsParams {
return &GetEnvironmentMetricsParams{
timeout: cr.DefaultTimeout,
}
}
// NewGetEnvironmentMetricsParamsWithTimeout creates a new GetEnvironmentMetricsParams object
// with the ability to set a timeout on a request.
func NewGetEnvironmentMetricsParamsWithTimeout(timeout time.Duration) *GetEnvironmentMetricsParams {
return &GetEnvironmentMetricsParams{
timeout: timeout,
}
}
// NewGetEnvironmentMetricsParamsWithContext creates a new GetEnvironmentMetricsParams object
// with the ability to set a context for a request.
func NewGetEnvironmentMetricsParamsWithContext(ctx context.Context) *GetEnvironmentMetricsParams {
return &GetEnvironmentMetricsParams{
Context: ctx,
}
}
// NewGetEnvironmentMetricsParamsWithHTTPClient creates a new GetEnvironmentMetricsParams object
// with the ability to set a custom HTTPClient for a request.
func NewGetEnvironmentMetricsParamsWithHTTPClient(client *http.Client) *GetEnvironmentMetricsParams {
return &GetEnvironmentMetricsParams{
HTTPClient: client,
}
}
/*
GetEnvironmentMetricsParams contains all the parameters to send to the API endpoint
for the get environment metrics operation.
Typically these are written to a http.Request.
*/
type GetEnvironmentMetricsParams struct {
// Duration.
Duration *string
// EnvID.
2023-05-09 22:36:50 +02:00
EnvID float64
2023-05-09 20:16:01 +02:00
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the get environment metrics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetEnvironmentMetricsParams) WithDefaults() *GetEnvironmentMetricsParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the get environment metrics params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GetEnvironmentMetricsParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the get environment metrics params
func (o *GetEnvironmentMetricsParams) WithTimeout(timeout time.Duration) *GetEnvironmentMetricsParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the get environment metrics params
func (o *GetEnvironmentMetricsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the get environment metrics params
func (o *GetEnvironmentMetricsParams) WithContext(ctx context.Context) *GetEnvironmentMetricsParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the get environment metrics params
func (o *GetEnvironmentMetricsParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the get environment metrics params
func (o *GetEnvironmentMetricsParams) WithHTTPClient(client *http.Client) *GetEnvironmentMetricsParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the get environment metrics params
func (o *GetEnvironmentMetricsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithDuration adds the duration to the get environment metrics params
func (o *GetEnvironmentMetricsParams) WithDuration(duration *string) *GetEnvironmentMetricsParams {
o.SetDuration(duration)
return o
}
// SetDuration adds the duration to the get environment metrics params
func (o *GetEnvironmentMetricsParams) SetDuration(duration *string) {
o.Duration = duration
}
// WithEnvID adds the envID to the get environment metrics params
2023-05-09 22:36:50 +02:00
func (o *GetEnvironmentMetricsParams) WithEnvID(envID float64) *GetEnvironmentMetricsParams {
2023-05-09 20:16:01 +02:00
o.SetEnvID(envID)
return o
}
// SetEnvID adds the envId to the get environment metrics params
2023-05-09 22:36:50 +02:00
func (o *GetEnvironmentMetricsParams) SetEnvID(envID float64) {
2023-05-09 20:16:01 +02:00
o.EnvID = envID
}
// WriteToRequest writes these params to a swagger request
func (o *GetEnvironmentMetricsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.Duration != nil {
// query param duration
var qrDuration string
if o.Duration != nil {
qrDuration = *o.Duration
}
qDuration := qrDuration
if qDuration != "" {
if err := r.SetQueryParam("duration", qDuration); err != nil {
return err
}
}
}
// path param envId
2023-05-09 22:36:50 +02:00
if err := r.SetPathParam("envId", swag.FormatFloat64(o.EnvID)); err != nil {
2023-05-09 20:16:01 +02:00
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}