/
api_op_GetJobManifest.go
141 lines (117 loc) · 4.19 KB
/
api_op_GetJobManifest.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
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package snowball
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type GetJobManifestInput struct {
_ struct{} `type:"structure"`
// The ID for a job that you want to get the manifest file for, for example
// JID123e4567-e89b-12d3-a456-426655440000.
//
// JobId is a required field
JobId *string `min:"39" type:"string" required:"true"`
}
// String returns the string representation
func (s GetJobManifestInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetJobManifestInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "GetJobManifestInput"}
if s.JobId == nil {
invalidParams.Add(aws.NewErrParamRequired("JobId"))
}
if s.JobId != nil && len(*s.JobId) < 39 {
invalidParams.Add(aws.NewErrParamMinLen("JobId", 39))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
type GetJobManifestOutput struct {
_ struct{} `type:"structure"`
// The Amazon S3 presigned URL for the manifest file associated with the specified
// JobId value.
ManifestURI *string `min:"1" type:"string"`
}
// String returns the string representation
func (s GetJobManifestOutput) String() string {
return awsutil.Prettify(s)
}
const opGetJobManifest = "GetJobManifest"
// GetJobManifestRequest returns a request value for making API operation for
// Amazon Import/Export Snowball.
//
// Returns a link to an Amazon S3 presigned URL for the manifest file associated
// with the specified JobId value. You can access the manifest file for up to
// 60 minutes after this request has been made. To access the manifest file
// after 60 minutes have passed, you'll have to make another call to the GetJobManifest
// action.
//
// The manifest is an encrypted file that you can download after your job enters
// the WithCustomer status. The manifest is decrypted by using the UnlockCode
// code value, when you pass both values to the Snowball through the Snowball
// client when the client is started for the first time.
//
// As a best practice, we recommend that you don't save a copy of an UnlockCode
// value in the same location as the manifest file for that job. Saving these
// separately helps prevent unauthorized parties from gaining access to the
// Snowball associated with that job.
//
// The credentials of a given job, including its manifest file and unlock code,
// expire 90 days after the job is created.
//
// // Example sending a request using GetJobManifestRequest.
// req := client.GetJobManifestRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/snowball-2016-06-30/GetJobManifest
func (c *Client) GetJobManifestRequest(input *GetJobManifestInput) GetJobManifestRequest {
op := &aws.Operation{
Name: opGetJobManifest,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetJobManifestInput{}
}
req := c.newRequest(op, input, &GetJobManifestOutput{})
return GetJobManifestRequest{Request: req, Input: input, Copy: c.GetJobManifestRequest}
}
// GetJobManifestRequest is the request type for the
// GetJobManifest API operation.
type GetJobManifestRequest struct {
*aws.Request
Input *GetJobManifestInput
Copy func(*GetJobManifestInput) GetJobManifestRequest
}
// Send marshals and sends the GetJobManifest API request.
func (r GetJobManifestRequest) Send(ctx context.Context) (*GetJobManifestResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &GetJobManifestResponse{
GetJobManifestOutput: r.Request.Data.(*GetJobManifestOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// GetJobManifestResponse is the response type for the
// GetJobManifest API operation.
type GetJobManifestResponse struct {
*GetJobManifestOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// GetJobManifest request.
func (r *GetJobManifestResponse) SDKResponseMetdata() *aws.Response {
return r.response
}