-
Notifications
You must be signed in to change notification settings - Fork 2
/
tasktypegrant.go
132 lines (115 loc) · 3.22 KB
/
tasktypegrant.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
130
131
132
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package shared
import (
"encoding/json"
"fmt"
"github.com/conductorone/conductorone-sdk-go/pkg/utils"
"time"
)
// TaskTypeGrantOutcome - The outcome of the grant.
type TaskTypeGrantOutcome string
const (
TaskTypeGrantOutcomeGrantOutcomeUnspecified TaskTypeGrantOutcome = "GRANT_OUTCOME_UNSPECIFIED"
TaskTypeGrantOutcomeGrantOutcomeGranted TaskTypeGrantOutcome = "GRANT_OUTCOME_GRANTED"
TaskTypeGrantOutcomeGrantOutcomeDenied TaskTypeGrantOutcome = "GRANT_OUTCOME_DENIED"
TaskTypeGrantOutcomeGrantOutcomeError TaskTypeGrantOutcome = "GRANT_OUTCOME_ERROR"
TaskTypeGrantOutcomeGrantOutcomeCancelled TaskTypeGrantOutcome = "GRANT_OUTCOME_CANCELLED"
)
func (e TaskTypeGrantOutcome) ToPointer() *TaskTypeGrantOutcome {
return &e
}
func (e *TaskTypeGrantOutcome) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "GRANT_OUTCOME_UNSPECIFIED":
fallthrough
case "GRANT_OUTCOME_GRANTED":
fallthrough
case "GRANT_OUTCOME_DENIED":
fallthrough
case "GRANT_OUTCOME_ERROR":
fallthrough
case "GRANT_OUTCOME_CANCELLED":
*e = TaskTypeGrantOutcome(v)
return nil
default:
return fmt.Errorf("invalid value for TaskTypeGrantOutcome: %v", v)
}
}
// The TaskTypeGrant message indicates that a task is a grant task and all related details.
type TaskTypeGrant struct {
// The TaskGrantSource message tracks which external URL was the source of the specificed grant ticket.
TaskGrantSource *TaskGrantSource `json:"source,omitempty"`
// The ID of the app entitlement.
AppEntitlementID *string `json:"appEntitlementId,omitempty"`
// The ID of the app.
AppID *string `json:"appId,omitempty"`
// The ID of the app user.
AppUserID *string `json:"appUserId,omitempty"`
GrantDuration *string `json:"grantDuration,omitempty"`
// The ID of the user.
IdentityUserID *string `json:"identityUserId,omitempty"`
// The outcome of the grant.
Outcome *TaskTypeGrantOutcome `json:"outcome,omitempty"`
OutcomeTime *time.Time `json:"outcomeTime,omitempty"`
}
func (t TaskTypeGrant) MarshalJSON() ([]byte, error) {
return utils.MarshalJSON(t, "", false)
}
func (t *TaskTypeGrant) UnmarshalJSON(data []byte) error {
if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil {
return err
}
return nil
}
func (o *TaskTypeGrant) GetTaskGrantSource() *TaskGrantSource {
if o == nil {
return nil
}
return o.TaskGrantSource
}
func (o *TaskTypeGrant) GetAppEntitlementID() *string {
if o == nil {
return nil
}
return o.AppEntitlementID
}
func (o *TaskTypeGrant) GetAppID() *string {
if o == nil {
return nil
}
return o.AppID
}
func (o *TaskTypeGrant) GetAppUserID() *string {
if o == nil {
return nil
}
return o.AppUserID
}
func (o *TaskTypeGrant) GetGrantDuration() *string {
if o == nil {
return nil
}
return o.GrantDuration
}
func (o *TaskTypeGrant) GetIdentityUserID() *string {
if o == nil {
return nil
}
return o.IdentityUserID
}
func (o *TaskTypeGrant) GetOutcome() *TaskTypeGrantOutcome {
if o == nil {
return nil
}
return o.Outcome
}
func (o *TaskTypeGrant) GetOutcomeTime() *time.Time {
if o == nil {
return nil
}
return o.OutcomeTime
}