service.go 2.1 KB

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