-
Notifications
You must be signed in to change notification settings - Fork 29
/
transit_gateway_vpc_attachment.go
41 lines (35 loc) · 1.25 KB
/
transit_gateway_vpc_attachment.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
package aiven
import "context"
type (
// TransitGatewayVPCAttachmentHandler is the client that interacts with the
// Transit Gateway VPC Attachment API on Aiven.
TransitGatewayVPCAttachmentHandler struct {
client *Client
}
// TransitGatewayVPCAttachmentRequest holds the parameters to create a new
// or update an existing Transit Gateway VPC Attachment.
TransitGatewayVPCAttachmentRequest struct {
Add []TransitGatewayVPCAttachment `json:"add"`
Delete []string `json:"delete"`
}
// TransitGatewayVPCAttachment represents Transit Gateway VPC Attachment
TransitGatewayVPCAttachment struct {
CIDR string `json:"cidr"`
PeerCloudAccount string `json:"peer_cloud_account"`
PeerResourceGroup *string `json:"peer_resource_group"`
PeerVPC string `json:"peer_vpc"`
}
)
// Update updates user-defined peer network CIDRs for a project VPC
func (h *TransitGatewayVPCAttachmentHandler) Update(
ctx context.Context,
project, projectVPCId string,
req TransitGatewayVPCAttachmentRequest,
) (*VPC, error) {
path := buildPath("project", project, "vpcs", projectVPCId, "user-peer-network-cidrs")
rsp, err := h.client.doPutRequest(ctx, path, req)
if err != nil {
return nil, err
}
return parseVPCResponse(rsp)
}