-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
reporting_sales_finance_reports.go
47 lines (42 loc) · 2.04 KB
/
reporting_sales_finance_reports.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package asc
import (
"bytes"
"context"
"io"
)
// DownloadFinanceReportsQuery are query options for DownloadFinanceReports
//
// https://developer.apple.com/documentation/appstoreconnectapi/download_finance_reports
type DownloadFinanceReportsQuery struct {
FilterRegionCode []string `url:"filter[regionCode]"`
FilterReportDate []string `url:"filter[reportDate]"`
FilterReportType []string `url:"filter[reportType]"`
FilterVendorNumber []string `url:"filter[vendorNumber]"`
}
// DownloadSalesAndTrendsReportsQuery are query options for DownloadSalesAndTrendsReports
//
// https://developer.apple.com/documentation/appstoreconnectapi/download_sales_and_trends_reports
type DownloadSalesAndTrendsReportsQuery struct {
FilterFrequency []string `url:"filter[frequency]"`
FilterReportDate []string `url:"filter[reportDate],omitempty"`
FilterReportSubType []string `url:"filter[reportSubType]"`
FilterReportType []string `url:"filter[reportType]"`
FilterVendorNumber []string `url:"filter[vendorNumber]"`
FilterVersion []string `url:"filter[version],omitempty"`
}
// DownloadFinanceReports downloads finance reports filtered by your specified criteria.
//
// https://developer.apple.com/documentation/appstoreconnectapi/download_finance_reports
func (s *ReportingService) DownloadFinanceReports(ctx context.Context, params *DownloadFinanceReportsQuery) (io.Reader, *Response, error) {
buffer := new(bytes.Buffer)
resp, err := s.client.get(ctx, "financeReports", params, buffer, withAccept("application/a-gzip"))
return buffer, resp, err
}
// DownloadSalesAndTrendsReports downloads sales and trends reports filtered by your specified criteria.
//
// https://developer.apple.com/documentation/appstoreconnectapi/download_sales_and_trends_reports
func (s *ReportingService) DownloadSalesAndTrendsReports(ctx context.Context, params *DownloadSalesAndTrendsReportsQuery) (io.Reader, *Response, error) {
buffer := new(bytes.Buffer)
resp, err := s.client.get(ctx, "salesReports", params, buffer, withAccept("application/a-gzip"))
return buffer, resp, err
}