service.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. package iam
  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/query"
  10. "github.com/aws/aws-sdk-go/internal/signer/v4"
  11. )
  12. // AWS Identity and Access Management (IAM) is a web service that you can use
  13. // to manage users and user permissions under your AWS account. This guide provides
  14. // descriptions of IAM actions that you can call programmatically. For general
  15. // information about IAM, see AWS Identity and Access Management (IAM) (http://aws.amazon.com/iam/).
  16. // For the user guide for IAM, see Using IAM (http://docs.aws.amazon.com/IAM/latest/UserGuide/).
  17. //
  18. // AWS provides SDKs that consist of libraries and sample code for various
  19. // programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.).
  20. // The SDKs provide a convenient way to create programmatic access to IAM and
  21. // AWS. For example, the SDKs take care of tasks such as cryptographically signing
  22. // requests (see below), managing errors, and retrying requests automatically.
  23. // For information about the AWS SDKs, including how to download and install
  24. // them, see the Tools for Amazon Web Services (http://aws.amazon.com/tools/)
  25. // page. We recommend that you use the AWS SDKs to make programmatic API calls
  26. // to IAM. However, you can also use the IAM Query API to make direct calls
  27. // to the IAM web service. To learn more about the IAM Query API, see Making
  28. // Query Requests (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html)
  29. // in the Using IAM guide. IAM supports GET and POST requests for all actions.
  30. // That is, the API does not require you to use GET for some actions and POST
  31. // for others. However, GET requests are subject to the limitation size of a
  32. // URL. Therefore, for operations that require larger sizes, use a POST request.
  33. //
  34. // Signing Requests
  35. //
  36. // Requests must be signed using an access key ID and a secret access key.
  37. // We strongly recommend that you do not use your AWS account access key ID
  38. // and secret access key for everyday work with IAM. You can use the access
  39. // key ID and secret access key for an IAM user or you can use the AWS Security
  40. // Token Service to generate temporary security credentials and use those to
  41. // sign requests.
  42. //
  43. // To sign requests, we recommend that you use Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
  44. // If you have an existing application that uses Signature Version 2, you do
  45. // not have to update it to use Signature Version 4. However, some operations
  46. // now require Signature Version 4. The documentation for operations that require
  47. // version 4 indicate this requirement.
  48. //
  49. // Additional Resources
  50. //
  51. // For more information, see the following:
  52. //
  53. // AWS Security Credentials (http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html).
  54. // This topic provides general information about the types of credentials used
  55. // for accessing AWS. IAM Best Practices (http://docs.aws.amazon.com/IAM/latest/UserGuide/IAMBestPractices.html).
  56. // This topic presents a list of suggestions for using the IAM service to help
  57. // secure your AWS resources. AWS Security Token Service (http://docs.aws.amazon.com/STS/latest/UsingSTS/).
  58. // This guide describes how to create and use temporary security credentials.
  59. // Signing AWS API Requests (http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html).
  60. // This set of topics walk you through the process of signing a request using
  61. // an access key ID and secret access key.
  62. type IAM struct {
  63. *service.Service
  64. }
  65. // Used for custom service initialization logic
  66. var initService func(*service.Service)
  67. // Used for custom request initialization logic
  68. var initRequest func(*request.Request)
  69. // New returns a new IAM client.
  70. func New(config *aws.Config) *IAM {
  71. service := &service.Service{
  72. ServiceInfo: serviceinfo.ServiceInfo{
  73. Config: defaults.DefaultConfig.Merge(config),
  74. ServiceName: "iam",
  75. APIVersion: "2010-05-08",
  76. },
  77. }
  78. service.Initialize()
  79. // Handlers
  80. service.Handlers.Sign.PushBack(v4.Sign)
  81. service.Handlers.Build.PushBack(query.Build)
  82. service.Handlers.Unmarshal.PushBack(query.Unmarshal)
  83. service.Handlers.UnmarshalMeta.PushBack(query.UnmarshalMeta)
  84. service.Handlers.UnmarshalError.PushBack(query.UnmarshalError)
  85. // Run custom service initialization if present
  86. if initService != nil {
  87. initService(service)
  88. }
  89. return &IAM{service}
  90. }
  91. // newRequest creates a new request for a IAM operation and runs any
  92. // custom request initialization.
  93. func (c *IAM) newRequest(op *request.Operation, params, data interface{}) *request.Request {
  94. req := c.NewRequest(op, params, data)
  95. // Run custom request initialization if present
  96. if initRequest != nil {
  97. initRequest(req)
  98. }
  99. return req
  100. }