api.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
  2. // Package marketplacecommerceanalytics provides a client for AWS Marketplace Commerce Analytics.
  3. package marketplacecommerceanalytics
  4. import (
  5. "time"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. )
  9. const opGenerateDataSet = "GenerateDataSet"
  10. // GenerateDataSetRequest generates a "aws/request.Request" representing the
  11. // client's request for the GenerateDataSet operation. The "output" return
  12. // value can be used to capture response data after the request's "Send" method
  13. // is called.
  14. //
  15. // Creating a request object using this method should be used when you want to inject
  16. // custom logic into the request's lifecycle using a custom handler, or if you want to
  17. // access properties on the request object before or after sending the request. If
  18. // you just want the service response, call the GenerateDataSet method directly
  19. // instead.
  20. //
  21. // Note: You must call the "Send" method on the returned request object in order
  22. // to execute the request.
  23. //
  24. // // Example sending a request using the GenerateDataSetRequest method.
  25. // req, resp := client.GenerateDataSetRequest(params)
  26. //
  27. // err := req.Send()
  28. // if err == nil { // resp is now filled
  29. // fmt.Println(resp)
  30. // }
  31. //
  32. func (c *MarketplaceCommerceAnalytics) GenerateDataSetRequest(input *GenerateDataSetInput) (req *request.Request, output *GenerateDataSetOutput) {
  33. op := &request.Operation{
  34. Name: opGenerateDataSet,
  35. HTTPMethod: "POST",
  36. HTTPPath: "/",
  37. }
  38. if input == nil {
  39. input = &GenerateDataSetInput{}
  40. }
  41. req = c.newRequest(op, input, output)
  42. output = &GenerateDataSetOutput{}
  43. req.Data = output
  44. return
  45. }
  46. // Given a data set type and data set publication date, asynchronously publishes
  47. // the requested data set to the specified S3 bucket and notifies the specified
  48. // SNS topic once the data is available. Returns a unique request identifier
  49. // that can be used to correlate requests with notifications from the SNS topic.
  50. // Data sets will be published in comma-separated values (CSV) format with the
  51. // file name {data_set_type}_YYYY-MM-DD.csv. If a file with the same name already
  52. // exists (e.g. if the same data set is requested twice), the original file
  53. // will be overwritten by the new file. Requires a Role with an attached permissions
  54. // policy providing Allow permissions for the following actions: s3:PutObject,
  55. // s3:GetBucketLocation, sns:GetTopicAttributes, sns:Publish, iam:GetRolePolicy.
  56. func (c *MarketplaceCommerceAnalytics) GenerateDataSet(input *GenerateDataSetInput) (*GenerateDataSetOutput, error) {
  57. req, out := c.GenerateDataSetRequest(input)
  58. err := req.Send()
  59. return out, err
  60. }
  61. const opStartSupportDataExport = "StartSupportDataExport"
  62. // StartSupportDataExportRequest generates a "aws/request.Request" representing the
  63. // client's request for the StartSupportDataExport operation. The "output" return
  64. // value can be used to capture response data after the request's "Send" method
  65. // is called.
  66. //
  67. // Creating a request object using this method should be used when you want to inject
  68. // custom logic into the request's lifecycle using a custom handler, or if you want to
  69. // access properties on the request object before or after sending the request. If
  70. // you just want the service response, call the StartSupportDataExport method directly
  71. // instead.
  72. //
  73. // Note: You must call the "Send" method on the returned request object in order
  74. // to execute the request.
  75. //
  76. // // Example sending a request using the StartSupportDataExportRequest method.
  77. // req, resp := client.StartSupportDataExportRequest(params)
  78. //
  79. // err := req.Send()
  80. // if err == nil { // resp is now filled
  81. // fmt.Println(resp)
  82. // }
  83. //
  84. func (c *MarketplaceCommerceAnalytics) StartSupportDataExportRequest(input *StartSupportDataExportInput) (req *request.Request, output *StartSupportDataExportOutput) {
  85. op := &request.Operation{
  86. Name: opStartSupportDataExport,
  87. HTTPMethod: "POST",
  88. HTTPPath: "/",
  89. }
  90. if input == nil {
  91. input = &StartSupportDataExportInput{}
  92. }
  93. req = c.newRequest(op, input, output)
  94. output = &StartSupportDataExportOutput{}
  95. req.Data = output
  96. return
  97. }
  98. // Given a data set type and a from date, asynchronously publishes the requested
  99. // customer support data to the specified S3 bucket and notifies the specified
  100. // SNS topic once the data is available. Returns a unique request identifier
  101. // that can be used to correlate requests with notifications from the SNS topic.
  102. // Data sets will be published in comma-separated values (CSV) format with the
  103. // file name {data_set_type}_YYYY-MM-DD'T'HH-mm-ss'Z'.csv. If a file with the
  104. // same name already exists (e.g. if the same data set is requested twice),
  105. // the original file will be overwritten by the new file. Requires a Role with
  106. // an attached permissions policy providing Allow permissions for the following
  107. // actions: s3:PutObject, s3:GetBucketLocation, sns:GetTopicAttributes, sns:Publish,
  108. // iam:GetRolePolicy.
  109. func (c *MarketplaceCommerceAnalytics) StartSupportDataExport(input *StartSupportDataExportInput) (*StartSupportDataExportOutput, error) {
  110. req, out := c.StartSupportDataExportRequest(input)
  111. err := req.Send()
  112. return out, err
  113. }
  114. // Container for the parameters to the GenerateDataSet operation.
  115. type GenerateDataSetInput struct {
  116. _ struct{} `type:"structure"`
  117. // (Optional) Key-value pairs which will be returned, unmodified, in the Amazon
  118. // SNS notification message and the data set metadata file. These key-value
  119. // pairs can be used to correlated responses with tracking information from
  120. // other systems.
  121. CustomerDefinedValues map[string]*string `locationName:"customerDefinedValues" min:"1" type:"map"`
  122. // The date a data set was published. For daily data sets, provide a date with
  123. // day-level granularity for the desired day. For weekly data sets, provide
  124. // a date with day-level granularity within the desired week (the day value
  125. // will be ignored). For monthly data sets, provide a date with month-level
  126. // granularity for the desired month (the day value will be ignored).
  127. DataSetPublicationDate *time.Time `locationName:"dataSetPublicationDate" type:"timestamp" timestampFormat:"unix" required:"true"`
  128. // The desired data set type.
  129. //
  130. // customer_subscriber_hourly_monthly_subscriptions - Available daily by
  131. // 5:00 PM Pacific Time since 2014-07-21. customer_subscriber_annual_subscriptions
  132. // - Available daily by 5:00 PM Pacific Time since 2014-07-21. daily_business_usage_by_instance_type
  133. // - Available daily by 5:00 PM Pacific Time since 2015-01-26. daily_business_fees
  134. // - Available daily by 5:00 PM Pacific Time since 2015-01-26. daily_business_free_trial_conversions
  135. // - Available daily by 5:00 PM Pacific Time since 2015-01-26. daily_business_new_instances
  136. // - Available daily by 5:00 PM Pacific Time since 2015-01-26. daily_business_new_product_subscribers
  137. // - Available daily by 5:00 PM Pacific Time since 2015-01-26. daily_business_canceled_product_subscribers
  138. // - Available daily by 5:00 PM Pacific Time since 2015-01-26. monthly_revenue_billing_and_revenue_data
  139. // - Available monthly on the 4th day of the month by 5:00 PM Pacific Time since
  140. // 2015-02. monthly_revenue_annual_subscriptions - Available monthly on the
  141. // 4th day of the month by 5:00 PM Pacific Time since 2015-02. disbursed_amount_by_product
  142. // - Available every 30 days by 5:00 PM Pacific Time since 2015-01-26. disbursed_amount_by_product_with_uncollected_funds
  143. // -This data set is only available from 2012-04-19 until 2015-01-25. After
  144. // 2015-01-25, this data set was split into three data sets: disbursed_amount_by_product,
  145. // disbursed_amount_by_age_of_uncollected_funds, and disbursed_amount_by_age_of_disbursed_funds.
  146. // disbursed_amount_by_customer_geo - Available every 30 days by 5:00 PM Pacific
  147. // Time since 2012-04-19. disbursed_amount_by_age_of_uncollected_funds - Available
  148. // every 30 days by 5:00 PM Pacific Time since 2015-01-26. disbursed_amount_by_age_of_disbursed_funds
  149. // - Available every 30 days by 5:00 PM Pacific Time since 2015-01-26. customer_profile_by_industry
  150. // - Available daily by 5:00 PM Pacific Time since 2015-10-01. customer_profile_by_revenue
  151. // - Available daily by 5:00 PM Pacific Time since 2015-10-01. customer_profile_by_geography
  152. // - Available daily by 5:00 PM Pacific Time since 2015-10-01.
  153. DataSetType *string `locationName:"dataSetType" min:"1" type:"string" required:"true" enum:"DataSetType"`
  154. // The name (friendly name, not ARN) of the destination S3 bucket.
  155. DestinationS3BucketName *string `locationName:"destinationS3BucketName" min:"1" type:"string" required:"true"`
  156. // (Optional) The desired S3 prefix for the published data set, similar to a
  157. // directory path in standard file systems. For example, if given the bucket
  158. // name "mybucket" and the prefix "myprefix/mydatasets", the output file "outputfile"
  159. // would be published to "s3://mybucket/myprefix/mydatasets/outputfile". If
  160. // the prefix directory structure does not exist, it will be created. If no
  161. // prefix is provided, the data set will be published to the S3 bucket root.
  162. DestinationS3Prefix *string `locationName:"destinationS3Prefix" type:"string"`
  163. // The Amazon Resource Name (ARN) of the Role with an attached permissions policy
  164. // to interact with the provided AWS services.
  165. RoleNameArn *string `locationName:"roleNameArn" min:"1" type:"string" required:"true"`
  166. // Amazon Resource Name (ARN) for the SNS Topic that will be notified when the
  167. // data set has been published or if an error has occurred.
  168. SnsTopicArn *string `locationName:"snsTopicArn" min:"1" type:"string" required:"true"`
  169. }
  170. // String returns the string representation
  171. func (s GenerateDataSetInput) String() string {
  172. return awsutil.Prettify(s)
  173. }
  174. // GoString returns the string representation
  175. func (s GenerateDataSetInput) GoString() string {
  176. return s.String()
  177. }
  178. // Validate inspects the fields of the type to determine if they are valid.
  179. func (s *GenerateDataSetInput) Validate() error {
  180. invalidParams := request.ErrInvalidParams{Context: "GenerateDataSetInput"}
  181. if s.CustomerDefinedValues != nil && len(s.CustomerDefinedValues) < 1 {
  182. invalidParams.Add(request.NewErrParamMinLen("CustomerDefinedValues", 1))
  183. }
  184. if s.DataSetPublicationDate == nil {
  185. invalidParams.Add(request.NewErrParamRequired("DataSetPublicationDate"))
  186. }
  187. if s.DataSetType == nil {
  188. invalidParams.Add(request.NewErrParamRequired("DataSetType"))
  189. }
  190. if s.DataSetType != nil && len(*s.DataSetType) < 1 {
  191. invalidParams.Add(request.NewErrParamMinLen("DataSetType", 1))
  192. }
  193. if s.DestinationS3BucketName == nil {
  194. invalidParams.Add(request.NewErrParamRequired("DestinationS3BucketName"))
  195. }
  196. if s.DestinationS3BucketName != nil && len(*s.DestinationS3BucketName) < 1 {
  197. invalidParams.Add(request.NewErrParamMinLen("DestinationS3BucketName", 1))
  198. }
  199. if s.RoleNameArn == nil {
  200. invalidParams.Add(request.NewErrParamRequired("RoleNameArn"))
  201. }
  202. if s.RoleNameArn != nil && len(*s.RoleNameArn) < 1 {
  203. invalidParams.Add(request.NewErrParamMinLen("RoleNameArn", 1))
  204. }
  205. if s.SnsTopicArn == nil {
  206. invalidParams.Add(request.NewErrParamRequired("SnsTopicArn"))
  207. }
  208. if s.SnsTopicArn != nil && len(*s.SnsTopicArn) < 1 {
  209. invalidParams.Add(request.NewErrParamMinLen("SnsTopicArn", 1))
  210. }
  211. if invalidParams.Len() > 0 {
  212. return invalidParams
  213. }
  214. return nil
  215. }
  216. // Container for the result of the GenerateDataSet operation.
  217. type GenerateDataSetOutput struct {
  218. _ struct{} `type:"structure"`
  219. // A unique identifier representing a specific request to the GenerateDataSet
  220. // operation. This identifier can be used to correlate a request with notifications
  221. // from the SNS topic.
  222. DataSetRequestId *string `locationName:"dataSetRequestId" type:"string"`
  223. }
  224. // String returns the string representation
  225. func (s GenerateDataSetOutput) String() string {
  226. return awsutil.Prettify(s)
  227. }
  228. // GoString returns the string representation
  229. func (s GenerateDataSetOutput) GoString() string {
  230. return s.String()
  231. }
  232. // Container for the parameters to the StartSupportDataExport operation.
  233. type StartSupportDataExportInput struct {
  234. _ struct{} `type:"structure"`
  235. // (Optional) Key-value pairs which will be returned, unmodified, in the Amazon
  236. // SNS notification message and the data set metadata file.
  237. CustomerDefinedValues map[string]*string `locationName:"customerDefinedValues" min:"1" type:"map"`
  238. // Specifies the data set type to be written to the output csv file. The data
  239. // set types customer_support_contacts_data and test_customer_support_contacts_data
  240. // both result in a csv file containing the following fields: Product Id, Customer
  241. // Guid, Subscription Guid, Subscription Start Date, Organization, AWS Account
  242. // Id, Given Name, Surname, Telephone Number, Email, Title, Country Code, ZIP
  243. // Code, Operation Type, and Operation Time. Currently, only the test_customer_support_contacts_data
  244. // value is supported
  245. //
  246. // customer_support_contacts_data Customer support contact data. The data
  247. // set will contain all changes (Creates, Updates, and Deletes) to customer
  248. // support contact data from the date specified in the from_date parameter.
  249. // test_customer_support_contacts_data An example data set containing static
  250. // test data in the same format as customer_support_contacts_data
  251. DataSetType *string `locationName:"dataSetType" min:"1" type:"string" required:"true" enum:"SupportDataSetType"`
  252. // The name (friendly name, not ARN) of the destination S3 bucket.
  253. DestinationS3BucketName *string `locationName:"destinationS3BucketName" min:"1" type:"string" required:"true"`
  254. // (Optional) The desired S3 prefix for the published data set, similar to a
  255. // directory path in standard file systems. For example, if given the bucket
  256. // name "mybucket" and the prefix "myprefix/mydatasets", the output file "outputfile"
  257. // would be published to "s3://mybucket/myprefix/mydatasets/outputfile". If
  258. // the prefix directory structure does not exist, it will be created. If no
  259. // prefix is provided, the data set will be published to the S3 bucket root.
  260. DestinationS3Prefix *string `locationName:"destinationS3Prefix" type:"string"`
  261. // The start date from which to retrieve the data set. This parameter only affects
  262. // the customer_support_contacts_data data set type.
  263. FromDate *time.Time `locationName:"fromDate" type:"timestamp" timestampFormat:"unix" required:"true"`
  264. // The Amazon Resource Name (ARN) of the Role with an attached permissions policy
  265. // to interact with the provided AWS services.
  266. RoleNameArn *string `locationName:"roleNameArn" min:"1" type:"string" required:"true"`
  267. // Amazon Resource Name (ARN) for the SNS Topic that will be notified when the
  268. // data set has been published or if an error has occurred.
  269. SnsTopicArn *string `locationName:"snsTopicArn" min:"1" type:"string" required:"true"`
  270. }
  271. // String returns the string representation
  272. func (s StartSupportDataExportInput) String() string {
  273. return awsutil.Prettify(s)
  274. }
  275. // GoString returns the string representation
  276. func (s StartSupportDataExportInput) GoString() string {
  277. return s.String()
  278. }
  279. // Validate inspects the fields of the type to determine if they are valid.
  280. func (s *StartSupportDataExportInput) Validate() error {
  281. invalidParams := request.ErrInvalidParams{Context: "StartSupportDataExportInput"}
  282. if s.CustomerDefinedValues != nil && len(s.CustomerDefinedValues) < 1 {
  283. invalidParams.Add(request.NewErrParamMinLen("CustomerDefinedValues", 1))
  284. }
  285. if s.DataSetType == nil {
  286. invalidParams.Add(request.NewErrParamRequired("DataSetType"))
  287. }
  288. if s.DataSetType != nil && len(*s.DataSetType) < 1 {
  289. invalidParams.Add(request.NewErrParamMinLen("DataSetType", 1))
  290. }
  291. if s.DestinationS3BucketName == nil {
  292. invalidParams.Add(request.NewErrParamRequired("DestinationS3BucketName"))
  293. }
  294. if s.DestinationS3BucketName != nil && len(*s.DestinationS3BucketName) < 1 {
  295. invalidParams.Add(request.NewErrParamMinLen("DestinationS3BucketName", 1))
  296. }
  297. if s.FromDate == nil {
  298. invalidParams.Add(request.NewErrParamRequired("FromDate"))
  299. }
  300. if s.RoleNameArn == nil {
  301. invalidParams.Add(request.NewErrParamRequired("RoleNameArn"))
  302. }
  303. if s.RoleNameArn != nil && len(*s.RoleNameArn) < 1 {
  304. invalidParams.Add(request.NewErrParamMinLen("RoleNameArn", 1))
  305. }
  306. if s.SnsTopicArn == nil {
  307. invalidParams.Add(request.NewErrParamRequired("SnsTopicArn"))
  308. }
  309. if s.SnsTopicArn != nil && len(*s.SnsTopicArn) < 1 {
  310. invalidParams.Add(request.NewErrParamMinLen("SnsTopicArn", 1))
  311. }
  312. if invalidParams.Len() > 0 {
  313. return invalidParams
  314. }
  315. return nil
  316. }
  317. // Container for the result of the StartSupportDataExport operation.
  318. type StartSupportDataExportOutput struct {
  319. _ struct{} `type:"structure"`
  320. // A unique identifier representing a specific request to the StartSupportDataExport
  321. // operation. This identifier can be used to correlate a request with notifications
  322. // from the SNS topic.
  323. DataSetRequestId *string `locationName:"dataSetRequestId" type:"string"`
  324. }
  325. // String returns the string representation
  326. func (s StartSupportDataExportOutput) String() string {
  327. return awsutil.Prettify(s)
  328. }
  329. // GoString returns the string representation
  330. func (s StartSupportDataExportOutput) GoString() string {
  331. return s.String()
  332. }
  333. const (
  334. // @enum DataSetType
  335. DataSetTypeCustomerSubscriberHourlyMonthlySubscriptions = "customer_subscriber_hourly_monthly_subscriptions"
  336. // @enum DataSetType
  337. DataSetTypeCustomerSubscriberAnnualSubscriptions = "customer_subscriber_annual_subscriptions"
  338. // @enum DataSetType
  339. DataSetTypeDailyBusinessUsageByInstanceType = "daily_business_usage_by_instance_type"
  340. // @enum DataSetType
  341. DataSetTypeDailyBusinessFees = "daily_business_fees"
  342. // @enum DataSetType
  343. DataSetTypeDailyBusinessFreeTrialConversions = "daily_business_free_trial_conversions"
  344. // @enum DataSetType
  345. DataSetTypeDailyBusinessNewInstances = "daily_business_new_instances"
  346. // @enum DataSetType
  347. DataSetTypeDailyBusinessNewProductSubscribers = "daily_business_new_product_subscribers"
  348. // @enum DataSetType
  349. DataSetTypeDailyBusinessCanceledProductSubscribers = "daily_business_canceled_product_subscribers"
  350. // @enum DataSetType
  351. DataSetTypeMonthlyRevenueBillingAndRevenueData = "monthly_revenue_billing_and_revenue_data"
  352. // @enum DataSetType
  353. DataSetTypeMonthlyRevenueAnnualSubscriptions = "monthly_revenue_annual_subscriptions"
  354. // @enum DataSetType
  355. DataSetTypeDisbursedAmountByProduct = "disbursed_amount_by_product"
  356. // @enum DataSetType
  357. DataSetTypeDisbursedAmountByProductWithUncollectedFunds = "disbursed_amount_by_product_with_uncollected_funds"
  358. // @enum DataSetType
  359. DataSetTypeDisbursedAmountByCustomerGeo = "disbursed_amount_by_customer_geo"
  360. // @enum DataSetType
  361. DataSetTypeDisbursedAmountByAgeOfUncollectedFunds = "disbursed_amount_by_age_of_uncollected_funds"
  362. // @enum DataSetType
  363. DataSetTypeDisbursedAmountByAgeOfDisbursedFunds = "disbursed_amount_by_age_of_disbursed_funds"
  364. // @enum DataSetType
  365. DataSetTypeCustomerProfileByIndustry = "customer_profile_by_industry"
  366. // @enum DataSetType
  367. DataSetTypeCustomerProfileByRevenue = "customer_profile_by_revenue"
  368. // @enum DataSetType
  369. DataSetTypeCustomerProfileByGeography = "customer_profile_by_geography"
  370. )
  371. const (
  372. // @enum SupportDataSetType
  373. SupportDataSetTypeCustomerSupportContactsData = "customer_support_contacts_data"
  374. // @enum SupportDataSetType
  375. SupportDataSetTypeTestCustomerSupportContactsData = "test_customer_support_contacts_data"
  376. )