-
Notifications
You must be signed in to change notification settings - Fork 8
/
Construct.go
119 lines (101 loc) · 2.84 KB
/
Construct.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
package constructs
import (
_init_ "github.com/aws/constructs-go/constructs/v3/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// Represents the building block of the construct graph.
//
// All constructs besides the root construct must be created within the scope of
// another construct.
type Construct interface {
IConstruct
// Perform final modifications before synthesis.
//
// This method can be implemented by derived constructs in order to perform
// final changes before synthesis. prepare() will be called after child
// constructs have been prepared.
//
// This is an advanced framework feature. Only use this if you
// understand the implications.
OnPrepare()
// Allows this construct to emit artifacts into the cloud assembly during synthesis.
//
// This method is usually implemented by framework-level constructs such as `Stack` and `Asset`
// as they participate in synthesizing the cloud assembly.
OnSynthesize(session ISynthesisSession)
// Validate the current construct.
//
// This method can be implemented by derived constructs in order to perform
// validation logic. It is called on all constructs before synthesis.
//
// Returns: An array of validation error messages, or an empty array if there the construct is valid.
// Deprecated: use `Node.addValidation()` to subscribe validation functions on this construct
// instead of overriding this method.
OnValidate() *[]*string
// Returns a string representation of this construct.
ToString() *string
}
// The jsii proxy struct for Construct
type jsiiProxy_Construct struct {
jsiiProxy_IConstruct
}
// Creates a new construct node.
func NewConstruct(scope Construct, id *string, options *ConstructOptions) Construct {
_init_.Initialize()
if err := validateNewConstructParameters(scope, id, options); err != nil {
panic(err)
}
j := jsiiProxy_Construct{}
_jsii_.Create(
"constructs.Construct",
[]interface{}{scope, id, options},
&j,
)
return &j
}
// Creates a new construct node.
func NewConstruct_Override(c Construct, scope Construct, id *string, options *ConstructOptions) {
_init_.Initialize()
_jsii_.Create(
"constructs.Construct",
[]interface{}{scope, id, options},
c,
)
}
func (c *jsiiProxy_Construct) OnPrepare() {
_jsii_.InvokeVoid(
c,
"onPrepare",
nil, // no parameters
)
}
func (c *jsiiProxy_Construct) OnSynthesize(session ISynthesisSession) {
if err := c.validateOnSynthesizeParameters(session); err != nil {
panic(err)
}
_jsii_.InvokeVoid(
c,
"onSynthesize",
[]interface{}{session},
)
}
func (c *jsiiProxy_Construct) OnValidate() *[]*string {
var returns *[]*string
_jsii_.Invoke(
c,
"onValidate",
nil, // no parameters
&returns,
)
return returns
}
func (c *jsiiProxy_Construct) ToString() *string {
var returns *string
_jsii_.Invoke(
c,
"toString",
nil, // no parameters
&returns,
)
return returns
}