mirror of
https://github.com/openziti/zrok.git
synced 2025-08-20 04:28:40 +02:00
duration parameter (#319)
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/go-openapi/runtime"
|
||||
cr "github.com/go-openapi/runtime/client"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
)
|
||||
|
||||
// NewGetEnvironmentMetricsParams creates a new GetEnvironmentMetricsParams object,
|
||||
@@ -61,6 +62,9 @@ GetEnvironmentMetricsParams contains all the parameters to send to the API endpo
|
||||
*/
|
||||
type GetEnvironmentMetricsParams struct {
|
||||
|
||||
// Duration.
|
||||
Duration *float64
|
||||
|
||||
// EnvID.
|
||||
EnvID string
|
||||
|
||||
@@ -117,6 +121,17 @@ 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 *float64) *GetEnvironmentMetricsParams {
|
||||
o.SetDuration(duration)
|
||||
return o
|
||||
}
|
||||
|
||||
// SetDuration adds the duration to the get environment metrics params
|
||||
func (o *GetEnvironmentMetricsParams) SetDuration(duration *float64) {
|
||||
o.Duration = duration
|
||||
}
|
||||
|
||||
// WithEnvID adds the envID to the get environment metrics params
|
||||
func (o *GetEnvironmentMetricsParams) WithEnvID(envID string) *GetEnvironmentMetricsParams {
|
||||
o.SetEnvID(envID)
|
||||
@@ -136,6 +151,23 @@ func (o *GetEnvironmentMetricsParams) WriteToRequest(r runtime.ClientRequest, re
|
||||
}
|
||||
var res []error
|
||||
|
||||
if o.Duration != nil {
|
||||
|
||||
// query param duration
|
||||
var qrDuration float64
|
||||
|
||||
if o.Duration != nil {
|
||||
qrDuration = *o.Duration
|
||||
}
|
||||
qDuration := swag.FormatFloat64(qrDuration)
|
||||
if qDuration != "" {
|
||||
|
||||
if err := r.SetQueryParam("duration", qDuration); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// path param envId
|
||||
if err := r.SetPathParam("envId", o.EnvID); err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user