~ubuntu-branches/debian/stretch/golang-github-aws-aws-sdk-go/stretch

« back to all changes in this revision

Viewing changes to service/lambda/service.go

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2015-09-29 12:34:07 UTC
  • Revision ID: package-import@ubuntu.com-20150929123407-7xmll3gdhvb9zh2l
Tags: upstream-0.9.9+dfsg
ImportĀ upstreamĀ versionĀ 0.9.9+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
 
2
 
 
3
package lambda
 
4
 
 
5
import (
 
6
        "github.com/aws/aws-sdk-go/aws"
 
7
        "github.com/aws/aws-sdk-go/aws/defaults"
 
8
        "github.com/aws/aws-sdk-go/aws/request"
 
9
        "github.com/aws/aws-sdk-go/aws/service"
 
10
        "github.com/aws/aws-sdk-go/aws/service/serviceinfo"
 
11
        "github.com/aws/aws-sdk-go/internal/protocol/restjson"
 
12
        "github.com/aws/aws-sdk-go/internal/signer/v4"
 
13
)
 
14
 
 
15
// Overview
 
16
//
 
17
// This is the AWS Lambda API Reference. The AWS Lambda Developer Guide provides
 
18
// additional information. For the service overview, go to What is AWS Lambda
 
19
// (http://docs.aws.amazon.com/lambda/latest/dg/welcome.html), and for information
 
20
// about how the service works, go to AWS Lambda: How it Works (http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduction.html)
 
21
// in the AWS Lambda Developer Guide.
 
22
type Lambda struct {
 
23
        *service.Service
 
24
}
 
25
 
 
26
// Used for custom service initialization logic
 
27
var initService func(*service.Service)
 
28
 
 
29
// Used for custom request initialization logic
 
30
var initRequest func(*request.Request)
 
31
 
 
32
// New returns a new Lambda client.
 
33
func New(config *aws.Config) *Lambda {
 
34
        service := &service.Service{
 
35
                ServiceInfo: serviceinfo.ServiceInfo{
 
36
                        Config:      defaults.DefaultConfig.Merge(config),
 
37
                        ServiceName: "lambda",
 
38
                        APIVersion:  "2015-03-31",
 
39
                },
 
40
        }
 
41
        service.Initialize()
 
42
 
 
43
        // Handlers
 
44
        service.Handlers.Sign.PushBack(v4.Sign)
 
45
        service.Handlers.Build.PushBack(restjson.Build)
 
46
        service.Handlers.Unmarshal.PushBack(restjson.Unmarshal)
 
47
        service.Handlers.UnmarshalMeta.PushBack(restjson.UnmarshalMeta)
 
48
        service.Handlers.UnmarshalError.PushBack(restjson.UnmarshalError)
 
49
 
 
50
        // Run custom service initialization if present
 
51
        if initService != nil {
 
52
                initService(service)
 
53
        }
 
54
 
 
55
        return &Lambda{service}
 
56
}
 
57
 
 
58
// newRequest creates a new request for a Lambda operation and runs any
 
59
// custom request initialization.
 
60
func (c *Lambda) newRequest(op *request.Operation, params, data interface{}) *request.Request {
 
61
        req := c.NewRequest(op, params, data)
 
62
 
 
63
        // Run custom request initialization if present
 
64
        if initRequest != nil {
 
65
                initRequest(req)
 
66
        }
 
67
 
 
68
        return req
 
69
}