Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ref(ResourceConstants.SNIPPETS.ModelObjectKey),
raw(`$util.toJson(\$${ResourceConstants.SNIPPETS.ModelObjectKey})`),
obj({
id: obj({ S: str('$context.args.input.id') }),
}),
true
),
condition: ref('util.toJson($condition)'),
objectKeyVariable: ResourceConstants.SNIPPETS.ModelObjectKey,
nameOverrideMap: ResourceConstants.SNIPPETS.DynamoDBNameOverrideMap,
isSyncEnabled,
}),
])
),
ResponseMappingTemplate: isSyncEnabled ? print(DynamoDBMappingTemplate.dynamoDBResponse()) : print(ref('util.toJson($ctx.result)')),
...(syncConfig && { SyncConfig: SyncUtils.syncResolverConfig(syncConfig) }),
});
}
DynamoDBMappingTemplate.deleteItem({
key: ifElse(
ref(ResourceConstants.SNIPPETS.ModelObjectKey),
raw(`$util.toJson(\$${ResourceConstants.SNIPPETS.ModelObjectKey})`),
obj({
id: ref('util.dynamodb.toDynamoDBJson($ctx.args.input.id)'),
}),
true
),
condition: ref('util.toJson($condition)'),
isSyncEnabled,
}),
])
),
ResponseMappingTemplate: isSyncEnabled ? print(DynamoDBMappingTemplate.dynamoDBResponse()) : print(ref('util.toJson($ctx.result)')),
...(syncConfig && { SyncConfig: SyncUtils.syncResolverConfig(syncConfig) }),
});
}
}
ref(ResourceConstants.SNIPPETS.ModelObjectKey),
raw(`$util.toJson(\$${ResourceConstants.SNIPPETS.ModelObjectKey})`),
obj({
id: raw(`$util.dynamodb.toDynamoDBJson($util.defaultIfNullOrBlank($ctx.args.input.id, $util.autoId()))`),
}),
true
),
attributeValues: ref('util.dynamodb.toMapValuesJson($context.args.input)'),
condition: ref('util.toJson($condition)'),
},
syncConfig ? '2018-05-29' : '2017-02-28'
),
])
),
ResponseMappingTemplate: syncConfig ? print(DynamoDBMappingTemplate.dynamoDBResponse()) : print(ref('util.toJson($ctx.result)')),
...(syncConfig && { SyncConfig: SyncUtils.syncResolverConfig(syncConfig) }),
});
}