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 update(customer: Customer, options?: ServiceCreateOptions): UpdateResponse {
const request = new grpc.MutateCustomerRequest()
const operation = new grpc.CustomerOperation()
const pb = this.buildResource('Customer', customer) as grpc.Customer
operation.setUpdate(pb)
const mask = getFieldMask(customer)
operation.setUpdateMask(mask)
request.setCustomerId(this.cid)
request.setOperation(operation)
if (options && options.hasOwnProperty('validate_only')) {
request.setValidateOnly(options.validate_only as boolean)
}
await this.service.mutateCustomer(request)