Skip to content

Commit

Permalink
feat: Update sb drafts operation docs and uri of submitDraftCampaigns…
Browse files Browse the repository at this point in the history
… method
  • Loading branch information
nguyentoanit committed May 14, 2020
1 parent fe89822 commit 2e74cf7
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion src/operations/drafts/sponsored-brands-drafts-operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,74 @@ import {
export class SponsoredBrandsDraftsOperation extends Operation {
protected resource = `${this.version}/${AmazonAdTypeURIPrefix.SponsoredBrands}/drafts/campaigns`

/**
* Gets an array of draft campaign objects.
*
* @param params -
* @returns
*/
@DecodeArray(SponsoredBrandsListDraftCampaignResponse)
public listDraftCampaigns(params: SponsoredBrandsListDraftCampaignRequest) {
return this.client.post<SponsoredBrandsListDraftCampaignResponse[]>(this.resource, params)
}

/**
* Creates one or more new draft campaigns.
*
* @param params -
* @returns
*/
@DecodeArray(SponsoredBrandsDraftCampaignResponse)
public createDraftCampaigns(params: SponsoredBrandsDraftCampaign[]) {
return this.client.post<SponsoredBrandsDraftCampaignResponse[]>(this.resource, params)
}

/**
* Updates one or more draft campaigns.
*
* @param params -
* @returns
*/
@DecodeArray(SponsoredBrandsDraftCampaignResponse)
public updateDraftCampaigns(params: SponsoredBrandsDraftCampaign[]) {
return this.client.put<SponsoredBrandsDraftCampaignResponse[]>(this.resource, params)
}

/**
* Gets a draft campaign specified by identifier.
*
* @param draftCampaignId -
* @returns
*/
@Decode(SponsoredBrandsDraftCampaign)
public getDraftCampaign(draftCampaignId: SponsoredBrandsDraftCampaignId) {
return this.client.get<SponsoredBrandsDraftCampaign>(`${this.resource}/${draftCampaignId}`)
}

/**
* Archives a draft campaign specified by identifier.
*
* @param draftCampaignId -
* @returns
*/
@Decode(SponsoredBrandsDraftCampaignResponse)
public archiveDraftCampaign(draftCampaignId: SponsoredBrandsDraftCampaignId) {
return this.client.delete<SponsoredBrandsDraftCampaignResponse>(
`${this.resource}/${draftCampaignId}`,
)
}

/**
* Submits one or more existing draft campaigns to the moderation approval queue.
*
* @param draftCampaignIds -
* @returns
*/
@DecodeArray(SponsoredBrandsDraftCampaignResponse)
public submitDraftCampaigns(draftCampaignIds: SponsoredBrandsDraftCampaignId[]) {
return this.client.post<SponsoredBrandsDraftCampaignResponse[]>(this.resource, draftCampaignIds)
return this.client.post<SponsoredBrandsDraftCampaignResponse[]>(
`${this.resource}/submit`,
draftCampaignIds,
)
}
}

0 comments on commit 2e74cf7

Please sign in to comment.