-
Notifications
You must be signed in to change notification settings - Fork 2
/
approvalinstance.go
129 lines (115 loc) · 3.98 KB
/
approvalinstance.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"fmt"
)
// ApprovalInstanceState - The state of the approval instance
type ApprovalInstanceState string
const (
ApprovalInstanceStateApprovalInstanceStateUnspecified ApprovalInstanceState = "APPROVAL_INSTANCE_STATE_UNSPECIFIED"
ApprovalInstanceStateApprovalInstanceStateInit ApprovalInstanceState = "APPROVAL_INSTANCE_STATE_INIT"
ApprovalInstanceStateApprovalInstanceStateSendingNotifications ApprovalInstanceState = "APPROVAL_INSTANCE_STATE_SENDING_NOTIFICATIONS"
ApprovalInstanceStateApprovalInstanceStateWaiting ApprovalInstanceState = "APPROVAL_INSTANCE_STATE_WAITING"
ApprovalInstanceStateApprovalInstanceStateDone ApprovalInstanceState = "APPROVAL_INSTANCE_STATE_DONE"
)
func (e ApprovalInstanceState) ToPointer() *ApprovalInstanceState {
return &e
}
func (e *ApprovalInstanceState) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "APPROVAL_INSTANCE_STATE_UNSPECIFIED":
fallthrough
case "APPROVAL_INSTANCE_STATE_INIT":
fallthrough
case "APPROVAL_INSTANCE_STATE_SENDING_NOTIFICATIONS":
fallthrough
case "APPROVAL_INSTANCE_STATE_WAITING":
fallthrough
case "APPROVAL_INSTANCE_STATE_DONE":
*e = ApprovalInstanceState(v)
return nil
default:
return fmt.Errorf("invalid value for ApprovalInstanceState: %v", v)
}
}
// ApprovalInstance - The approval instance object describes the way a policy step should be approved as well as its outcomes and state.
//
// This message contains a oneof named outcome. Only a single field of the following list may be set at a time:
// - approved
// - denied
// - reassigned
// - restarted
// - reassignedByError
type ApprovalInstance struct {
// The Approval message.
//
// This message contains a oneof named typ. Only a single field of the following list may be set at a time:
// - users
// - manager
// - appOwners
// - group
// - self
// - entitlementOwners
// - expression
//
Approval *Approval `json:"approval,omitempty"`
// The approved action indicates that the approvalinstance had an outcome of approved.
ApprovedAction *ApprovedAction `json:"approved,omitempty"`
// The denied action indicates that the c1.api.policy.v1.ApprovalInstance had an outcome of denied.
DeniedAction *DeniedAction `json:"denied,omitempty"`
// The ReassignedAction object describes the outcome of a policy step that has been reassigned.
ReassignedAction *ReassignedAction `json:"reassigned,omitempty"`
// The ReassignedByErrorAction object describes the outcome of a policy step that has been reassigned because it had an error provisioning.
ReassignedByErrorAction *ReassignedByErrorAction `json:"reassignedByError,omitempty"`
// The restart action describes the outcome of policy steps for when the task was restarted. This can be applied to multiple steps since restart skips all pending next steps.
RestartAction *RestartAction `json:"restarted,omitempty"`
// The state of the approval instance
State *ApprovalInstanceState `json:"state,omitempty"`
}
func (o *ApprovalInstance) GetApproval() *Approval {
if o == nil {
return nil
}
return o.Approval
}
func (o *ApprovalInstance) GetApprovedAction() *ApprovedAction {
if o == nil {
return nil
}
return o.ApprovedAction
}
func (o *ApprovalInstance) GetDeniedAction() *DeniedAction {
if o == nil {
return nil
}
return o.DeniedAction
}
func (o *ApprovalInstance) GetReassignedAction() *ReassignedAction {
if o == nil {
return nil
}
return o.ReassignedAction
}
func (o *ApprovalInstance) GetReassignedByErrorAction() *ReassignedByErrorAction {
if o == nil {
return nil
}
return o.ReassignedByErrorAction
}
func (o *ApprovalInstance) GetRestartAction() *RestartAction {
if o == nil {
return nil
}
return o.RestartAction
}
func (o *ApprovalInstance) GetState() *ApprovalInstanceState {
if o == nil {
return nil
}
return o.State
}