forked from dynport/gocloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_item.go
27 lines (22 loc) · 881 Bytes
/
get_item.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
package dynamodb
import "github.com/dynport/gocloud/aws"
type GetItem struct {
AttributesToGet []string `json:"AttributesToGet,omitempty"`
ConsistentRead string `json:"ConsistentRead,omitempty"`
Key *Item `json:"Key,omitempty"`
ReturnConsumedCapacity string `json:"ReturnConsumedCapacity,omitempty"`
TableName string `json:"TableName,omitempty"`
}
func (g *GetItem) Execute(client *aws.Client) (*GetItemResponse, error) {
rsp := &GetItemResponse{}
e := loadAction(client, "GetItem", g, rsp)
return rsp, e
}
type GetItemResponse struct {
ConsumedCapacity *ConsumedCapacity `json:"ConsumedCapacity,omitempty"`
Item Item `json:"Item,omitempty"`
}
type ConsumedCapacity struct {
CapacityUnits float64 `json:"CapacityUnits,omitempty"`
TableName string `json:"TableName,omitempty"`
}