Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package athena |
||
2 | |||
3 | import ( |
||
4 | "context" |
||
5 | |||
6 | SDK "github.com/aws/aws-sdk-go-v2/service/athena" |
||
7 | |||
8 | "github.com/evalphobia/aws-sdk-go-v2-wrapper/errors" |
||
9 | "github.com/evalphobia/aws-sdk-go-v2-wrapper/private/pointers" |
||
10 | ) |
||
11 | |||
12 | // StopQueryExecution executes `StopQueryExecution` operation. |
||
13 | func (svc *Athena) StopQueryExecution(ctx context.Context, r StopQueryExecutionRequest) (*StopQueryExecutionResult, error) { |
||
14 | out, err := svc.RawStopQueryExecution(ctx, r.ToInput()) |
||
15 | if err != nil { |
||
16 | err = svc.errWrap(errors.ErrorData{ |
||
17 | Err: err, |
||
18 | AWSOperation: "StopQueryExecution", |
||
19 | }) |
||
20 | svc.Errorf(err.Error()) |
||
|
|||
21 | return nil, err |
||
22 | } |
||
23 | return NewStopQueryExecutionResult(out), nil |
||
24 | } |
||
25 | |||
26 | // StopQueryExecutionRequest has parameters for `StopQueryExecution` operation. |
||
27 | type StopQueryExecutionRequest struct { |
||
28 | QueryExecutionID string |
||
29 | } |
||
30 | |||
31 | func (r StopQueryExecutionRequest) ToInput() *SDK.StopQueryExecutionInput { |
||
32 | in := &SDK.StopQueryExecutionInput{} |
||
33 | |||
34 | if r.QueryExecutionID != "" { |
||
35 | in.QueryExecutionId = pointers.String(r.QueryExecutionID) |
||
36 | } |
||
37 | return in |
||
38 | } |
||
39 | |||
40 | type StopQueryExecutionResult struct { |
||
41 | } |
||
42 | |||
43 | func NewStopQueryExecutionResult(o *SDK.StopQueryExecutionResponse) *StopQueryExecutionResult { |
||
44 | result := &StopQueryExecutionResult{} |
||
45 | return result |
||
46 | } |
||
47 |