| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | package pinpoint |
||
| 2 | |||
| 3 | import ( |
||
| 4 | "context" |
||
| 5 | |||
| 6 | SDK "github.com/aws/aws-sdk-go-v2/service/pinpoint" |
||
| 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 | // DeleteUserEndpoints executes `DeleteUserEndpoints` operation. |
||
| 13 | func (svc *Pinpoint) DeleteUserEndpoints(ctx context.Context, r DeleteUserEndpointsRequest) (*DeleteUserEndpointsResult, error) { |
||
| 14 | out, err := svc.RawDeleteUserEndpoints(ctx, r.ToInput()) |
||
| 15 | if err != nil { |
||
| 16 | err = svc.errWrap(errors.ErrorData{ |
||
| 17 | Err: err, |
||
| 18 | AWSOperation: "DeleteUserEndpoints", |
||
| 19 | }) |
||
| 20 | svc.Errorf(err.Error()) |
||
|
|
|||
| 21 | return nil, err |
||
| 22 | } |
||
| 23 | return NewDeleteUserEndpointsResult(out), nil |
||
| 24 | } |
||
| 25 | |||
| 26 | // DeleteUserEndpointsRequest has parameters for `DeleteUserEndpoints` operation. |
||
| 27 | type DeleteUserEndpointsRequest struct { |
||
| 28 | ApplicationID string |
||
| 29 | UserID string |
||
| 30 | } |
||
| 31 | |||
| 32 | func (r DeleteUserEndpointsRequest) ToInput() *SDK.DeleteUserEndpointsInput { |
||
| 33 | in := &SDK.DeleteUserEndpointsInput{} |
||
| 34 | if r.ApplicationID != "" { |
||
| 35 | in.ApplicationId = pointers.String(r.ApplicationID) |
||
| 36 | } |
||
| 37 | if r.UserID != "" { |
||
| 38 | in.UserId = pointers.String(r.UserID) |
||
| 39 | } |
||
| 40 | return in |
||
| 41 | } |
||
| 42 | |||
| 43 | type DeleteUserEndpointsResult struct { |
||
| 44 | EndpointsResponse |
||
| 45 | } |
||
| 46 | |||
| 47 | func NewDeleteUserEndpointsResult(o *SDK.DeleteUserEndpointsResponse) *DeleteUserEndpointsResult { |
||
| 48 | result := &DeleteUserEndpointsResult{} |
||
| 49 | if o == nil { |
||
| 50 | return result |
||
| 51 | } |
||
| 52 | |||
| 53 | result.EndpointsResponse = newEndpointsResponse(o.EndpointsResponse) |
||
| 54 | return result |
||
| 55 | } |
||
| 56 |