Skip to content

Commit

Permalink
feat: export BidRecommendationForTargetsResponse and implement getBid…
Browse files Browse the repository at this point in the history
…Recommendations method
  • Loading branch information
nguyentoanit committed Apr 25, 2020
1 parent 0a44d2a commit eb66d8f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import {
KeywordBidRecommendationsResponse,
KeywordBidRecommendationsData,
BidRecommendationsResponse,
BidRecommendationRequest,
BidRecommendationForTargetsResponse,
} from './types'
import { KeywordId } from '../keywords/types'

Expand Down Expand Up @@ -55,4 +57,19 @@ export class SponsoredProductsBidRecommendationOperation extends Operation {
params,
)
}

/**
* Retrieve a list of bid recommendations for keyword, product, or auto targeting expressions by adGroupId.
*
* @param {BidRecommendationRequest} params
* @returns BidRecommendationForTargetsResponse
* @memberof SponsoredProductsBidRecommendationOperation
*/
@Decode(BidRecommendationForTargetsResponse)
public getBidRecommendations(params: BidRecommendationRequest) {
return this.client.post<BidRecommendationForTargetsResponse>(
`${this.resource}/targets/bidRecommendations`,
params,
)
}
}
3 changes: 3 additions & 0 deletions src/operations/bidding/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,6 @@ export const BidRecommendationForTargetsResponse = t.strict({
*/
recommendations: BidRecommendationLists,
})
export type BidRecommendationForTargetsResponse = t.TypeOf<
typeof BidRecommendationForTargetsResponse
>

0 comments on commit eb66d8f

Please sign in to comment.