Skip to content

Commit

Permalink
feat: update operations into main entry point class
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyentoanit committed Apr 28, 2020
1 parent 42d6a19 commit f380da3
Showing 1 changed file with 147 additions and 1 deletion.
148 changes: 147 additions & 1 deletion src/amazon-advertising.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,33 @@ import { LazyGetter } from 'lazy-get-decorator'
import { HttpClientAuth } from './http-client'
import { HttpClient } from './http-client'
import { OperationProvider } from './operations/operation-provider'
import { SponsoredProductsCampaignOperation } from './operations/campaigns/sponsored-products-campaign-operation'
import {
SponsoredBrandsAdGroupOperation,
SponsoredProductsAdGroupOperation,
SponsoredProductsBidRecommendationOperation,
SponsoredBrandsCampaignOperation,
SponsoredProductsCampaignOperation,
SponsoredBrandsDraftsOperation,
SponsoredBrandsKeywordRecommendationsOperation,
SponsoredBrandsKeywordsOperation,
SponsoredBrandsNegativeKeywordsOperation,
SponsoredProductsAdGroupKeywordsOperation,
SponsoredProductsAdGroupNegativeKeywordsOperation,
SponsoredProductsCampaignNegativeKeywordsOperation,
SponsoredProductsSuggestedKeywordsOperation,
PortfolioOperation,
SponsoredProductsProductAdsOperation,
SponsoredBrandsProductTargetingOperation,
SponsoredProductsProductTargetingOperation,
ProfileOperation,
SponsoredBrandsBidRecommendationsOperation,
SponsoredBrandsTargetingRecommendationsOperation,
SponsoredBrandsReportOperation,
SponsoredProductsReportOperation,
SponsoredBrandsSnapshotOperation,
SponsoredProductsSnapshotOperation,
SponsoredBrandsStoresInfoOperation,
} from './index'

export class AmazonAdvertising {
private operationProvider: OperationProvider
Expand All @@ -19,8 +45,128 @@ export class AmazonAdvertising {
this.operationProvider = new OperationProvider(httpClient)
}

@LazyGetter()
get sponsoredBrandsAdGroup() {
return this.operationProvider.create(SponsoredBrandsAdGroupOperation)
}

@LazyGetter()
get sponsoredProductsAdGroup() {
return this.operationProvider.create(SponsoredProductsAdGroupOperation)
}

@LazyGetter()
get sponsoredProductsBidRecommendation() {
return this.operationProvider.create(SponsoredProductsBidRecommendationOperation)
}

@LazyGetter()
get sponsoredBrandsCampaign() {
return this.operationProvider.create(SponsoredBrandsCampaignOperation)
}

@LazyGetter()
get sponsoredProductsCampaign() {
return this.operationProvider.create(SponsoredProductsCampaignOperation)
}

@LazyGetter()
get sponsoredBrandsDrafts() {
return this.operationProvider.create(SponsoredBrandsDraftsOperation)
}

@LazyGetter()
get sponsoredBrandsKeywordRecommendations() {
return this.operationProvider.create(SponsoredBrandsKeywordRecommendationsOperation)
}

@LazyGetter()
get sponsoredBrandsKeywords() {
return this.operationProvider.create(SponsoredBrandsKeywordsOperation)
}

@LazyGetter()
get sponsoredBrandsNegativeKeywords() {
return this.operationProvider.create(SponsoredBrandsNegativeKeywordsOperation)
}

@LazyGetter()
get sponsoredProductsAdGroupKeywords() {
return this.operationProvider.create(SponsoredProductsAdGroupKeywordsOperation)
}

@LazyGetter()
get sponsoredProductsAdGroupNegativeKeywords() {
return this.operationProvider.create(SponsoredProductsAdGroupNegativeKeywordsOperation)
}

@LazyGetter()
get sponsoredProductsCampaignNegativeKeywords() {
return this.operationProvider.create(SponsoredProductsCampaignNegativeKeywordsOperation)
}

@LazyGetter()
get sponsoredProductsSuggestedKeywords() {
return this.operationProvider.create(SponsoredProductsSuggestedKeywordsOperation)
}

@LazyGetter()
get portfolio() {
return this.operationProvider.create(PortfolioOperation)
}

@LazyGetter()
get sponsoredProductsProductAds() {
return this.operationProvider.create(SponsoredProductsProductAdsOperation)
}

@LazyGetter()
get sponsoredBrandsProductTargeting() {
return this.operationProvider.create(SponsoredBrandsProductTargetingOperation)
}

@LazyGetter()
get sponsoredProductsProductTargeting() {
return this.operationProvider.create(SponsoredProductsProductTargetingOperation)
}

@LazyGetter()
get profile() {
return this.operationProvider.create(ProfileOperation)
}

@LazyGetter()
get sponsoredBrandsBidRecommendations() {
return this.operationProvider.create(SponsoredBrandsBidRecommendationsOperation)
}

@LazyGetter()
get sponsoredBrandsTargetingRecommendations() {
return this.operationProvider.create(SponsoredBrandsTargetingRecommendationsOperation)
}

@LazyGetter()
get sponsoredBrandsReport() {
return this.operationProvider.create(SponsoredBrandsReportOperation)
}

@LazyGetter()
get sponsoredProductsReport() {
return this.operationProvider.create(SponsoredProductsReportOperation)
}

@LazyGetter()
get sponsoredBrandsSnapshot() {
return this.operationProvider.create(SponsoredBrandsSnapshotOperation)
}

@LazyGetter()
get sponsoredProductsSnapshot() {
return this.operationProvider.create(SponsoredProductsSnapshotOperation)
}

@LazyGetter()
get sponsoredBrandsStoresInfo() {
return this.operationProvider.create(SponsoredBrandsStoresInfoOperation)
}
}

0 comments on commit f380da3

Please sign in to comment.