service.go 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package kinesisvideoarchivedmedia
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/client"
  6. "github.com/aws/aws-sdk-go/aws/client/metadata"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/aws/signer/v4"
  9. "github.com/aws/aws-sdk-go/private/protocol/restjson"
  10. )
  11. // KinesisVideoArchivedMedia provides the API operation methods for making requests to
  12. // Amazon Kinesis Video Streams Archived Media. See this package's package overview docs
  13. // for details on the service.
  14. //
  15. // KinesisVideoArchivedMedia methods are safe to use concurrently. It is not safe to
  16. // modify mutate any of the struct's properties though.
  17. type KinesisVideoArchivedMedia struct {
  18. *client.Client
  19. }
  20. // Used for custom client initialization logic
  21. var initClient func(*client.Client)
  22. // Used for custom request initialization logic
  23. var initRequest func(*request.Request)
  24. // Service information constants
  25. const (
  26. ServiceName = "kinesisvideo" // Name of service.
  27. EndpointsID = ServiceName // ID to lookup a service endpoint with.
  28. ServiceID = "Kinesis Video Archived Media" // ServiceID is a unique identifer of a specific service.
  29. )
  30. // New creates a new instance of the KinesisVideoArchivedMedia client with a session.
  31. // If additional configuration is needed for the client instance use the optional
  32. // aws.Config parameter to add your extra config.
  33. //
  34. // Example:
  35. // // Create a KinesisVideoArchivedMedia client from just a session.
  36. // svc := kinesisvideoarchivedmedia.New(mySession)
  37. //
  38. // // Create a KinesisVideoArchivedMedia client with additional configuration
  39. // svc := kinesisvideoarchivedmedia.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
  40. func New(p client.ConfigProvider, cfgs ...*aws.Config) *KinesisVideoArchivedMedia {
  41. c := p.ClientConfig(EndpointsID, cfgs...)
  42. return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
  43. }
  44. // newClient creates, initializes and returns a new service client instance.
  45. func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *KinesisVideoArchivedMedia {
  46. svc := &KinesisVideoArchivedMedia{
  47. Client: client.New(
  48. cfg,
  49. metadata.ClientInfo{
  50. ServiceName: ServiceName,
  51. ServiceID: ServiceID,
  52. SigningName: signingName,
  53. SigningRegion: signingRegion,
  54. Endpoint: endpoint,
  55. APIVersion: "2017-09-30",
  56. },
  57. handlers,
  58. ),
  59. }
  60. // Handlers
  61. svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
  62. svc.Handlers.Build.PushBackNamed(restjson.BuildHandler)
  63. svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler)
  64. svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler)
  65. svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler)
  66. // Run custom client initialization if present
  67. if initClient != nil {
  68. initClient(svc.Client)
  69. }
  70. return svc
  71. }
  72. // newRequest creates a new request for a KinesisVideoArchivedMedia operation and runs any
  73. // custom request initialization.
  74. func (c *KinesisVideoArchivedMedia) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  75. req := c.NewRequest(op, params, data)
  76. // Run custom request initialization if present
  77. if initRequest != nil {
  78. initRequest(req)
  79. }
  80. return req
  81. }