service.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package codecommit
  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/jsonrpc"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // This is the AWS CodeCommit API Reference. This reference provides descriptions
  13. // of the AWS CodeCommit API.
  14. //
  15. // You can use the AWS CodeCommit API to work with the following objects:
  16. //
  17. // Repositories Branches Commits For information about how to use AWS CodeCommit,
  18. // see the AWS CodeCommit User Guide.
  19. type CodeCommit 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 CodeCommit client.
  27. func New(config *aws.Config) *CodeCommit {
  28. service := &service.Service{
  29. ServiceInfo: serviceinfo.ServiceInfo{
  30. Config: defaults.DefaultConfig.Merge(config),
  31. ServiceName: "codecommit",
  32. APIVersion: "2015-04-13",
  33. JSONVersion: "1.1",
  34. TargetPrefix: "CodeCommit_20150413",
  35. },
  36. }
  37. service.Initialize()
  38. // Handlers
  39. service.Handlers.Sign.PushBack(v4.Sign)
  40. service.Handlers.Build.PushBack(jsonrpc.Build)
  41. service.Handlers.Unmarshal.PushBack(jsonrpc.Unmarshal)
  42. service.Handlers.UnmarshalMeta.PushBack(jsonrpc.UnmarshalMeta)
  43. service.Handlers.UnmarshalError.PushBack(jsonrpc.UnmarshalError)
  44. // Run custom service initialization if present
  45. if initService != nil {
  46. initService(service)
  47. }
  48. return &CodeCommit{service}
  49. }
  50. // newRequest creates a new request for a CodeCommit operation and runs any
  51. // custom request initialization.
  52. func (c *CodeCommit) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  53. req := c.NewRequest(op, params, data)
  54. // Run custom request initialization if present
  55. if initRequest != nil {
  56. initRequest(req)
  57. }
  58. return req
  59. }