Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async create(campaign: Campaign, options?: ServiceCreateOptions): Promise {
const request = new grpc.MutateCampaignsRequest()
const operation = new grpc.CampaignOperation()
const pb = this.buildResource('Campaign', campaign) as grpc.Campaign
operation.setCreate(pb)
request.setCustomerId(this.cid)
request.setOperationsList([operation])
if (options) {
if (options.hasOwnProperty('validate_only')) {
request.setValidateOnly(options.validate_only as boolean)
}
if (options.hasOwnProperty('partial_failure')) {
request.setPartialFailure(options.partial_failure as boolean)
}
}