Skip to content

Commit

Permalink
feat: change KeywordBidRecommendationsMatchType to using union string
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit committed Apr 20, 2020
1 parent b50f8a6 commit 87da574
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions src/operations/bidding/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import { KeywordId } from '../keywords/types'
import { AdGroupId } from '../ad-groups/types'
import { ProductPredicateType } from '../product-targeting/types'

export enum KeywordBidRecommendationsMatchTypeEnum {
EXACT = 'exact',
PHRASE = 'phrase',
BROAD = 'broad',
}
export const KeywordBidRecommendationsMatchType = createEnumType<
KeywordBidRecommendationsMatchTypeEnum
>(KeywordBidRecommendationsMatchTypeEnum)
export const KeywordBidRecommendationsMatchType = t.union([
t.literal('exact'),
t.literal('phrase'),
t.literal('broad'),
])
export type KeywordBidRecommendationsMatchType = t.TypeOf<typeof KeywordBidRecommendationsMatchType>

/**
* The resulting status code for retrieving the bid.
Expand Down
4 changes: 2 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ describe('index', () => {
expect(index.BiddingProductPredicateTypeEnum).toEqual(
biddingEnums.BiddingProductPredicateTypeEnum,
)
expect(index.KeywordBidRecommendationsMatchTypeEnum).toEqual(
biddingEnums.KeywordBidRecommendationsMatchTypeEnum,
expect(index.KeywordBidRecommendationsMatchType).toEqual(
biddingEnums.KeywordBidRecommendationsMatchType,
)
})
})
Expand Down

0 comments on commit 87da574

Please sign in to comment.