-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change report type to use union string
- Loading branch information
1 parent
53fe361
commit dafbec1
Showing
19 changed files
with
90 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import * as t from 'io-ts' | ||
|
||
/** | ||
* The type of entity for which the Sponsored Products report should be generated. | ||
*/ | ||
export const SponsoredProductsReportType = t.union([ | ||
t.literal('campaigns'), | ||
t.literal('adGroups'), | ||
t.literal('keywords'), | ||
t.literal('asins'), | ||
t.literal('productAds'), | ||
t.literal('targets'), | ||
]) | ||
export type SponsoredProductsReportType = t.TypeOf<typeof SponsoredProductsReportType> | ||
|
||
/** | ||
* The type of entity for which the Sponsored Brands report should be generated. | ||
*/ | ||
export const SponsoredBrandsReportType = t.union([ | ||
t.literal('campaigns'), | ||
t.literal('adGroups'), | ||
t.literal('keywords'), | ||
t.literal('headlineSearch'), | ||
t.literal('searchTerms'), | ||
t.literal('targets'), | ||
]) | ||
export type SponsoredBrandsReportType = t.TypeOf<typeof SponsoredBrandsReportType> |
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-brands/sponsored-brands-ad-group-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredBrandsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredBrandsReportType } from '../report-types' | ||
import { SponsoredBrandsAdGroupReportMetrics } from '../metrics' | ||
|
||
export interface SponsoredBrandsAdGroupReportParams | ||
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredBrandsAdGroupReportMetrics> { | ||
recordType: SponsoredBrandsReportTypeEnum.AD_GROUPS | ||
extends BaseReportParams<SponsoredBrandsReportType, SponsoredBrandsAdGroupReportMetrics> { | ||
recordType: 'adGroups' | ||
} |
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-brands/sponsored-brands-campaign-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredBrandsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredBrandsReportType } from '../report-types' | ||
import { SponsoredBrandsCampaignReportMetrics } from '../metrics' | ||
|
||
export interface SponsoredBrandsCampaignReportParams | ||
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredBrandsCampaignReportMetrics> { | ||
recordType: SponsoredBrandsReportTypeEnum.CAMPAIGNS | ||
extends BaseReportParams<SponsoredBrandsReportType, SponsoredBrandsCampaignReportMetrics> { | ||
recordType: 'campaigns' | ||
} |
9 changes: 3 additions & 6 deletions
9
src/operations/reports/sponsored-brands/sponsored-brands-headline-search-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredBrandsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredBrandsReportType } from '../report-types' | ||
import { SponsoredBrandsHeadlineSearchReportMetrics } from '../metrics' | ||
|
||
export interface SponsoredBrandsHeadlineSearchReportParams | ||
extends BaseReportParams< | ||
SponsoredBrandsReportTypeEnum, | ||
SponsoredBrandsHeadlineSearchReportMetrics | ||
> { | ||
recordType: SponsoredBrandsReportTypeEnum.HEADLINE_SEARCH | ||
extends BaseReportParams<SponsoredBrandsReportType, SponsoredBrandsHeadlineSearchReportMetrics> { | ||
recordType: 'headlineSearch' | ||
} |
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-brands/sponsored-brands-keyword-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredBrandsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredBrandsReportType } from '../report-types' | ||
import { SponsoredBrandsKeywordReportMetrics } from '../metrics' | ||
|
||
export interface SponsoredBrandsKeywordReportParams | ||
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredBrandsKeywordReportMetrics> { | ||
recordType: SponsoredBrandsReportTypeEnum.KEYWORDS | ||
extends BaseReportParams<SponsoredBrandsReportType, SponsoredBrandsKeywordReportMetrics> { | ||
recordType: 'keywords' | ||
} |
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-brands/sponsored-brands-search-term-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredBrandsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredBrandsReportType } from '../report-types' | ||
import { SponsoredBrandsSearchTermReportMetrics } from '../metrics' | ||
|
||
export interface SponsoredBrandsSearchTermReportParams | ||
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredBrandsSearchTermReportMetrics> { | ||
recordType: SponsoredBrandsReportTypeEnum.SEARCH_TERM | ||
extends BaseReportParams<SponsoredBrandsReportType, SponsoredBrandsSearchTermReportMetrics> { | ||
recordType: 'searchTerms' | ||
} |
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-brands/sponsored-brands-target-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredBrandsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredBrandsReportType } from '../report-types' | ||
import { SponsoredBrandsTargetReportMetrics } from '../metrics' | ||
|
||
export interface SponsoredBrandsTargetReportParams | ||
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredBrandsTargetReportMetrics> { | ||
recordType: SponsoredBrandsReportTypeEnum.TARGETS | ||
extends BaseReportParams<SponsoredBrandsReportType, SponsoredBrandsTargetReportMetrics> { | ||
recordType: 'targets' | ||
} |
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-products/sponsored-products-ad-group-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredProductsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredProductsReportType } from '../report-types' | ||
import { SponsoredProductsAdGroupReportMetrics } from '../metrics/sponsored-products-ad-group-report-metrics' | ||
|
||
export interface SponsoredProductsAdGroupReportParams | ||
extends BaseReportParams<SponsoredProductsReportTypeEnum, SponsoredProductsAdGroupReportMetrics> { | ||
recordType: SponsoredProductsReportTypeEnum.AD_GROUPS | ||
extends BaseReportParams<SponsoredProductsReportType, SponsoredProductsAdGroupReportMetrics> { | ||
recordType: 'adGroups' | ||
} |
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-products/sponsored-products-asins-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredProductsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredProductsReportType } from '../report-types' | ||
import { SponsoredProductsAsinsReportMetrics } from '../metrics/sponsored-products-asins-report-metrics' | ||
|
||
export interface SponsoredProductsAsinsReportParams | ||
extends BaseReportParams<SponsoredProductsReportTypeEnum, SponsoredProductsAsinsReportMetrics> { | ||
recordType: SponsoredProductsReportTypeEnum.ASINS | ||
extends BaseReportParams<SponsoredProductsReportType, SponsoredProductsAsinsReportMetrics> { | ||
recordType: 'asins' | ||
} |
9 changes: 3 additions & 6 deletions
9
src/operations/reports/sponsored-products/sponsored-products-campaign-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredProductsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredProductsReportType } from '../report-types' | ||
import { SponsoredProductsCampaignReportMetrics } from '../metrics/sponsored-products-campaign-report-metrics' | ||
|
||
export interface SponsoredProductsCampaignReportParams | ||
extends BaseReportParams< | ||
SponsoredProductsReportTypeEnum, | ||
SponsoredProductsCampaignReportMetrics | ||
> { | ||
recordType: SponsoredProductsReportTypeEnum.CAMPAIGNS | ||
extends BaseReportParams<SponsoredProductsReportType, SponsoredProductsCampaignReportMetrics> { | ||
recordType: 'campaigns' | ||
} |
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-products/sponsored-products-keyword-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredProductsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredProductsReportType } from '../report-types' | ||
import { SponsoredProductsKeywordReportMetrics } from '../metrics/sponsored-products-keyword-report-metrics' | ||
|
||
export interface SponsoredProductsKeywordReportParams | ||
extends BaseReportParams<SponsoredProductsReportTypeEnum, SponsoredProductsKeywordReportMetrics> { | ||
recordType: SponsoredProductsReportTypeEnum.KEYWORDS | ||
extends BaseReportParams<SponsoredProductsReportType, SponsoredProductsKeywordReportMetrics> { | ||
recordType: 'keywords' | ||
} |
9 changes: 3 additions & 6 deletions
9
src/operations/reports/sponsored-products/sponsored-products-product-ads-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredProductsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredProductsReportType } from '../report-types' | ||
import { SponsoredProductsProductAdsReportMetrics } from '../metrics/sponsored-products-product-ads-report-metrics' | ||
|
||
export interface SponsoredProductsProductAdsReportParams | ||
extends BaseReportParams< | ||
SponsoredProductsReportTypeEnum, | ||
SponsoredProductsProductAdsReportMetrics | ||
> { | ||
recordType: SponsoredProductsReportTypeEnum.PRODUCT_ADS | ||
extends BaseReportParams<SponsoredProductsReportType, SponsoredProductsProductAdsReportMetrics> { | ||
recordType: 'productAds' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/operations/reports/sponsored-products/sponsored-products-targets-report-params.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { BaseReportParams } from '../base-report-params' | ||
import { SponsoredProductsReportTypeEnum } from '../report-types-enum' | ||
import { SponsoredProductsReportType } from '../report-types' | ||
import { SponsoredProductsProductTargetingReportMetrics } from '../metrics/sponsored-products-product-targeting-report-metrics' | ||
|
||
export interface SponsoredProductsTargetsReportParams | ||
extends BaseReportParams< | ||
SponsoredProductsReportTypeEnum, | ||
SponsoredProductsReportType, | ||
SponsoredProductsProductTargetingReportMetrics | ||
> { | ||
recordType: SponsoredProductsReportTypeEnum.PRODUCT_ATTRIBUTE_TARGETING | ||
recordType: 'targets' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.