Passed
Push — master ( 44e67e...3437b8 )
by eval
01:37
created

ssm/client_op_delete_parameters.go   A

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 30
dl 0
loc 49
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A ssm.NewDeleteParametersResult 0 9 2
A ssm.DeleteParametersRequest.ToInput 0 4 1
A ssm.*SSM.DeleteParameters 0 11 2
1
package ssm
2
3
import (
4
	"context"
5
6
	SDK "github.com/aws/aws-sdk-go-v2/service/ssm"
7
8
	"github.com/evalphobia/aws-sdk-go-v2-wrapper/errors"
9
)
10
11
// DeleteParameters executes `DeleteParameters` operation.
12
func (svc *SSM) DeleteParameters(ctx context.Context, r DeleteParametersRequest) (*DeleteParametersResult, error) {
13
	out, err := svc.RawDeleteParameters(ctx, r.ToInput())
14
	if err != nil {
15
		err = svc.errWrap(errors.ErrorData{
16
			Err:          err,
17
			AWSOperation: "DeleteParameters",
18
		})
19
		svc.Errorf(err.Error())
0 ignored issues
show
introduced by
can't check non-constant format in call to Errorf
Loading history...
20
		return nil, err
21
	}
22
	return NewDeleteParametersResult(out), err
23
}
24
25
// DeleteParametersRequest has parameters for `DeleteParameters` operation.
26
type DeleteParametersRequest struct {
27
	Names []string
28
}
29
30
func (r DeleteParametersRequest) ToInput() *SDK.DeleteParametersInput {
0 ignored issues
show
introduced by
exported method DeleteParametersRequest.ToInput should have comment or be unexported
Loading history...
31
	in := &SDK.DeleteParametersInput{}
32
	in.Names = r.Names
33
	return in
34
}
35
36
type DeleteParametersResult struct {
0 ignored issues
show
introduced by
exported type DeleteParametersResult should have comment or be unexported
Loading history...
37
	DeletedParameters []string
38
	InvalidParameters []string
39
}
40
41
func NewDeleteParametersResult(o *SDK.DeleteParametersResponse) *DeleteParametersResult {
0 ignored issues
show
introduced by
exported function NewDeleteParametersResult should have comment or be unexported
Loading history...
42
	result := &DeleteParametersResult{}
43
	if o == nil {
44
		return result
45
	}
46
47
	result.DeletedParameters = o.DeletedParameters
48
	result.InvalidParameters = o.InvalidParameters
49
	return result
50
}
51