service.go 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package cognitosync
  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. // Amazon Cognito Sync provides an AWS service and client library that enable
  13. // cross-device syncing of application-related user data. High-level client
  14. // libraries are available for both iOS and Android. You can use these libraries
  15. // to persist data locally so that it's available even if the device is offline.
  16. // Developer credentials don't need to be stored on the mobile device to access
  17. // the service. You can use Amazon Cognito to obtain a normalized user ID and
  18. // credentials. User data is persisted in a dataset that can store up to 1 MB
  19. // of key-value pairs, and you can have up to 20 datasets per user identity.
  20. //
  21. // With Amazon Cognito Sync, the data stored for each identity is accessible
  22. // only to credentials assigned to that identity. In order to use the Cognito
  23. // Sync service, you need to make API calls using credentials retrieved with
  24. // Amazon Cognito Identity service (http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/Welcome.html).
  25. //
  26. // If you want to use Cognito Sync in an Android or iOS application, you will
  27. // probably want to make API calls via the AWS Mobile SDK. To learn more, see
  28. // the Developer Guide for Android (http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-sync.html)
  29. // and the Developer Guide for iOS (http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-sync.html).
  30. type CognitoSync struct {
  31. *service.Service
  32. }
  33. // Used for custom service initialization logic
  34. var initService func(*service.Service)
  35. // Used for custom request initialization logic
  36. var initRequest func(*request.Request)
  37. // New returns a new CognitoSync client.
  38. func New(config *aws.Config) *CognitoSync {
  39. service := &service.Service{
  40. ServiceInfo: serviceinfo.ServiceInfo{
  41. Config: defaults.DefaultConfig.Merge(config),
  42. ServiceName: "cognito-sync",
  43. APIVersion: "2014-06-30",
  44. },
  45. }
  46. service.Initialize()
  47. // Handlers
  48. service.Handlers.Sign.PushBack(v4.Sign)
  49. service.Handlers.Build.PushBack(restjson.Build)
  50. service.Handlers.Unmarshal.PushBack(restjson.Unmarshal)
  51. service.Handlers.UnmarshalMeta.PushBack(restjson.UnmarshalMeta)
  52. service.Handlers.UnmarshalError.PushBack(restjson.UnmarshalError)
  53. // Run custom service initialization if present
  54. if initService != nil {
  55. initService(service)
  56. }
  57. return &CognitoSync{service}
  58. }
  59. // newRequest creates a new request for a CognitoSync operation and runs any
  60. // custom request initialization.
  61. func (c *CognitoSync) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  62. req := c.NewRequest(op, params, data)
  63. // Run custom request initialization if present
  64. if initRequest != nil {
  65. initRequest(req)
  66. }
  67. return req
  68. }