| Total Lines | 50 |
| 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 | // GetApp executes `GetApp` operation. |
||
| 13 | func (svc *Pinpoint) GetApp(ctx context.Context, r GetAppRequest) (*GetAppResult, error) { |
||
| 14 | out, err := svc.RawGetApp(ctx, r.ToInput()) |
||
| 15 | if err != nil { |
||
| 16 | err = svc.errWrap(errors.ErrorData{ |
||
| 17 | Err: err, |
||
| 18 | AWSOperation: "GetApp", |
||
| 19 | }) |
||
| 20 | svc.Errorf(err.Error()) |
||
|
|
|||
| 21 | return nil, err |
||
| 22 | } |
||
| 23 | return NewGetAppResult(out), nil |
||
| 24 | } |
||
| 25 | |||
| 26 | // GetAppRequest has parameters for `GetApp` operation. |
||
| 27 | type GetAppRequest struct { |
||
| 28 | ApplicationID string |
||
| 29 | } |
||
| 30 | |||
| 31 | func (r GetAppRequest) ToInput() *SDK.GetAppInput { |
||
| 32 | in := &SDK.GetAppInput{} |
||
| 33 | if r.ApplicationID != "" { |
||
| 34 | in.ApplicationId = pointers.String(r.ApplicationID) |
||
| 35 | } |
||
| 36 | return in |
||
| 37 | } |
||
| 38 | |||
| 39 | type GetAppResult struct { |
||
| 40 | ApplicationResponse |
||
| 41 | } |
||
| 42 | |||
| 43 | func NewGetAppResult(o *SDK.GetAppResponse) *GetAppResult { |
||
| 44 | result := &GetAppResult{} |
||
| 45 | if o == nil { |
||
| 46 | return result |
||
| 47 | } |
||
| 48 | |||
| 49 | result.ApplicationResponse = newApplicationResponse(o.ApplicationResponse) |
||
| 50 | return result |
||
| 51 | } |
||
| 52 |