Passed
Push — master ( 0cc65a...2c9229 )
by eval
02:27 queued 43s
created

athena.StopQueryExecutionRequest.ToInput   A

Complexity

Conditions 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nop 0
dl 0
loc 7
rs 10
c 0
b 0
f 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())
0 ignored issues
show
introduced by
can't check non-constant format in call to Errorf
Loading history...
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 {
0 ignored issues
show
introduced by
exported method StopQueryExecutionRequest.ToInput should have comment or be unexported
Loading history...
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 {
0 ignored issues
show
introduced by
exported type StopQueryExecutionResult should have comment or be unexported
Loading history...
41
}
42
43
func NewStopQueryExecutionResult(o *SDK.StopQueryExecutionResponse) *StopQueryExecutionResult {
0 ignored issues
show
introduced by
exported function NewStopQueryExecutionResult should have comment or be unexported
Loading history...
44
	result := &StopQueryExecutionResult{}
45
	return result
46
}
47