-
Notifications
You must be signed in to change notification settings - Fork 6
/
inputs.go
43 lines (34 loc) · 921 Bytes
/
inputs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package models
import (
"encoding/json"
"fmt"
"net/url"
"strconv"
"strings"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// These imports may not be used depending on the input parameters
var _ = json.Marshal
var _ = fmt.Sprintf
var _ = url.QueryEscape
var _ = strconv.FormatInt
var _ = strings.Replace
var _ = validate.Maximum
var _ = strfmt.NewFormats
// HealthInput holds the input parameters for a health operation.
type HealthInput struct {
Section int64
}
// Validate returns an error if any of the HealthInput parameters don't satisfy the
// requirements from the swagger yml file.
func (i HealthInput) Validate() error {
return nil
}
// Path returns the URI path for the input.
func (i HealthInput) Path() (string, error) {
path := "/v1/health"
urlVals := url.Values{}
urlVals.Add("section", strconv.FormatInt(i.Section, 10))
return path + "?" + urlVals.Encode(), nil
}