/
androidjobtemplate_types.go
72 lines (57 loc) · 2.04 KB
/
androidjobtemplate_types.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
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// Major WIP
type Activity string
type ActionType string
const (
CommandActivity Activity = "Command"
InstallActivity Activity = "Install"
WaitActivity Activity = "Wait"
InteractActivity Activity = "Interact"
)
const (
ClickAction ActionType = "Click"
TypeAction ActionType = "TypeText"
)
// AndroidJobTemplateSpec defines the desired state of AndroidJobTemplate
type AndroidJobTemplateSpec struct {
Actions []Action `json:"actions"`
}
type Action struct {
Activity Activity `json:"activity"`
Name string `json:"name,omitempty"`
RunAsRoot bool `json:"runAsRoot,omitempty"`
Commands []string `json:"commands,omitempty"`
APKUrl string `json:"apkURL,omitempty"`
Seconds int `json:"seconds,omitempty"`
Interactions []Interaction `json:"interactions,omitempty"`
}
type Interaction struct {
Type ActionType `json:"type,omitempty"`
Target string `json:"target,omitempty"`
Input string `json:"input,omitempty"`
}
// AndroidJobTemplateStatus defines the observed state of AndroidJobTemplate
type AndroidJobTemplateStatus struct{}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// AndroidJobTemplate is the Schema for the androidjobtemplates API
// +kubebuilder:subresource:status
// +kubebuilder:resource:path=androidjobtemplates,scope=Cluster
type AndroidJobTemplate struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec AndroidJobTemplateSpec `json:"spec,omitempty"`
Status AndroidJobTemplateStatus `json:"status,omitempty"`
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// AndroidJobTemplateList contains a list of AndroidJobTemplate
type AndroidJobTemplateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []AndroidJobTemplate `json:"items"`
}
func init() {
SchemeBuilder.Register(&AndroidJobTemplate{}, &AndroidJobTemplateList{})
}