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

ssm/client_op_delete_parameter.go   A

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 21
dl 0
loc 35
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A ssm.DeleteParameterRequest.ToInput 0 6 2
A ssm.*SSM.DeleteParameter 0 10 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
	"github.com/evalphobia/aws-sdk-go-v2-wrapper/private/pointers"
10
)
11
12
// DeleteParameter executes `DeleteParameter` operation.
13
func (svc *SSM) DeleteParameter(ctx context.Context, r DeleteParameterRequest) error {
14
	_, err := svc.RawDeleteParameter(ctx, r.ToInput())
15
	if err != nil {
16
		err = svc.errWrap(errors.ErrorData{
17
			Err:          err,
18
			AWSOperation: "DeleteParameter",
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
	}
22
	return err
23
}
24
25
// DeleteParameterRequest has parameters for `DeleteParameter` operation.
26
type DeleteParameterRequest struct {
27
	Name string
28
}
29
30
func (r DeleteParameterRequest) ToInput() *SDK.DeleteParameterInput {
0 ignored issues
show
introduced by
exported method DeleteParameterRequest.ToInput should have comment or be unexported
Loading history...
31
	in := &SDK.DeleteParameterInput{}
32
	if r.Name != "" {
33
		in.Name = pointers.String(r.Name)
34
	}
35
	return in
36
}
37