Skip to content

Commit

Permalink
feat: add sb ad group and keyword report metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit committed Apr 20, 2020
1 parent 3b56f79 commit f3f2755
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 260 deletions.
4 changes: 3 additions & 1 deletion src/operations/reports/metrics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ export * from './sponsored-products-campaign-report-metrics'
export * from './sponsored-products-keyword-report-metrics'
export * from './sponsored-products-product-ads-report-metrics'
export * from './sponsored-products-product-targeting-report-metrics'
export * from './sponsored-brands-headline-search-report-metrics'
export * from './sponsored-brands-ad-group-report-metrics'
export * from './sponsored-brands-campaign-report-metrics'
export * from './sponsored-brands-headline-search-report-metrics'
export * from './sponsored-brands-keyword-report-metrics'
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import * as t from 'io-ts'

export const SponsoredBrandsAdGroupReportMetrics = t.union([
/**
* Unique numerical ID of the campaign
*/
t.literal('campaignId'),

/**
* Unique name of the campaign
*/
t.literal('campaignName'),

/**
* Total budget allotted to the campaign
*/
t.literal('campaignBudget'),

t.literal('campaignBudgetType'),

/**
* Status of the campaign
*/
t.literal('campaignStatus'),

/**
* Unique name of the ad group
*/
t.literal('adGroupName'),

/**
* Unique numerical ID of the ad group
*/
t.literal('adGroupId'),
])
export type SponsoredBrandsAdGroupReportMetrics = t.TypeOf<
typeof SponsoredBrandsAdGroupReportMetrics
>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import * as t from 'io-ts'

export const SponsoredBrandsKeywordReportMetrics = t.union([
/**
* Unique numerical ID of the campaign
*/
t.literal('campaignId'),

/**
* Unique name of the campaign
*/
t.literal('campaignName'),

/**
* Unique numerical ID of the ad group
*/
t.literal('adGroupId'),

/**
* Unique name of the ad group
*/
t.literal('adGroupName'),

t.literal('campaignBudgetType'),

/**
* Status of the campaign
*/
t.literal('campaignStatus'),

/**
* ID of the keyword used in bid
*/
t.literal('keywordId'),

/**
* Keyword state.
*/
t.literal('keywordStatus'),

/**
* User-set bid value for keyword.
*/
t.literal('keywordBid'),

/**
* Text of the keyword or phrase used in bid
*/
t.literal('keywordText'),

/**
* Type of matching for the keyword or phrase used in bid. Must be one of: broad, phrase, or exact
*/
t.literal('matchType'),
])
export type SponsoredBrandsKeywordReportMetrics = t.TypeOf<
typeof SponsoredBrandsKeywordReportMetrics
>
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 { SponsoredProductsAdGroupReportMetrics } from '../metrics/sponsored-products-ad-group-report-metrics'
import { SponsoredBrandsAdGroupReportMetrics } from '../metrics'

export interface SponsoredBrandsAdGroupReportParams
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredProductsAdGroupReportMetrics> {
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredBrandsAdGroupReportMetrics> {
recordType: SponsoredBrandsReportTypeEnum.AD_GROUPS
}
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 { SponsoredProductsKeywordReportMetrics } from '../metrics/sponsored-products-keyword-report-metrics'
import { SponsoredBrandsKeywordReportMetrics } from '../metrics'

export interface SponsoredBrandsKeywordReportParams
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredProductsKeywordReportMetrics> {
extends BaseReportParams<SponsoredBrandsReportTypeEnum, SponsoredBrandsKeywordReportMetrics> {
recordType: SponsoredBrandsReportTypeEnum.KEYWORDS
}

This file was deleted.

This file was deleted.

Loading

0 comments on commit f3f2755

Please sign in to comment.