-
Notifications
You must be signed in to change notification settings - Fork 17
/
awsiam_IPrincipal.go
116 lines (103 loc) · 2.9 KB
/
awsiam_IPrincipal.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
package awsiam
import (
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// Represents a logical IAM principal.
//
// An IPrincipal describes a logical entity that can perform AWS API calls
// against sets of resources, optionally under certain conditions.
//
// Examples of simple principals are IAM objects that you create, such
// as Users or Roles.
//
// An example of a more complex principals is a `ServicePrincipal` (such as
// `new ServicePrincipal("sns.amazonaws.com")`, which represents the Simple
// Notifications Service).
//
// A single logical Principal may also map to a set of physical principals.
// For example, `new OrganizationPrincipal('o-1234')` represents all
// identities that are part of the given AWS Organization.
// Experimental.
type IPrincipal interface {
IGrantable
// Add to the policy of this principal.
//
// Returns: true if the statement was added, false if the principal in
// question does not have a policy document to add the statement to.
// Deprecated: Use `addToPrincipalPolicy` instead.
AddToPolicy(statement PolicyStatement) *bool
// Add to the policy of this principal.
// Experimental.
AddToPrincipalPolicy(statement PolicyStatement) *AddToPrincipalPolicyResult
// When this Principal is used in an AssumeRole policy, the action to use.
// Experimental.
AssumeRoleAction() *string
// Return the policy fragment that identifies this principal in a Policy.
// Experimental.
PolicyFragment() PrincipalPolicyFragment
// The AWS account ID of this principal.
//
// Can be undefined when the account is not known
// (for example, for service principals).
// Can be a Token - in that case,
// it's assumed to be AWS::AccountId.
// Experimental.
PrincipalAccount() *string
}
// The jsii proxy for IPrincipal
type jsiiProxy_IPrincipal struct {
jsiiProxy_IGrantable
}
func (i *jsiiProxy_IPrincipal) AddToPolicy(statement PolicyStatement) *bool {
if err := i.validateAddToPolicyParameters(statement); err != nil {
panic(err)
}
var returns *bool
_jsii_.Invoke(
i,
"addToPolicy",
[]interface{}{statement},
&returns,
)
return returns
}
func (i *jsiiProxy_IPrincipal) AddToPrincipalPolicy(statement PolicyStatement) *AddToPrincipalPolicyResult {
if err := i.validateAddToPrincipalPolicyParameters(statement); err != nil {
panic(err)
}
var returns *AddToPrincipalPolicyResult
_jsii_.Invoke(
i,
"addToPrincipalPolicy",
[]interface{}{statement},
&returns,
)
return returns
}
func (j *jsiiProxy_IPrincipal) AssumeRoleAction() *string {
var returns *string
_jsii_.Get(
j,
"assumeRoleAction",
&returns,
)
return returns
}
func (j *jsiiProxy_IPrincipal) PolicyFragment() PrincipalPolicyFragment {
var returns PrincipalPolicyFragment
_jsii_.Get(
j,
"policyFragment",
&returns,
)
return returns
}
func (j *jsiiProxy_IPrincipal) PrincipalAccount() *string {
var returns *string
_jsii_.Get(
j,
"principalAccount",
&returns,
)
return returns
}