forked from seamapi/go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
health.go
93 lines (80 loc) · 2.35 KB
/
health.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// This file was auto-generated by Fern from our API Definition.
package api
import (
json "encoding/json"
fmt "fmt"
core "github.com/seamapi/go/core"
)
type HealthGetServiceHealthRequest struct {
Service string `json:"service"`
}
type HealthGetHealthResponse struct {
Ok bool `json:"ok"`
LastServiceEvaluationAt *string `json:"last_service_evaluation_at,omitempty"`
ServiceHealthStatuses []*ServiceHealth `json:"service_health_statuses,omitempty"`
msg string
_rawJSON json.RawMessage
}
func (h *HealthGetHealthResponse) Msg() string {
return h.msg
}
func (h *HealthGetHealthResponse) UnmarshalJSON(data []byte) error {
type unmarshaler HealthGetHealthResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*h = HealthGetHealthResponse(value)
h.msg = "I’m one with the Force. The Force is with me."
h._rawJSON = json.RawMessage(data)
return nil
}
func (h *HealthGetHealthResponse) MarshalJSON() ([]byte, error) {
type embed HealthGetHealthResponse
var marshaler = struct {
embed
Msg string `json:"msg"`
}{
embed: embed(*h),
Msg: "I’m one with the Force. The Force is with me.",
}
return json.Marshal(marshaler)
}
func (h *HealthGetHealthResponse) String() string {
if len(h._rawJSON) > 0 {
if value, err := core.StringifyJSON(h._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(h); err == nil {
return value
}
return fmt.Sprintf("%#v", h)
}
type HealthGetServiceHealthResponse struct {
Ok bool `json:"ok"`
LastServiceEvaluationAt string `json:"last_service_evaluation_at"`
ServiceHealth *ServiceHealth `json:"service_health,omitempty"`
_rawJSON json.RawMessage
}
func (h *HealthGetServiceHealthResponse) UnmarshalJSON(data []byte) error {
type unmarshaler HealthGetServiceHealthResponse
var value unmarshaler
if err := json.Unmarshal(data, &value); err != nil {
return err
}
*h = HealthGetServiceHealthResponse(value)
h._rawJSON = json.RawMessage(data)
return nil
}
func (h *HealthGetServiceHealthResponse) String() string {
if len(h._rawJSON) > 0 {
if value, err := core.StringifyJSON(h._rawJSON); err == nil {
return value
}
}
if value, err := core.StringifyJSON(h); err == nil {
return value
}
return fmt.Sprintf("%#v", h)
}