Skip to content

Commit

Permalink
feat: export sd ad group operation
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit committed Aug 18, 2020
1 parent 5e3d45a commit bead85c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/amazon-advertising.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { HttpClientAuth } from './http-client'
import { HttpClient } from './http-client'
import { OperationProvider } from './operations/operation-provider'
import { SponsoredBrandsAdGroupOperation } from './operations/ad-groups/sponsored-brands-ad-group-operation'
import { SponsoredDisplayAdGroupOperation } from './operations/ad-groups/sponsored-display-ad-group-operation'
import { SponsoredProductsAdGroupOperation } from './operations/ad-groups/sponsored-products-ad-group-operation'
import { SponsoredProductsBidRecommendationOperation } from './operations/bidding/sponsored-products-bid-recommendation-operation'
import { SponsoredBrandsCampaignOperation } from './operations/campaigns/sponsored-brands-campaign-operation'
Expand Down Expand Up @@ -44,6 +45,11 @@ export class AmazonAdvertising {
return this.operationProvider.create(SponsoredBrandsAdGroupOperation)
}

@LazyGetter()
get sponsoredDisplayAdGroup() {
return this.operationProvider.create(SponsoredDisplayAdGroupOperation)
}

@LazyGetter()
get sponsoredProductsAdGroup() {
return this.operationProvider.create(SponsoredProductsAdGroupOperation)
Expand Down
6 changes: 6 additions & 0 deletions test/amazon-advertising.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AmazonAdvertising } from '../src/amazon-advertising'
import { amazonMarketplaces } from '@scaleleap/amazon-marketplaces'
import { auth } from './http-client-factory'
import { SponsoredBrandsAdGroupOperation } from '../src/operations/ad-groups/sponsored-brands-ad-group-operation'
import { SponsoredDisplayAdGroupOperation } from '../src/operations/ad-groups/sponsored-display-ad-group-operation'
import { SponsoredProductsAdGroupOperation } from '../src/operations/ad-groups/sponsored-products-ad-group-operation'
import { SponsoredProductsBidRecommendationOperation } from '../src/operations/bidding/sponsored-products-bid-recommendation-operation'
import { SponsoredBrandsCampaignOperation } from '../src/operations/campaigns/sponsored-brands-campaign-operation'
Expand Down Expand Up @@ -38,6 +39,11 @@ describe('AmazonAdvertising', () => {
expect(operation).toBeInstanceOf(SponsoredBrandsAdGroupOperation)
})

it('should return SponsoredDisplayAdGroupOperation', () => {
const operation = amazonAdvertising.sponsoredDisplayAdGroup
expect(operation).toBeInstanceOf(SponsoredDisplayAdGroupOperation)
})

it('should return SponsoredProductsAdGroupOperation', () => {
const operation = amazonAdvertising.sponsoredProductsAdGroup
expect(operation).toBeInstanceOf(SponsoredProductsAdGroupOperation)
Expand Down

0 comments on commit bead85c

Please sign in to comment.