-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnative_apm_parameter_definition.go
executable file
·75 lines (65 loc) · 1.93 KB
/
native_apm_parameter_definition.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
package processout
import (
"bytes"
"encoding/json"
"io"
"net/http"
"net/url"
"strings"
"time"
"gopkg.in/processout.v5/errors"
)
// NativeAPMParameterDefinition represents the NativeAPMParameterDefinition API object
type NativeAPMParameterDefinition struct {
// Key is the native APM parameter value key
Key *string `json:"key,omitempty"`
// Type is the nativeAPM parameter value type
Type *string `json:"type,omitempty"`
// Required is the nativeAPM parameter value requirement
Required *bool `json:"required,omitempty"`
// Length is the nativeAPM parameter value length
Length *int `json:"length,omitempty"`
// DisplayName is the native APM parameter display name
DisplayName *string `json:"display_name,omitempty"`
// AvailableValues is the native APM parameter available input values
AvailableValues *[]*NativeAPMParameterValueDefinition `json:"available_values,omitempty"`
client *ProcessOut
}
// SetClient sets the client for the NativeAPMParameterDefinition object and its
// children
func (s *NativeAPMParameterDefinition) SetClient(c *ProcessOut) *NativeAPMParameterDefinition {
if s == nil {
return s
}
s.client = c
return s
}
// Prefil prefills the object with data provided in the parameter
func (s *NativeAPMParameterDefinition) Prefill(c *NativeAPMParameterDefinition) *NativeAPMParameterDefinition {
if c == nil {
return s
}
s.Key = c.Key
s.Type = c.Type
s.Required = c.Required
s.Length = c.Length
s.DisplayName = c.DisplayName
s.AvailableValues = c.AvailableValues
return s
}
// dummyNativeAPMParameterDefinition is a dummy function that's only
// here because some files need specific packages and some don't.
// It's easier to include it for every file. In case you couldn't
// tell, everything is generated.
func dummyNativeAPMParameterDefinition() {
type dummy struct {
a bytes.Buffer
b json.RawMessage
c http.File
d strings.Reader
e time.Time
f url.URL
g io.Reader
}
errors.New(nil, "", "")
}