/
PartitionKey.go
121 lines (99 loc) · 2.21 KB
/
PartitionKey.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
package awsappsync
import (
_init_ "github.com/aws/aws-cdk-go/awscdk/v2/jsii"
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
)
// Specifies the assignment to the partition key.
//
// It can be
// enhanced with the assignment of the sort key.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import "github.com/aws/aws-cdk-go/awscdk"
//
// var assign assign
//
// partitionKey := awscdk.Aws_appsync.NewPartitionKey(assign)
//
type PartitionKey interface {
PrimaryKey
Pkey() Assign
// Renders the key assignment to a VTL string.
RenderTemplate() *string
// Allows assigning a value to the sort key.
Sort(key *string) SortKeyStep
}
// The jsii proxy struct for PartitionKey
type jsiiProxy_PartitionKey struct {
jsiiProxy_PrimaryKey
}
func (j *jsiiProxy_PartitionKey) Pkey() Assign {
var returns Assign
_jsii_.Get(
j,
"pkey",
&returns,
)
return returns
}
func NewPartitionKey(pkey Assign) PartitionKey {
_init_.Initialize()
if err := validateNewPartitionKeyParameters(pkey); err != nil {
panic(err)
}
j := jsiiProxy_PartitionKey{}
_jsii_.Create(
"aws-cdk-lib.aws_appsync.PartitionKey",
[]interface{}{pkey},
&j,
)
return &j
}
func NewPartitionKey_Override(p PartitionKey, pkey Assign) {
_init_.Initialize()
_jsii_.Create(
"aws-cdk-lib.aws_appsync.PartitionKey",
[]interface{}{pkey},
p,
)
}
// Allows assigning a value to the partition key.
func PartitionKey_Partition(key *string) PartitionKeyStep {
_init_.Initialize()
if err := validatePartitionKey_PartitionParameters(key); err != nil {
panic(err)
}
var returns PartitionKeyStep
_jsii_.StaticInvoke(
"aws-cdk-lib.aws_appsync.PartitionKey",
"partition",
[]interface{}{key},
&returns,
)
return returns
}
func (p *jsiiProxy_PartitionKey) RenderTemplate() *string {
var returns *string
_jsii_.Invoke(
p,
"renderTemplate",
nil, // no parameters
&returns,
)
return returns
}
func (p *jsiiProxy_PartitionKey) Sort(key *string) SortKeyStep {
if err := p.validateSortParameters(key); err != nil {
panic(err)
}
var returns SortKeyStep
_jsii_.Invoke(
p,
"sort",
[]interface{}{key},
&returns,
)
return returns
}