-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_op_ExportBundle.go
170 lines (137 loc) · 5.05 KB
/
api_op_ExportBundle.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package mobile
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
// Request structure used to request generation of custom SDK and tool packages
// required to integrate mobile web or app clients with backed AWS resources.
type ExportBundleInput struct {
_ struct{} `type:"structure"`
// Unique bundle identifier.
//
// BundleId is a required field
BundleId *string `location:"uri" locationName:"bundleId" type:"string" required:"true"`
// Developer desktop or target application platform.
Platform Platform `location:"querystring" locationName:"platform" type:"string" enum:"true"`
// Unique project identifier.
ProjectId *string `location:"querystring" locationName:"projectId" type:"string"`
}
// String returns the string representation
func (s ExportBundleInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ExportBundleInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ExportBundleInput"}
if s.BundleId == nil {
invalidParams.Add(aws.NewErrParamRequired("BundleId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s ExportBundleInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{})
if s.BundleId != nil {
v := *s.BundleId
metadata := protocol.Metadata{}
e.SetValue(protocol.PathTarget, "bundleId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if len(s.Platform) > 0 {
v := s.Platform
metadata := protocol.Metadata{}
e.SetValue(protocol.QueryTarget, "platform", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.ProjectId != nil {
v := *s.ProjectId
metadata := protocol.Metadata{}
e.SetValue(protocol.QueryTarget, "projectId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Result structure which contains link to download custom-generated SDK and
// tool packages used to integrate mobile web or app clients with backed AWS
// resources.
type ExportBundleOutput struct {
_ struct{} `type:"structure"`
// URL which contains the custom-generated SDK and tool packages used to integrate
// the client mobile app or web app with the AWS resources created by the AWS
// Mobile Hub project.
DownloadUrl *string `locationName:"downloadUrl" type:"string"`
}
// String returns the string representation
func (s ExportBundleOutput) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s ExportBundleOutput) MarshalFields(e protocol.FieldEncoder) error {
if s.DownloadUrl != nil {
v := *s.DownloadUrl
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "downloadUrl", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
const opExportBundle = "ExportBundle"
// ExportBundleRequest returns a request value for making API operation for
// AWS Mobile.
//
// Generates customized software development kit (SDK) and or tool packages
// used to integrate mobile web or mobile app clients with backend AWS resources.
//
// // Example sending a request using ExportBundleRequest.
// req := client.ExportBundleRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/mobile-2017-07-01/ExportBundle
func (c *Client) ExportBundleRequest(input *ExportBundleInput) ExportBundleRequest {
op := &aws.Operation{
Name: opExportBundle,
HTTPMethod: "POST",
HTTPPath: "/bundles/{bundleId}",
}
if input == nil {
input = &ExportBundleInput{}
}
req := c.newRequest(op, input, &ExportBundleOutput{})
return ExportBundleRequest{Request: req, Input: input, Copy: c.ExportBundleRequest}
}
// ExportBundleRequest is the request type for the
// ExportBundle API operation.
type ExportBundleRequest struct {
*aws.Request
Input *ExportBundleInput
Copy func(*ExportBundleInput) ExportBundleRequest
}
// Send marshals and sends the ExportBundle API request.
func (r ExportBundleRequest) Send(ctx context.Context) (*ExportBundleResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &ExportBundleResponse{
ExportBundleOutput: r.Request.Data.(*ExportBundleOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// ExportBundleResponse is the response type for the
// ExportBundle API operation.
type ExportBundleResponse struct {
*ExportBundleOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// ExportBundle request.
func (r *ExportBundleResponse) SDKResponseMetdata() *aws.Response {
return r.response
}