diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 8d6096308..cae3e9262 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -192,6 +192,15 @@ Provides default functionality that can be overwritten by child metadata type cl
Mcdev.(cred, bu, type, [keyArr])Promise.<Array.<string>>

Updates the key to match the name field

+
Mcdev.(cred, bu, type, [keyArr], methodName)Promise.<Array.<string>>
+

A function to retrieve, update and deploy items

+
+
Mcdev.(type, metadataMap, methodName)Array.<string>
+

helper function to get keys of items to update

+
+
Mcdev.(cred, bu, type, [keyArr])Promise.<Array.<string>>
+

Updates notification email address field

+
Automation.(metadata)boolean

helper for postRetrieveTasks and execute

@@ -210,9 +219,15 @@ Provides default functionality that can be overwritten by child metadata type cl
Automation.(metadataMap, key)Promise.<void>

helper for postDeployTasks

+
Automation.(key, programId, notificationBody)string
+

helper function to send POST request to update notifications

+
Automation.(metadataMap, originalMetadataMap, key, [oldKey])Promise.<{key:string, response:object}>

helper for postDeployTasks

+
Automation.()Promise.<Array.<string>>
+

helper function to retrieve data about all automations in the BU

+
DataExtension.(upsertedMetadata, originalMetadata, createdUpdated)void

takes care of updating attribute groups on child BUs after an update to Shared DataExtensions helper for postDeployTasks @@ -546,6 +561,7 @@ main class * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> + * [.updateNotifications(businessUnit, selectedType, [keys])](#Mcdev.updateNotifications) ⇒ Promise.<Object.<string, Array.<string>>> @@ -853,6 +869,20 @@ Updates the key to match the name field | selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | | [keys] | Array.<string> | customerkey of the metadata | + + +### Mcdev.updateNotifications(businessUnit, selectedType, [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Updates notification email address field + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of affected item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| selectedType | TYPE.SupportedMetadataTypes | limit execution to given metadata type | +| [keys] | Array.<string> | customerkey of the metadata | + ## Asset ⇐ [MetadataType](#MetadataType) @@ -1426,6 +1456,8 @@ Automation MetadataType * [.getFilesToCommit(keyArr)](#Automation.getFilesToCommit) ⇒ Array.<string> * [.deleteByKey(customerKey)](#Automation.deleteByKey) ⇒ boolean * [.postDeleteTasks(customerKey)](#Automation.postDeleteTasks) ⇒ void + * [.updateNotifications(keys)](#Automation.updateNotifications) ⇒ Promise.<Array.<string>> + * [.clearNotifications(keys)](#Automation.clearNotifications) ⇒ Promise.<Array.<string>> @@ -1705,6 +1737,30 @@ clean up after deleting a metadata item | --- | --- | --- | | customerKey | string | Identifier of metadata item | + + +### Automation.updateNotifications(keys) ⇒ Promise.<Array.<string>> +A function to update automation email notifications + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<Array.<string>> - keys of the automations where notifications were updated + +| Param | Type | Description | +| --- | --- | --- | +| keys | string | metadata keys | + + + +### Automation.clearNotifications(keys) ⇒ Promise.<Array.<string>> +A function to remove automation email notifications and/or notes + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<Array.<string>> - keys of the automations where notifications were updated + +| Param | Type | Description | +| --- | --- | --- | +| keys | string | metadata keys | + ## Campaign ⇐ [MetadataType](#MetadataType) @@ -3044,7 +3100,9 @@ ImportFile MetadataType * [.create(importFile)](#ImportFile.create) ⇒ Promise * [.update(importFile)](#ImportFile.update) ⇒ Promise * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise + * [.getKeysToSetNotifications(metadataMap)](#ImportFile.getKeysToSetNotifications) ⇒ Array.<string> * [.parseMetadata(metadata)](#ImportFile.parseMetadata) ⇒ TYPE.MetadataTypeItem + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#ImportFile.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' @@ -3132,6 +3190,18 @@ prepares a import definition for deployment | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single importDef | + + +### ImportFile.getKeysToSetNotifications(metadataMap) ⇒ Array.<string> +helper function to get a list of keys where notification email address should be updated + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Array.<string> - list of keys + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | + ### ImportFile.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem @@ -3144,6 +3214,22 @@ parses retrieved Metadata before saving | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single import definition | + + +### ImportFile.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: 'create' \| 'update' \| 'skip' - action to take + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | + ## Journey ⇐ [MetadataType](#MetadataType) @@ -3452,6 +3538,8 @@ Provides default functionality that can be overwritten by child metadata type cl * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> + * [.getKeysToSetNotifications(metadataMap)](#MetadataType.getKeysToSetNotifications) ⇒ Array.<string> + * [.updateNotifications()](#MetadataType.updateNotifications) ⇒ Array.<string> @@ -4304,6 +4392,25 @@ additionally, the documentation for dataExtension and automation should be retur | --- | --- | --- | | metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | + + +### MetadataType.getKeysToSetNotifications(metadataMap) ⇒ Array.<string> +Abstract function to get a list of keys where notification email address should be updated + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - list of keys + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | + + + +### MetadataType.updateNotifications() ⇒ Array.<string> +Abstract updateNotifications method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - returns keys of items where notification email address was set ## MobileCode ⇐ [MetadataType](#MetadataType) @@ -6125,6 +6232,8 @@ Verification MetadataType * [.preDeployTasks(metadata)](#Verification.preDeployTasks) ⇒ TYPE.VerificationItem * [.postRetrieveTasks(metadata)](#Verification.postRetrieveTasks) ⇒ TYPE.VerificationItem * [.deleteByKey(key)](#Verification.deleteByKey) ⇒ Promise.<boolean> + * [.getKeysToSetNotifications(metadataMap)](#Verification.getKeysToSetNotifications) ⇒ Array.<string> + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#Verification.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' @@ -6234,6 +6343,34 @@ Delete a metadata item from the specified business unit | --- | --- | --- | | key | string | Identifier of item | + + +### Verification.getKeysToSetNotifications(metadataMap) ⇒ Array.<string> +helper function to get a list of keys where notification email addresses or notes should be updated + +**Kind**: static method of [Verification](#Verification) +**Returns**: Array.<string> - list of keys + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | + + + +### Verification.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) + +**Kind**: static method of [Verification](#Verification) +**Returns**: 'create' \| 'update' \| 'skip' - action to take + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | + ## Retriever @@ -6323,6 +6460,7 @@ CLI helper class * [Cli](#Cli) * [.initMcdevConfig()](#Cli.initMcdevConfig) ⇒ Promise.<boolean> * [.addExtraCredential(properties)](#Cli.addExtraCredential) ⇒ Promise.<(boolean\|string)> + * [.updateNotificationEmails(noteType)](#Cli.updateNotificationEmails) ⇒ Promise.<Array.<string>> * [.postFixKeysReretrieve(type, dependentTypes)](#Cli.postFixKeysReretrieve) ⇒ Promise.<boolean> * [.logExistingCredentials(properties)](#Cli.logExistingCredentials) ⇒ void * [.updateCredential(properties, credName)](#Cli.updateCredential) ⇒ Promise.<boolean> @@ -6354,6 +6492,18 @@ Extends template file for properties.json | --- | --- | --- | | properties | TYPE.Mcdevrc | config file's json | + + +### Cli.updateNotificationEmails(noteType) ⇒ Promise.<Array.<string>> +interactive helper to set automation run completion/error note + +**Kind**: static method of [Cli](#Cli) +**Returns**: Promise.<Array.<string>> - responses + +| Param | Type | Description | +| --- | --- | --- | +| noteType | TYPE.SupportedMetadataTypes | note type (error/completion) | + ### Cli.postFixKeysReretrieve(type, dependentTypes) ⇒ Promise.<boolean> @@ -7737,6 +7887,7 @@ Util that contains logger and simple util methods * [.isFalse(attrValue)](#Util.isFalse) ⇒ boolean * [._isValidType(selectedType, [handleOutside])](#Util._isValidType) ⇒ boolean * [.getTypeAndSubType(selectedType)](#Util.getTypeAndSubType) ⇒ Array.<string> + * [.emailValidator(email)](#Util.emailValidator) ⇒ boolean * [.getRetrieveTypeChoices()](#Util.getRetrieveTypeChoices) ⇒ Array.<TYPE.SupportedMetadataTypes> * [._createNewLoggerTransport([noLogFile])](#Util._createNewLoggerTransport) ⇒ object * [.startLogger([restart], [noLogFile])](#Util.startLogger) ⇒ void @@ -7890,6 +8041,18 @@ helper that deals with extracting type and subtype | --- | --- | --- | | selectedType | string | "type" or "type-subtype" | + + +### Util.emailValidator(email) ⇒ boolean +helper that validates email address + +**Kind**: static method of [Util](#Util) +**Returns**: boolean - first elem is type, second elem is subType + +| Param | Type | Description | +| --- | --- | --- | +| email | string | email to validate | + ### Util.getRetrieveTypeChoices() ⇒ Array.<TYPE.SupportedMetadataTypes> @@ -8188,7 +8351,7 @@ run a method across BUs | Param | Type | Description | | --- | --- | --- | -| methodName | 'execute' \| 'pause' \| 'fixKeys' | what to run | +| methodName | 'execute' \| 'pause' \| 'fixKeys' \| 'updateNotifications' | what to run | | businessUnit | string | name of BU | | [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | | [keys] | Array.<string> | customerkey of the metadata | @@ -8203,7 +8366,7 @@ helper for [Mcdev.#runMethod](Mcdev.#runMethod) | Param | Type | Description | | --- | --- | --- | -| methodName | 'execute' \| 'pause' \| 'fixKeys' | what to run | +| methodName | 'execute' \| 'pause' \| 'fixKeys' \| 'updateNotifications' | what to run | | cred | string | name of Credential | | bu | string | name of BU | | [type] | TYPE.SupportedMetadataTypes | limit execution to given metadata type | @@ -8237,6 +8400,51 @@ Updates the key to match the name field | type | TYPE.SupportedMetadataTypes | limit execution to given metadata type | | [keyArr] | Array.<string> | customerkey of the metadata | + + +## Mcdev.(cred, bu, type, [keyArr], methodName) ⇒ Promise.<Array.<string>> +A function to retrieve, update and deploy items + +**Kind**: global function +**Returns**: Promise.<Array.<string>> - list of keys that were affected + +| Param | Type | Description | +| --- | --- | --- | +| cred | string | name of Credential | +| bu | string | name of BU | +| type | TYPE.SupportedMetadataTypes | limit execution to given metadata type | +| [keyArr] | Array.<string> | customerkey of the metadata | +| methodName | string | name of the function to execute | + + + +## Mcdev.(type, metadataMap, methodName) ⇒ Array.<string> +helper function to get keys of items to update + +**Kind**: global function +**Returns**: Array.<string> - list of keys + +| Param | Type | Description | +| --- | --- | --- | +| type | TYPE.SupportedMetadataTypes | limit execution to given metadata type | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| methodName | string | name of the method to execute | + + + +## Mcdev.(cred, bu, type, [keyArr]) ⇒ Promise.<Array.<string>> +Updates notification email address field + +**Kind**: global function +**Returns**: Promise.<Array.<string>> - list of keys that were affected + +| Param | Type | Description | +| --- | --- | --- | +| cred | string | name of Credential | +| bu | string | name of BU | +| type | TYPE.SupportedMetadataTypes | limit execution to given metadata type | +| [keyArr] | Array.<string> | customerkey of the metadata | + ## Automation.(metadata) ⇒ boolean @@ -8312,6 +8520,20 @@ helper for [postDeployTasks](#Automation.postDeployTasks) +## Automation.(key, programId, notificationBody) ⇒ string +helper function to send POST request to update notifications + +**Kind**: global function +**Returns**: string - returns "OK" or "Error" + +| Param | Type | Description | +| --- | --- | --- | +| key | string | current customer key | +| programId | string | legacy automation id | +| notificationBody | string | notification payload | + + + ## Automation.(metadataMap, originalMetadataMap, key, [oldKey]) ⇒ Promise.<{key:string, response:object}> helper for [postDeployTasks](#Automation.postDeployTasks) @@ -8325,6 +8547,13 @@ helper for [postDeployTasks](#Automation.postDeployTasks) | key | string | current customer key | | [oldKey] | string | old customer key before fixKey / changeKeyValue / changeKeyField | + + +## Automation.() ⇒ Promise.<Array.<string>> +helper function to retrieve data about all automations in the BU + +**Kind**: global function +**Returns**: Promise.<Array.<string>> - returns data about automations with the legacy key ## DataExtension.(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void diff --git a/lib/cli.js b/lib/cli.js index 6be219184..dafbca3a0 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -560,6 +560,63 @@ yargs(hideBin(process.argv)) Mcdev.fixKeys(argv.BU, argv.TYPE, csvToArray(argv.KEY)); }, }) + .command({ + command: 'updateNotifications [KEY]', + aliases: ['un'], + desc: 'bulk updates notification email addresses', + builder: (yargs) => { + yargs + .positional('BU', { + type: 'string', + describe: 'the business unit where to update notification email address', + }) + .positional('TYPE', { + type: 'string', + describe: 'metadata type', + }) + .positional('KEY', { + type: 'string', + describe: 'key(s) of the metadata component(s)', + }) + .option('errorEmail', { + type: 'string', + group: 'Options for updateNotifications:', + describe: 'email to notify that an error occured during execution', + }) + .option('completionEmail', { + type: 'string', + group: 'Options for updateNotifications:', + describe: 'email to notify about successfull completion', + }) + .option('errorNote', { + type: 'string', + group: 'Options for updateNotifications:', + describe: 'run error note', + }) + .option('completionNote', { + type: 'string', + group: 'Options for updateNotifications:', + describe: 'run completion note', + }) + .option('clear', { + type: 'string', + group: 'Options for updateNotifications:', + describe: + "remove notification email addresses and/or notes. Possible options: 'all', 'errorEmail', 'completionEmail', 'notes' for automation. For the rest of types any value would do (true/all/etc.)", + }) + .option('like', { + type: 'string', + group: 'Options for updateNotifications:', + describe: + 'filter metadata components (can include % as wildcard or _ for a single character)', + }); + }, + handler: (argv) => { + Mcdev.setOptions(argv); + // ! do not allow multiple types to be passed in here via csvToArray + Mcdev.updateNotifications(argv.BU, argv.TYPE, csvToArray(argv.KEY)); + }, + }) .command({ command: 'upgrade', aliases: ['up'], diff --git a/lib/index.js b/lib/index.js index 2e9749693..a27b227b5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -66,6 +66,11 @@ class Mcdev { '_runningTest', 'schedule', 'skipInteraction', + 'errorEmail', + 'completionEmail', + 'errorNote', + 'completionNote', + 'clear', ]; for (const option of knownOptions) { if (argv[option] !== undefined) { @@ -791,7 +796,7 @@ class Mcdev { /** * run a method across BUs * - * @param {'execute'|'pause'|'fixKeys'} methodName what to run + * @param {'execute'|'pause'|'fixKeys'|'updateNotifications'} methodName what to run * @param {string} businessUnit name of BU * @param {TYPE.SupportedMetadataTypes} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata @@ -827,6 +832,13 @@ class Mcdev { checkMetadataSupport = false; break; } + case 'updateNotifications': { + lang_past = 'updated notifications for'; + lang_present = 'updating notifications for'; + requireKeyOrLike = false; + checkMetadataSupport = false; + break; + } } Util.logger.info(`mcdev:: ${methodName} ${selectedType}`); @@ -954,7 +966,7 @@ class Mcdev { /** * helper for {@link Mcdev.#runMethod} * - * @param {'execute'|'pause'|'fixKeys'} methodName what to run + * @param {'execute'|'pause'|'fixKeys'|'updateNotifications'} methodName what to run * @param {string} cred name of Credential * @param {string} bu name of BU * @param {TYPE.SupportedMetadataTypes} [type] limit execution to given metadata type @@ -992,6 +1004,21 @@ class Mcdev { break; } } + case 'updateNotifications': { + if (Object.prototype.hasOwnProperty.call(MetadataTypeInfo[type], methodName)) { + resultArr.push(...(await MetadataTypeInfo[type][methodName](keyArr))); + if (resultArr.length > 0) { + Util.logger.info(`Retrieving ${type} to have most recent changes`); + const retriever = new Retriever(properties, buObject); + await retriever.retrieve([type], resultArr, null, false); + } + } else { + resultArr.push( + ...(await this.#updateNotifications(cred, bu, type, keyArr)) + ); + } + break; + } default: { if (Util.OPTIONS.like && Object.keys(Util.OPTIONS.like).length) { keyArr = await this.#retrieveKeysWithLike(type, buObject); @@ -1005,7 +1032,6 @@ class Mcdev { } catch (ex) { Util.logger.errorStack(ex, 'mcdev.' + methodName + ' failed'); } - return resultArr; } @@ -1085,16 +1111,71 @@ class Mcdev { static async #fixKeys(cred, bu, type, keyArr) { const properties = await config.getProperties(); let actuallyFixedKeys = []; - const resultArr = []; - if ( MetadataTypeDefinitions[type].keyIsFixed === true || MetadataTypeDefinitions[type].keyField === MetadataTypeDefinitions[type].idField ) { Util.logger.error(`Key cannot be updated for this type`); - return resultArr; + return actuallyFixedKeys; + } + const buObject = await Cli.getCredentialObject( + properties, + cred === null ? null : cred + '/' + bu, + null, + true + ); + this.setOptions({ + changeKeyField: MetadataTypeDefinitions[type].nameField, + fromRetrieve: true, + }); + actuallyFixedKeys = await this.#updateItems(cred, bu, type, keyArr, 'fixKeys'); + const dependentTypes = await Util.getDependentMetadata(type); + if (actuallyFixedKeys && actuallyFixedKeys.length) { + Util.logger.info( + `Successfully updated ${actuallyFixedKeys.length} key${ + actuallyFixedKeys.length === 1 ? '' : 's' + } of type ${type}` + ); + if (dependentTypes.length) { + Util.logger.warn( + `Please re-retrieve the following types as your local copies might now be outdated: ${Util.getGrayMsg( + dependentTypes.join(', ') + )}` + ); + const reRetrieve = await Cli.postFixKeysReretrieve(type, dependentTypes); + if (reRetrieve) { + Util.logger.info( + `Retrieving latest versions of ${dependentTypes.join(', ')} from server` + ); + const retriever = new Retriever(properties, buObject); + await retriever.retrieve(dependentTypes, null, null, false); + } + } else { + Util.logger.info( + `No dependent types found that need to be re-retrieved after fixing keys of type ${type}.` + ); + } + } else { + Util.logger.warn(`No keys of type ${type} updated.`); } + return actuallyFixedKeys; + } + /** + * A function to retrieve, update and deploy items + * + * @param {string} cred name of Credential + * @param {string} bu name of BU + * @param {TYPE.SupportedMetadataTypes} type limit execution to given metadata type + * @param {string[]} [keyArr] customerkey of the metadata + * @param {string} methodName name of the function to execute + * @returns {Promise.} list of keys that were affected + */ + static async #updateItems(cred, bu, type, keyArr, methodName) { + const properties = await config.getProperties(); + let actuallyUpdatedItems = []; + const resultArr = []; + const buObject = await Cli.getCredentialObject( properties, cred === null ? null : cred + '/' + bu, @@ -1107,55 +1188,113 @@ class Mcdev { const retrieved = await retriever.retrieve([type], keyArr, null, false); const metadataMap = Object.values(retrieved)[0][0]; - const keysForDeploy = MetadataTypeInfo[type].getKeysForFixing(metadataMap); + const keysForDeploy = await this.#getKeys(type, metadataMap, methodName); if (keysForDeploy.length < 1) { Util.logger.warn( `No items found with a key-name mismatch that match your criteria.\n` ); return resultArr; } - this.setOptions({ - changeKeyField: MetadataTypeDefinitions[type].nameField, - fromRetrieve: true, - }); const deployed = await Deployer.deploy(cred + '/' + bu, [type], keysForDeploy); - actuallyFixedKeys = Object.keys(Object.values(Object.values(deployed)[0])[0]); - resultArr.push(...actuallyFixedKeys); - const dependentTypes = await Util.getDependentMetadata(type); - if (actuallyFixedKeys && actuallyFixedKeys.length) { - Util.logger.info( - `Successfully updated ${actuallyFixedKeys.length} key${ - actuallyFixedKeys.length === 1 ? '' : 's' - } of type ${type}` - ); - if (dependentTypes.length) { - Util.logger.warn( - `Please re-retrieve the following types as your local copies might now be outdated: ${Util.getGrayMsg( - dependentTypes.join(', ') - )}` - ); - const reRetrieve = await Cli.postFixKeysReretrieve(type, dependentTypes); - if (reRetrieve) { - Util.logger.info( - `Retrieving latest versions of ${dependentTypes.join(', ')} from server` - ); - const retriever = new Retriever(properties, buObject); - await retriever.retrieve(dependentTypes, null, null, false); - } - } else { - Util.logger.info( - `No dependent types found that need to be re-retrieved after fixing keys of type ${type}.` - ); - } - } else { - Util.logger.warn(`No keys of type ${type} updated.`); - } + actuallyUpdatedItems = Object.keys(Object.values(Object.values(deployed)[0])[0]); + resultArr.push(...actuallyUpdatedItems); } catch (ex) { - Util.logger.errorStack(ex, 'mcdev.fixKeys failed'); + Util.logger.errorStack(ex, `mcdev.${methodName} failed`); } - Util.logger.info(`:: Done\n`); return resultArr; } + /** + * helper function to get keys of items to update + * + * @param {TYPE.SupportedMetadataTypes} type limit execution to given metadata type + * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField + * @param {string} methodName name of the method to execute + * @returns {string[]} list of keys + */ + static async #getKeys(type, metadataMap, methodName) { + const keys = []; + switch (methodName) { + case 'fixKeys': { + keys.push(...(await MetadataTypeInfo[type].getKeysForFixing(metadataMap))); + break; + } + case 'updateNotifications': { + keys.push(...(await MetadataTypeInfo[type].getKeysToSetNotifications(metadataMap))); + break; + } + } + return keys; + } + /** + * Updates notification email address field + * + * @param {string} businessUnit name of BU + * @param {TYPE.SupportedMetadataTypes} selectedType limit execution to given metadata type + * @param {string[]} [keys] customerkey of the metadata + * @returns {Promise.>} key: business unit name, value: list of affected item keys + */ + static async updateNotifications(businessUnit, selectedType, keys) { + if ( + !Util.OPTIONS.completionEmail && + !Util.OPTIONS.errorEmail && + !Util.OPTIONS.completionNote && + !Util.OPTIONS.errorNote && + !Util.OPTIONS.clear + ) { + // if no options were provided there is nothing to update + Util.logger.error(`No email addresses, run notes or a clear option was provided`); + return []; + } + + return await this.#runMethod('updateNotifications', businessUnit, selectedType, keys); + } + /** + * Updates notification email address field + * + * @param {string} cred name of Credential + * @param {string} bu name of BU + * @param {TYPE.SupportedMetadataTypes} type limit execution to given metadata type + * @param {string[]} [keyArr] customerkey of the metadata + * @returns {Promise.} list of keys that were affected + */ + static async #updateNotifications(cred, bu, type, keyArr) { + let keysUpdatedNotifications = []; + if (!MetadataTypeDefinitions[type].fields.notificationEmailAddress) { + Util.logger.error(`Update notifications is not supported for this type`); + return keysUpdatedNotifications; + } + if (Util.OPTIONS.errorEmail || Util.OPTIONS.errorNote) { + Util.logger.error(`--errorEmail, --errorNote options are not available for ${type}`); + return keysUpdatedNotifications; + } + if ( + !MetadataTypeDefinitions[type].fields.notificationEmailMessage && + Util.OPTIONS.completionNote + ) { + Util.logger.error(`--completionNote option is not available for ${type}`); + return keysUpdatedNotifications; + } + this.setOptions({ + fromRetrieve: true, + }); + keysUpdatedNotifications = await this.#updateItems( + cred, + bu, + type, + keyArr, + 'updateNotifications' + ); + if (keysUpdatedNotifications && keysUpdatedNotifications.length) { + Util.logger.info( + `Successfully updated notifications. Updated ${ + keysUpdatedNotifications.length + } key${keysUpdatedNotifications.length === 1 ? '' : 's'} of type ${type}` + ); + } else { + Util.logger.warn(`No keys of type ${type} updated.`); + } + return keysUpdatedNotifications; + } } export default Mcdev; diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index e6f05f76f..0ba3d5559 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -7,6 +7,7 @@ import File from '../util/file.js'; import Definitions from '../MetadataTypeDefinitions.js'; import cache from '../util/cache.js'; import pLimit from 'p-limit'; +import Cli from '../util/cli.js'; /** * Automation MetadataType @@ -118,13 +119,7 @@ class Automation extends MetadataType { const foundKeys = Object.keys(metadataMap); // get encodedAutomationID to retrieve notification information - const iteratorBackup = this.definition.bodyIteratorField; - this.definition.bodyIteratorField = 'entry'; - const automationLegacyMapObj = await super.retrieveREST( - undefined, - `/legacy/v1/beta/bulk/automations/automation/definition/` - ); - this.definition.bodyIteratorField = iteratorBackup; + const automationLegacyMapObj = await this.#getEncodedAutomationIDs(); const automationLegacyMap = Object.keys(automationLegacyMapObj.metadata) .filter((key) => foundKeys.includes(key)) // ! using the `id` field to retrieve notifications does not work. instead one needs to use the URL in the `notifications` field @@ -248,17 +243,7 @@ class Automation extends MetadataType { const resultsConverted = {}; if (Array.isArray(results?.Results)) { // get encodedAutomationID to retrieve notification information - const keyBackup = this.definition.keyField; - const iteratorBackup = this.definition.bodyIteratorField; - this.definition.keyField = 'key'; - this.definition.bodyIteratorField = 'entry'; - const automationsLegacy = await super.retrieveREST( - undefined, - `/legacy/v1/beta/bulk/automations/automation/definition/` - ); - this.definition.keyField = keyBackup; - this.definition.bodyIteratorField = iteratorBackup; - + const automationsLegacy = await this.#getEncodedAutomationIDs(); // merge encodedAutomationID into results for (const m of results.Results) { const key = m.CustomerKey || m.key; @@ -964,7 +949,7 @@ class Automation extends MetadataType { await Automation.#scheduleAutomation(metadataMap, originalMetadataMap, key, oldKey); // need to update notifications separately if there are any - await Automation.#updateNotificationInfoREST(metadataMap, key); + await Automation.#updateNotificationInfo(metadataMap, key); // rewrite upsert to retrieve fields if (item.steps) { @@ -986,7 +971,7 @@ class Automation extends MetadataType { * @param {string} key current customer key * @returns {Promise.} - */ - static async #updateNotificationInfoREST(metadataMap, key) { + static async #updateNotificationInfo(metadataMap, key) { if (this.notificationUpdates[key]) { // create & update automation calls return programId as 'legacyId'; retrieve does not return it const programId = metadataMap[key]?.legacyId; @@ -1003,26 +988,38 @@ class Automation extends MetadataType { channelType: 'Account', })), }; - try { - const result = await this.client.rest.post( - '/legacy/v1/beta/automations/notifications/' + programId, - notificationBody - ); - if (result) { - // should be empty if all OK - throw new Error(result); - } - } catch (ex) { - Util.logger.error( - `Error updating notifications for automation '${metadataMap[key].name}': ${ex.message} (${ex.code}))` - ); - } - Util.logger.info( - Util.getGrayMsg( - ` - updated notifications for automation '${metadataMap[key].name}'` - ) - ); + this.#updateNotificationInfoREST(key, programId, notificationBody); + } + } + } + /** + * helper function to send POST request to update notifications + * + * @param {string} key current customer key + * @param {string} programId legacy automation id + * @param {string} notificationBody notification payload + * @returns {string} returns "OK" or "Error" + */ + static async #updateNotificationInfoREST(key, programId, notificationBody) { + try { + const result = await this.client.rest.post( + '/legacy/v1/beta/automations/notifications/' + programId, + notificationBody + ); + if (result) { + // should be empty if all OK + throw new Error(result); + } else { + Util.logger.info(`updated notifications for automation '${key}'`); + return 'OK'; } + } catch (ex) { + Util.logger.error( + ex.code === 'ERR_BAD_REQUEST' + ? `Error updating notifications for automation ${key}: ${ex.message} (${ex.code})). Make sure that the email address is correct.` + : `Error updating notifications for automation '${key}': ${ex.message} (${ex.code})).` + ); + return 'Error'; } } @@ -1607,6 +1604,349 @@ class Automation extends MetadataType { // delete local copy: retrieve/cred/bu/.../...-doc.md await super.postDeleteTasks(customerKey, [`${this.definition.type}-doc.md`]); } + /** + * helper function to retrieve data about all automations in the BU + * + * @returns {Promise.} returns data about automations with the legacy key + */ + static async #getEncodedAutomationIDs() { + const keyBackup = this.definition.keyField; + const iteratorBackup = this.definition.bodyIteratorField; + this.definition.keyField = 'key'; + this.definition.bodyIteratorField = 'entry'; + const automationLegacyKeys = await super.retrieveREST( + undefined, + `/legacy/v1/beta/bulk/automations/automation/definition/` + ); + this.definition.keyField = keyBackup; + this.definition.bodyIteratorField = iteratorBackup; + return automationLegacyKeys; + } + /** + * A function to update automation email notifications + * + * @param {string} keys metadata keys + * @returns {Promise.} keys of the automations where notifications were updated + */ + static async updateNotifications(keys) { + const updatedKeys = []; + if (Util.OPTIONS.clear) { + updatedKeys.push(...(await this.clearNotifications(keys))); + return updatedKeys; + } + let completionEmail = [], + errorEmail = [], + notificationsResult, + oldCompletionEmails, + oldCompletionNote, + oldErrorEmails, + oldErrorNote; + + if (Util.OPTIONS.completionEmail) { + completionEmail = Util.OPTIONS.completionEmail.split(','); + } + if (Util.OPTIONS.errorEmail) { + errorEmail = Util.OPTIONS.errorEmail.split(','); + } + let completionNote = Util.OPTIONS.completionNote; + let errorNote = Util.OPTIONS.errorNote; + + let shouldUpdateCompletion = + (completionNote && completionNote.length > 0) || completionEmail.length > 0 + ? true + : false; + let shouldUpdateError = + (errorNote && errorNote.length > 0) || errorEmail.length > 0 ? true : false; + + const automationLegacyMapObj = await this.#getEncodedAutomationIDs(); // retrieve automation legacy keys to update notifications + for (const key of Object.keys(automationLegacyMapObj.metadata)) { + // create payload + const notificationBody = { + programId: automationLegacyMapObj.metadata[key].id, + workers: [], + }; + + if (Array.isArray(keys) && keys.includes(key)) { + try { + notificationsResult = await this.client.rest.get( + '/legacy/v1/beta/automations/notifications/' + + automationLegacyMapObj.metadata[key].id + ); + } catch (ex) { + Util.logger.error( + `Error retrieving notifications for automation '${key}': ${ex.message} (${ex.code}))` + ); + } + // if a note was provided and email address was not - check if notif email address exists + if ( + completionNote && + completionEmail.length === 0 && + (!notificationsResult.workers || + !notificationsResult.workers.find( + (notification) => notification.notificationType == 'Complete' + )) + ) { + const emails = await Cli.updateNotificationEmails('completionEmail'); + if (emails) { + // merge the string input into completionEmail array + completionEmail = completionEmail.concat(emails.split(',')); + } else { + completionNote = undefined; + shouldUpdateCompletion = false; + Util.logger.info( + ` ☇ skipping --completionNote' - the email address for Run completion was not set` + ); + } + } + // same for errorNote + if ( + errorNote && + errorEmail.length === 0 && + (!notificationsResult.workers || + !notificationsResult.workers.find( + (notification) => notification.notificationType == 'Error' + )) + ) { + const emails = await Cli.updateNotificationEmails('errorEmail'); + if (emails) { + // merge the string input into errorEmail array + errorEmail = errorEmail.concat(emails.split(',')); + } else { + errorNote = undefined; + shouldUpdateError = false; + Util.logger.info( + ` ☇ skipping --errorNote' - the email address for Runtime error was not set` + ); + } + } + + // check if there are any notifications set + if (Array.isArray(notificationsResult?.workers)) { + // if the parameters provided are the same as the email addresses/notes already in the notifications - skip this automation + oldCompletionEmails = notificationsResult.workers + .filter((notification) => notification.notificationType == 'Complete') + .map((notification) => notification.definition); + oldCompletionNote = notificationsResult.workers.find( + (notification) => notification.notificationType == 'Complete' + )?.body; + for (const email of completionEmail) { + if (oldCompletionEmails.includes(email) || !Util.emailValidator(email)) { + Util.logger.info( + ` ☇ skipping ${email}- this email address is already in the notifications or is not a valid email` + ); + completionEmail.splice(completionEmail.indexOf(email), 1); + } + } + // if old note is the same as the one that the user provided - no need to update + if (oldCompletionNote == completionNote) { + completionNote = null; + } + oldErrorEmails = notificationsResult.workers + .filter((notification) => notification.notificationType == 'Error') + .map((notification) => notification.definition); + oldErrorNote = notificationsResult.workers.find( + (notification) => notification.notificationType == 'Error' + )?.body; + for (const email of errorEmail) { + if (oldErrorEmails.includes(email) || !Util.emailValidator(email)) { + Util.logger.info( + ` ☇ skipping ${email}- this email address is already in the notifications or is not a valid email` + ); + errorEmail.splice(errorEmail.indexOf(email), 1); + } + } + // if old note is the same as the one that the user provided - no need to update + if (oldErrorNote == errorNote) { + errorNote = null; + } + + // earlier we have removed email addresses that are already in the notifications and verified that the new note is different from the one user provided. + if (completionEmail.length < 1 && !completionNote) { + shouldUpdateCompletion = false; + } + if (errorEmail.length < 1 && !errorNote) { + shouldUpdateError = false; + } + if (!shouldUpdateCompletion && !shouldUpdateError) { + Util.logger.info( + `You have provided email addresses that are already in the automation notification. The notes didn't change either. Exiting..` + ); + return updatedKeys; + } + // copy existing notifications into payload + if (notificationsResult.workers) { + notificationBody.workers = notificationsResult.workers; + } + } + // if new note is null then keep the old one only update emails + if (!completionNote) { + completionNote = oldCompletionNote; + } + // completionEmail is an array even if there is only one email + if (completionEmail.length > 0) { + for (const email of completionEmail) { + if (Util.emailValidator(email)) { + notificationBody.workers.push({ + programId: automationLegacyMapObj.metadata[key].id, + notificationType: 'Complete', + definition: email, + body: completionNote, + channelType: 'Account', + }); + } else { + Util.logger.info( + ` ☇ skipping ${email}- this email address is not a valid email` + ); + } + } + } else { + // no emails to update, only update the note + + for (const notification of notificationBody.workers) { + if (notification.notificationType == 'Complete') { + notificationBody.workers.map( + (notification) => (notification.body = completionNote) + ); + } + } + } + if (!errorNote) { + errorNote = oldErrorNote; + } + if (errorEmail.length > 0) { + for (const email of errorEmail) { + if (Util.emailValidator(email)) { + notificationBody.workers.push({ + programId: automationLegacyMapObj.metadata[key].id, + notificationType: 'Error', + definition: email, + body: errorNote, + channelType: 'Account', + }); + } else { + Util.logger.info( + ` ☇ skipping ${email}- this email address is not a valid email` + ); + } + } + } else { + for (const notification of notificationBody.workers) { + if (notification.notificationType == 'Error') { + notificationBody.workers.map( + (notification) => (notification.body = errorNote) + ); + } + } + } + if ( + notificationBody.workers && + notificationBody.workers.length > 0 && + (await this.#updateNotificationInfoREST( + key, + automationLegacyMapObj.metadata[key].id, + notificationBody + )) === 'OK' + ) { + updatedKeys.push(key); + } + } + } + + return updatedKeys; + } + /** + * A function to remove automation email notifications and/or notes + * + * @param {string} keys metadata keys + * @returns {Promise.} keys of the automations where notifications were updated + */ + static async clearNotifications(keys) { + const clear = Util.OPTIONS.clear.toLowerCase(); + const automationLegacyMapObj = await this.#getEncodedAutomationIDs(); // retrieve automation legacy keys to update notifications + const updatedKeys = []; + let notificationsResult; + for (const key of Object.keys(automationLegacyMapObj.metadata)) { + if (Array.isArray(keys) && keys.includes(key)) { + let notificationBody; + notificationBody = { + programId: automationLegacyMapObj.metadata[key].id, + workers: [], + }; + try { + notificationsResult = await this.client.rest.get( + '/legacy/v1/beta/automations/notifications/' + + automationLegacyMapObj.metadata[key].id + ); + } catch (ex) { + Util.logger.error( + `Error retrieving notifications for automation '${key}': ${ex.message} (${ex.code}))` + ); + } + if (!notificationsResult.workers) { + Util.logger.info( + `☇ skipping automation ${key}. No notifications set for this automation.'` + ); + continue; + } + switch (clear) { + case 'all': { + notificationBody = { + programId: automationLegacyMapObj.metadata[key].id, + }; + Util.logger.info( + `--clear=all option was provided. Removing all emails and notes'` + ); + break; + } + case 'erroremail': { + for (const notification of notificationsResult.workers) { + if (notification.notificationType == 'Complete') { + notificationBody.workers.push(notification); + } + } + Util.logger.info( + `--clear=erroremail option was provided. Removing all error emails and notes'` + ); + break; + } + case 'completionemail': { + for (const notification of notificationsResult.workers) { + if (notification.notificationType == 'Error') { + notificationBody.workers.push(notification); + } + } + Util.logger.info( + `--clear=completionemail option was provided. Removing all completion emails and notes'` + ); + break; + } + case 'notes': { + // removes only notes (completion and error) + notificationsResult.workers.map((notification) => (notification.body = '')); + notificationBody.workers = notificationsResult.workers; + Util.logger.info(`--clear=notes option was provided. Removing all notes'`); + break; + } + default: { + Util.logger.error(`Unknown --clear option. Exiting'`); + return updatedKeys; + } + } + // update notifications + if ( + (await this.#updateNotificationInfoREST( + key, + automationLegacyMapObj.metadata[key].id, + notificationBody + )) === 'OK' + ) { + Util.logger.info(`clearNotifications executed for automation '${key}'`); + updatedKeys.push(key); + } + } + } + return updatedKeys; + } } // Assign definition to static attributes diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 5348a4909..5b39736f7 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -171,6 +171,40 @@ class ImportFile extends MetadataType { metadata.updateTypeId = this.definition.updateTypeMapping[metadata.c__dataAction]; return metadata; } + /** + * helper function to get a list of keys where notification email address should be updated + * + * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField + * @returns {string[]} list of keys + */ + static async getKeysToSetNotifications(metadataMap) { + const keysForDeploy = []; + if (Object.keys(metadataMap).length) { + Util.logger.info( + `Searching for ${this.definition.type} keys among downloaded items where notification email address should be updated:` + ); + for (const item of Object.values(metadataMap)) { + if (item['notificationEmailAddress'] === Util.OPTIONS.completionEmail) { + Util.logger.verbose( + ` ☇ skipping ${this.definition.type} ${ + item[this.definition.keyField] + }: email address does not need to be updated` + ); + } else { + keysForDeploy.push(item[this.definition.keyField]); + Util.logger.info( + ` - added ${this.definition.type} to updateNotification queue: ${ + item[this.definition.keyField] + }` + ); + } + } + Util.logger.info( + `Found ${keysForDeploy.length} ${this.definition.type} keys to update email notification address` + ); + } + return keysForDeploy; + } /** * parses retrieved Metadata before saving @@ -229,6 +263,33 @@ class ImportFile extends MetadataType { delete metadata.updateTypeId; return metadata; } + /** + * helper for {@link MetadataType.upsert} + * + * @param {TYPE.MetadataTypeMap} metadataMap list of metadata + * @param {string} metadataKey key of item we are looking at + * @param {boolean} hasError error flag from previous code + * @param {TYPE.MetadataTypeItemDiff[]} metadataToUpdate list of items to update + * @param {TYPE.MetadataTypeItem[]} metadataToCreate list of items to create + * @returns {'create' | 'update' | 'skip'} action to take + */ + static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { + if (Util.OPTIONS.clear) { + metadataMap[metadataKey].sendEmailNotification = false; + metadataMap[metadataKey].notificationEmailAddress = ''; + } else if (Util.OPTIONS.completionEmail) { + metadataMap[metadataKey].sendEmailNotification = true; + metadataMap[metadataKey].notificationEmailAddress = Util.OPTIONS.completionEmail; + } + const createOrUpdateAction = super.createOrUpdate( + metadataMap, + metadataKey, + hasError, + metadataToUpdate, + metadataToCreate + ); + return createOrUpdateAction; + } } // Assign definition to static attributes diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 2ea9cb9c2..d33ce269f 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -2163,6 +2163,29 @@ class MetadataType { } return keysForDeploy; } + /** + * Abstract function to get a list of keys where notification email address should be updated + * + * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField + * @returns {string[]} list of keys + */ + static async getKeysToSetNotifications(metadataMap) { + Util.logger.error( + ` ☇ skipping ${this.definition.type}: getKeysToSetNotifications is not supported yet for ${this.definition.type}` + ); + return []; + } + /** + * Abstract updateNotifications method that needs to be implemented in child metadata type + * + * @returns {string[]} returns keys of items where notification email address was set + */ + static async updateNotifications() { + Util.logger.error( + ` ☇ skipping ${this.definition.type}: updateNotifications is not supported yet for ${this.definition.type}` + ); + return []; + } } MetadataType.definition = { diff --git a/lib/metadataTypes/Verification.js b/lib/metadataTypes/Verification.js index 28cfc5ab3..271f85449 100644 --- a/lib/metadataTypes/Verification.js +++ b/lib/metadataTypes/Verification.js @@ -5,6 +5,8 @@ import MetadataType from './MetadataType.js'; import TYPE from '../../types/mcdev.d.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; +import Cli from '../util/cli.js'; + /** * Verification MetadataType * @@ -221,6 +223,116 @@ class Verification extends MetadataType { static deleteByKey(key) { return super.deleteByKeyREST('/automation/v1/dataverifications/' + key, key); } + /** + * helper function to get a list of keys where notification email addresses or notes should be updated + * + * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField + * @returns {string[]} list of keys + */ + static async getKeysToSetNotifications(metadataMap) { + const keysForDeploy = []; + let completionEmail = []; + if (Util.OPTIONS.completionEmail) { + completionEmail = Util.OPTIONS.completionEmail.split(','); + } + if (Object.keys(metadataMap).length) { + Util.logger.info( + `Searching for ${this.definition.type} keys among downloaded items where notification email address should be updated:` + ); + for (const item of Object.values(metadataMap)) { + const oldCompletionEmails = item['notificationEmailAddress']; + const oldCompletionNote = item['notificationEmailMessage']; + + if (Util.OPTIONS.clear && (oldCompletionEmails != '' || oldCompletionNote != '')) { + keysForDeploy.push(item[this.definition.keyField]); + Util.logger.info( + ` - added ${this.definition.type} to updateNotification queue: ${ + item[this.definition.keyField] + }` + ); + continue; + } + + for (const email of completionEmail) { + if (oldCompletionEmails.includes(email) || !Util.emailValidator(email)) { + Util.logger.info( + ` ☇ skipping ${email}- this email address is already in the notifications or is not a valid email` + ); + Util.OPTIONS.completionEmail = completionEmail.slice( + completionEmail.indexOf(email), + 1 + ); + } + } + if (oldCompletionNote == Util.OPTIONS.completionNote) { + Util.logger.verbose( + ` ☇ skipping --completionNote, note does not need to be updated` + ); + Util.OPTIONS.completionNote = undefined; + } + // if email address/-es were not set, ask for input + if ( + Util.OPTIONS.completionNote && + completionEmail.length < 1 && + oldCompletionEmails.length < 1 + ) { + const emails = await Cli.updateNotificationEmails('completionEmail'); + if (emails) { + Util.OPTIONS.completionEmail = emails.join(','); + } else { + Util.OPTIONS.completionNote = undefined; + Util.logger.info( + ` ☇ skipping --completionNote' - the email address for Run completion was not set` + ); + } + } + if (Util.OPTIONS.completionNote || completionEmail.length > 0) { + keysForDeploy.push(item[this.definition.keyField]); + Util.logger.info( + ` - added ${this.definition.type} to updateNotification queue: ${ + item[this.definition.keyField] + }` + ); + } + } + Util.logger.info( + `Found ${keysForDeploy.length} ${this.definition.type} keys to update email notification address` + ); + } + return keysForDeploy; + } + /** + * helper for {@link MetadataType.upsert} + * + * @param {TYPE.MetadataTypeMap} metadataMap list of metadata + * @param {string} metadataKey key of item we are looking at + * @param {boolean} hasError error flag from previous code + * @param {TYPE.MetadataTypeItemDiff[]} metadataToUpdate list of items to update + * @param {TYPE.MetadataTypeItem[]} metadataToCreate list of items to create + * @returns {'create' | 'update' | 'skip'} action to take + */ + static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { + if (Util.OPTIONS.clear) { + metadataMap[metadataKey].notificationEmailAddress = ''; + metadataMap[metadataKey].notificationEmailMessage = ''; + metadataMap[metadataKey].shouldEmailOnFailure = false; + } + if (Util.OPTIONS.completionEmail) { + metadataMap[metadataKey].notificationEmailAddress = Util.OPTIONS.completionEmail; + metadataMap[metadataKey].shouldEmailOnFailure = true; + } + if (Util.OPTIONS.completionNote) { + metadataMap[metadataKey].notificationEmailMessage = Util.OPTIONS.completionNote; + } + const createOrUpdateAction = super.createOrUpdate( + metadataMap, + metadataKey, + hasError, + metadataToUpdate, + metadataToCreate + ); + return createOrUpdateAction; + } } // Assign definition to static attributes diff --git a/lib/util/cli.js b/lib/util/cli.js index c35aa453a..36cf73b90 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -55,7 +55,48 @@ const Cli = { return null; } }, - + /** + * interactive helper to set automation run completion/error note + * + * @param {TYPE.SupportedMetadataTypes} noteType note type (error/completion) + * @returns {Promise.} responses + */ + async updateNotificationEmails(noteType) { + const questions = []; + questions.push( + { + type: 'confirm', + name: 'provideEmail', + message: `To set run ${noteType} note, an email address should be set. Do you want to set it?`, + default: false, + }, + { + type: 'input', + name: 'updateNotificationNotes', + message: `Please enter email addresses separated by a comma:`, + // eslint-disable-next-line jsdoc/require-jsdoc + filter: function (emails) { + return emails + .split(',') + .map((email) => { + if (!Util.emailValidator(email)) { + Util.logger.info(` ☇ skipping ${email}' - invalid email address`); + } + return email.trim(); + }) + .filter((email) => Util.emailValidator(email)); + }, + } + ); + try { + if (!(await inquirer.prompt(questions[0])).provideEmail) { + return; + } + return (await inquirer.prompt(questions[1])).updateNotificationNotes; + } catch (ex) { + Util.logger.info(ex); + } + }, /** * * @param {TYPE.SupportedMetadataTypes} type limit execution to given metadata type diff --git a/lib/util/util.js b/lib/util/util.js index 80d9ffcb5..537091f1f 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -202,6 +202,18 @@ export const Util = { return []; } }, + /** + * helper that validates email address + * + * @param {string} email email to validate + * @returns {boolean} first elem is type, second elem is subType + */ + emailValidator(email) { + const regex = new RegExp( + "^([!#-'*+/-9=?A-Z^-~-]+(.[!#-'*+/-9=?A-Z^-~-]+)*|\"([]!#-[^-~ \\t]|(\\[\\t -~]))+\")@([!#-'*+/-9=?A-Z^-~-]+(.[!#-'*+/-9=?A-Z^-~-]+)*|[[\\t -Z^-~]*])$" + ); + return regex.test(email); + }, /** * helper for getDefaultProperties() diff --git a/package-lock.json b/package-lock.json index d0938404e..ea7e066a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3196,9 +3196,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "hasInstallScript": true, "optional": true, - "os": [ - "darwin" - ], + "os": ["darwin"], "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } diff --git a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile_updateNotifications.importFile-meta.json b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile_updateNotifications.importFile-meta.json new file mode 100644 index 000000000..1e041b354 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile_updateNotifications.importFile-meta.json @@ -0,0 +1,30 @@ +{ + "allowErrors": true, + "createdDate": "2022-11-09T05:32:30.533", + "customerKey": "testExisting_importFile_updateNotifications", + "dateFormatLocale": "en-US", + "deleteFile": false, + "description": "updated on deploy", + "fieldMappingType": "InferFromColumnHeadings", + "fieldMappings": [], + "fileNamingPattern": "blabla", + "fileTransferLocationTypeId": 0, + "fileType": "CSV", + "filter": "", + "hasColumnHeader": true, + "isOrderedImport": true, + "isSequential": true, + "maxFileAgeHours": 0, + "maxFileAgeScheduleOffsetHours": 0, + "maxImportFrequencyHours": 0, + "modifiedDate": "2022-11-17T07:13:03.95", + "name": "testExisting_importFile_updateNotifications", + "sendEmailNotification": true, + "notificationEmailAddress": "test@test.com", + "standardQuotedStrings": true, + "r__fileLocation_name": "ExactTarget Enhanced FTP", + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "c__subscriberImportType": "DataExtension", + "c__dataAction": "AddUpdate" +} diff --git a/test/resources/9999999/automation/build-expected.json b/test/resources/9999999/automation/build-expected.json index d0e111d1e..ce762f784 100644 --- a/test/resources/9999999/automation/build-expected.json +++ b/test/resources/9999999/automation/build-expected.json @@ -40,6 +40,26 @@ { "name": "testTemplated_39f6a488-20eb-4ba0-b0b9", "r__type": "verification" + }, + { + "name": "testTemplated_verification_updateNotificationsNote", + "r__type": "verification" + }, + { + "name": "testTemplated_verification_updateNotificationsEmail", + "r__type": "verification" + }, + { + "name": "testTemplated_verification_NOTupdateNotificationsEmail", + "r__type": "verification" + }, + { + "name": "testTemplated_verification_NOTupdateNotificationsNote", + "r__type": "verification" + }, + { + "name": "testTemplated_verification_clear", + "r__type": "verification" } ], "name": "" diff --git a/test/resources/9999999/automation/clearNotificationsAll-expected.json b/test/resources/9999999/automation/clearNotificationsAll-expected.json new file mode 100644 index 000000000..7ee326e5c --- /dev/null +++ b/test/resources/9999999/automation/clearNotificationsAll-expected.json @@ -0,0 +1,45 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_clearNotificationsAll", + "name": "testExisting_automation_clearNotificationsAll", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled" +} diff --git a/test/resources/9999999/automation/clearNotificationsCompletionEmail-expected.json b/test/resources/9999999/automation/clearNotificationsCompletionEmail-expected.json new file mode 100644 index 000000000..11f0eaab0 --- /dev/null +++ b/test/resources/9999999/automation/clearNotificationsCompletionEmail-expected.json @@ -0,0 +1,52 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_clearNotificationsCompletionEmail", + "name": "testExisting_automation_clearNotificationsCompletionEmail", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/clearNotificationsErrorEmail-expected.json b/test/resources/9999999/automation/clearNotificationsErrorEmail-expected.json new file mode 100644 index 000000000..11141755c --- /dev/null +++ b/test/resources/9999999/automation/clearNotificationsErrorEmail-expected.json @@ -0,0 +1,52 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_clearNotificationsErrorEmail", + "name": "testExisting_automation_clearNotificationsErrorEmail", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + } + ] +} diff --git a/test/resources/9999999/automation/clearNotificationsNotes-expected.json b/test/resources/9999999/automation/clearNotificationsNotes-expected.json new file mode 100644 index 000000000..52b46bc9a --- /dev/null +++ b/test/resources/9999999/automation/clearNotificationsNotes-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_clearNotificationsNotes", + "name": "testExisting_automation_clearNotificationsNotes", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/retrieve-expected.json b/test/resources/9999999/automation/retrieve-expected.json index a598c8aff..6f66533b3 100644 --- a/test/resources/9999999/automation/retrieve-expected.json +++ b/test/resources/9999999/automation/retrieve-expected.json @@ -40,6 +40,26 @@ { "name": "testExisting_39f6a488-20eb-4ba0-b0b9", "r__type": "verification" + }, + { + "name": "testExisting_verification_updateNotificationsNote", + "r__type": "verification" + }, + { + "name": "testExisting_verification_updateNotificationsEmail", + "r__type": "verification" + }, + { + "name": "testExisting_verification_NOTupdateNotificationsEmail", + "r__type": "verification" + }, + { + "name": "testExisting_verification_NOTupdateNotificationsNote", + "r__type": "verification" + }, + { + "name": "testExisting_verification_clear", + "r__type": "verification" } ], "name": "" diff --git a/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md b/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md index 161e31040..67a8afb07 100644 --- a/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md +++ b/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md @@ -29,3 +29,8 @@ | _1.5: query_
testExisting_query | | _1.6: script_
testExisting_script | | _1.7: verification_
testExisting_39f6a488-20eb-4ba0-b0b9 | +| _1.8: verification_
testExisting_verification_updateNotificationsNote | +| _1.9: verification_
testExisting_verification_updateNotificationsEmail | +| _1.10: verification_
testExisting_verification_NOTupdateNotificationsEmail | +| _1.11: verification_
testExisting_verification_NOTupdateNotificationsNote | +| _1.12: verification_
testExisting_verification_clear | diff --git a/test/resources/9999999/automation/template-expected.json b/test/resources/9999999/automation/template-expected.json index 9e3db99fc..5928fb1d8 100644 --- a/test/resources/9999999/automation/template-expected.json +++ b/test/resources/9999999/automation/template-expected.json @@ -40,6 +40,26 @@ { "name": "{{{prefix}}}39f6a488-20eb-4ba0-b0b9", "r__type": "verification" + }, + { + "name": "{{{prefix}}}verification_updateNotificationsNote", + "r__type": "verification" + }, + { + "name": "{{{prefix}}}verification_updateNotificationsEmail", + "r__type": "verification" + }, + { + "name": "{{{prefix}}}verification_NOTupdateNotificationsEmail", + "r__type": "verification" + }, + { + "name": "{{{prefix}}}verification_NOTupdateNotificationsNote", + "r__type": "verification" + }, + { + "name": "{{{prefix}}}verification_clear", + "r__type": "verification" } ], "name": "" diff --git a/test/resources/9999999/automation/updateNotifications_completionEmailCompletionNote-expected.json b/test/resources/9999999/automation/updateNotifications_completionEmailCompletionNote-expected.json new file mode 100644 index 000000000..235f4e9f3 --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_completionEmailCompletionNote-expected.json @@ -0,0 +1,52 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionEmailCompletionNote", + "name": "testExisting_automation_updateNotifications_completionEmailCompletionNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_completionEmailCompletionNoteErrorNote-expected.json b/test/resources/9999999/automation/updateNotifications_completionEmailCompletionNoteErrorNote-expected.json new file mode 100644 index 000000000..6c7067aae --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_completionEmailCompletionNoteErrorNote-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote", + "name": "testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_completionEmailErrorNote-expected.json b/test/resources/9999999/automation/updateNotifications_completionEmailErrorNote-expected.json new file mode 100644 index 000000000..5ebc17a06 --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_completionEmailErrorNote-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionEmailErrorNote", + "name": "testExisting_automation_updateNotifications_completionEmailErrorNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_completionEmailNoteErrorEmailNote-expected.json b/test/resources/9999999/automation/updateNotifications_completionEmailNoteErrorEmailNote-expected.json new file mode 100644 index 000000000..0a0587f0c --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_completionEmailNoteErrorEmailNote-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote", + "name": "testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_completionNote-expected.json b/test/resources/9999999/automation/updateNotifications_completionNote-expected.json new file mode 100644 index 000000000..20a18d58d --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_completionNote-expected.json @@ -0,0 +1,52 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionNote", + "name": "testExisting_automation_updateNotifications_completionNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmail-expected.json b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmail-expected.json new file mode 100644 index 000000000..2a901d1f4 --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmail-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionEmail", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionEmail", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmailCompletionNote-expected.json b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmailCompletionNote-expected.json new file mode 100644 index 000000000..75224592c --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmailCompletionNote-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionEmailErrorNote", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionEmailErrorNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmailErrorNote-expected.json b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmailErrorNote-expected.json new file mode 100644 index 000000000..7c469942a --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionEmailErrorNote-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionEmailErrorNote", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionEmailErrorNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNote-expected.json b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNote-expected.json new file mode 100644 index 000000000..25beedde8 --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNote-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNote", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNoteCompletionEmail-expected.json b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNoteCompletionEmail-expected.json new file mode 100644 index 000000000..86fd6aed4 --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNoteCompletionEmail-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNoteErrorNote-expected.json b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNoteErrorNote-expected.json new file mode 100644 index 000000000..d0ff4f894 --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_errorEmailCompletionNoteErrorNote-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_errorEmailErrorNote-expected.json b/test/resources/9999999/automation/updateNotifications_errorEmailErrorNote-expected.json new file mode 100644 index 000000000..666339633 --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_errorEmailErrorNote-expected.json @@ -0,0 +1,52 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailErrorNote", + "name": "testExisting_automation_updateNotifications_errorEmailErrorNote", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/updateNotifications_errorEmailErrorNoteCompletionEmail-expected.json b/test/resources/9999999/automation/updateNotifications_errorEmailErrorNoteCompletionEmail-expected.json new file mode 100644 index 000000000..168d3cc73 --- /dev/null +++ b/test/resources/9999999/automation/updateNotifications_errorEmailErrorNoteCompletionEmail-expected.json @@ -0,0 +1,57 @@ +{ + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail", + "name": "testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail", + "r__folder_Path": "my automations", + "schedule": { + "endDate": "2022-07-30T00:00:00", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "startDate": "2022-07-30T00:00:00", + "timezoneName": "W. Europe Standard Time" + }, + "status": "PausedSchedule", + "steps": [ + { + "activities": [ + { + "name": "testExisting_dataExtract", + "r__type": "dataExtract" + }, + { + "name": "testExisting_emailSend", + "r__type": "emailSend" + }, + { + "name": "testExisting_fileTransfer", + "r__type": "fileTransfer" + }, + { + "name": "testExisting_importFile", + "r__type": "importFile" + }, + { + "name": "testExisting_query", + "r__type": "query" + }, + { + "name": "testExisting_script", + "r__type": "script" + } + ], + "name": "" + } + ], + "type": "scheduled", + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json index 3c982a924..c147cd7e0 100644 --- a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json @@ -85,6 +85,41 @@ "activityObjectId": "testExisting_39f6a488-20eb-4ba0-b0b9", "objectTypeId": 1000, "displayOrder": 7 + }, + { + "id": "f3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_dataExtension", + "activityObjectId": "testExisting_verification_updateNotificationsNote", + "objectTypeId": 1000, + "displayOrder": 8 + }, + { + "id": "f3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_dataExtension", + "activityObjectId": "testExisting_verification_updateNotificationsEmail", + "objectTypeId": 1000, + "displayOrder": 9 + }, + { + "id": "f3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_dataExtension", + "activityObjectId": "testExisting_verification_NOTupdateNotificationsEmail", + "objectTypeId": 1000, + "displayOrder": 10 + }, + { + "id": "f3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_dataExtension", + "activityObjectId": "testExisting_verification_NOTupdateNotificationsNote", + "objectTypeId": 1000, + "displayOrder": 11 + }, + { + "id": "f3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_dataExtension", + "activityObjectId": "testExisting_verification_clear", + "objectTypeId": 1000, + "displayOrder": 12 } ] } diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clear/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clear/get-response.json new file mode 100644 index 000000000..949d7ebbe --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clear/get-response.json @@ -0,0 +1,85 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-clear", + "name": "testExisting_automation_clear", + "description": "bla bla", + "key": "testExisting_automation_clear", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsAll/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsAll/get-response.json new file mode 100644 index 000000000..2bab6cea0 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsAll/get-response.json @@ -0,0 +1,85 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-clearNotificationsAll", + "name": "testExisting_automation_clearNotificationsAll", + "description": "bla bla", + "key": "testExisting_automation_clearNotificationsAll", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsCompletionEmail/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsCompletionEmail/get-response.json new file mode 100644 index 000000000..71156d9ce --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsCompletionEmail/get-response.json @@ -0,0 +1,92 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-clearNotificationsCompletionEmail", + "name": "testExisting_automation_clearNotificationsCompletionEmail", + "description": "bla bla", + "key": "testExisting_automation_clearNotificationsCompletionEmail", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsErrorEmail/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsErrorEmail/get-response.json new file mode 100644 index 000000000..134103842 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsErrorEmail/get-response.json @@ -0,0 +1,92 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-clearNotificationsErrorEmail", + "name": "testExisting_automation_clearNotificationsErrorEmail", + "description": "bla bla", + "key": "testExisting_automation_clearNotificationsErrorEmail", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsNotes/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsNotes/get-response.json new file mode 100644 index 000000000..b7fa1f011 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-clearNotificationsNotes/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-clearNotificationsNotes", + "name": "testExisting_automation_clearNotificationsNotes", + "description": "bla bla", + "key": "testExisting_automation_clearNotificationsNotes", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNote/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNote/get-response.json new file mode 100644 index 000000000..159e7fa18 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNote/get-response.json @@ -0,0 +1,92 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNote", + "name": "testExisting_automation_updateNotifications_completionEmailCompletionNote", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionEmailCompletionNote", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNoteErrorNote/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNoteErrorNote/get-response.json new file mode 100644 index 000000000..59ad5e09c --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNoteErrorNote/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNoteErrorNote", + "name": "testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailErrorNote/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailErrorNote/get-response.json new file mode 100644 index 000000000..a70b87842 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailErrorNote/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailErrorNote", + "name": "testExisting_automation_updateNotifications_completionEmailErrorNote", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionEmailErrorNote", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailNoteErrorEmailNote/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailNoteErrorEmailNote/get-response.json new file mode 100644 index 000000000..3131eb8e4 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailNoteErrorEmailNote/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailNoteErrorEmailNote", + "name": "testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionNote/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionNote/get-response.json new file mode 100644 index 000000000..cb0b7dd5e --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_completionNote/get-response.json @@ -0,0 +1,92 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_completionNote", + "name": "testExisting_automation_updateNotifications_completionNote", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_completionNote", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionEmail/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionEmail/get-response.json new file mode 100644 index 000000000..0cf77dc73 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionEmail/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionEmail", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionEmail", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionEmail", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNote/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNote/get-response.json new file mode 100644 index 000000000..ccf9a0bf0 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNote/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNote", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNote", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNote", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteCompletionEmail/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteCompletionEmail/get-response.json new file mode 100644 index 000000000..eefb00814 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteCompletionEmail/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteCompletionEmail", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteErrorNote/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteErrorNote/get-response.json new file mode 100644 index 000000000..094907759 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteErrorNote/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteErrorNote", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNote/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNote/get-response.json new file mode 100644 index 000000000..f96a9126a --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNote/get-response.json @@ -0,0 +1,92 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNote", + "name": "testExisting_automation_updateNotifications_errorEmailErrorNote", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailErrorNote", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNoteCompletionEmail/get-response.json b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNoteCompletionEmail/get-response.json new file mode 100644 index 000000000..3eb6eebe3 --- /dev/null +++ b/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNoteCompletionEmail/get-response.json @@ -0,0 +1,97 @@ +{ + "id": "08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNoteCompletionEmail", + "name": "testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail", + "description": "bla bla", + "key": "testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail", + "typeId": 1, + "type": "scheduled", + "statusId": 4, + "status": "PausedSchedule", + "categoryId": 290937, + "schedule": { + "id": "b393aa6c-a4a8-4c0f-a148-9250258a7339", + "typeId": 3, + "startDate": "2022-07-30T00:00:00", + "endDate": "2022-07-30T00:00:00", + "scheduledTime": "0001-01-01T07:00:00", + "rangeTypeId": 0, + "occurrences": 1, + "pattern": "01", + "icalRecur": "FREQ=DAILY;COUNT=1;INTERVAL=1", + "timezoneName": "W. Europe Standard Time", + "scheduleStatus": "scheduled", + "timezoneId": 5 + }, + "steps": [ + { + "id": "13fda077-0e82-4936-b936-a36b0997fc44", + "name": "", + "step": 1, + "activities": [ + { + "id": "8081a992-a27d-4a43-984a-d60114ea1025", + "name": "testExisting_dataExtract", + "activityObjectId": "56c5370a-f988-4f36-b0ee-0f876573f6d7", + "objectTypeId": 73, + "displayOrder": 1 + }, + { + "id": "d3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_emailSend", + "activityObjectId": "9b1c7bf9-4964-ed11-b849-48df37d1de8b", + "objectTypeId": 42, + "displayOrder": 2 + }, + { + "id": "2c77fc42-85eb-4611-98f9-223d29d89d72", + "name": "testExisting_fileTransfer", + "activityObjectId": "72c328ac-f5b0-4e37-91d3-a775666f15a6", + "objectTypeId": 53, + "displayOrder": 3 + }, + { + "id": "298b2794-28cb-4c70-b7ad-58b2c8cf48f7", + "name": "testExisting_importFile", + "activityObjectId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "objectTypeId": 43, + "displayOrder": 4, + "targetDataExtensions": [ + { + "id": "21711373-72c1-ec11-b83b-48df37d1deb7", + "name": "testExisting_dataExtension", + "key": "testExisting_dataExtension", + "description": "bla bla", + "rowCount": 0 + } + ] + }, + { + "id": "e3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_query_WRONG_NAME", + "activityObjectId": "549f0568-607c-4940-afef-437965094dat", + "objectTypeId": 300, + "displayOrder": 5 + }, + { + "id": "g3774dc2-a271-4a44-8cbe-f630a6d6545e", + "name": "testExisting_script", + "activityObjectId": "39f6a488-20eb-4ba0-b0b9-023725b574e4", + "objectTypeId": 423, + "displayOrder": 6 + } + ] + } + ], + "notifications": [ + { + "email": ["test@test.com"], + "message": "", + "type": "Complete" + }, + { + "email": ["test@test.com"], + "message": "test", + "type": "Error" + } + ] +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsEmail/get-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsEmail/get-response.json new file mode 100644 index 000000000..356fe53f5 --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsEmail/get-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_NOTupdateNotificationsEmail", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": false, + "notificationEmailAddress": "", + "notificationEmailMessage": "", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsEmail/patch-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsEmail/patch-response.json new file mode 100644 index 000000000..356fe53f5 --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsEmail/patch-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_NOTupdateNotificationsEmail", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": false, + "notificationEmailAddress": "", + "notificationEmailMessage": "", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsNote/get-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsNote/get-response.json new file mode 100644 index 000000000..a2f87058c --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsNote/get-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_NOTupdateNotificationsNote", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": false, + "notificationEmailAddress": "test@test.com", + "notificationEmailMessage": "test", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsNote/patch-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsNote/patch-response.json new file mode 100644 index 000000000..d57a61a13 --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_NOTupdateNotificationsNote/patch-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_NOTupdateNotificationsEmail", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": false, + "notificationEmailAddress": "test@test.com", + "notificationEmailMessage": "test", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_clear/get-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_clear/get-response.json new file mode 100644 index 000000000..18e4fa385 --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_clear/get-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_clear", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": false, + "notificationEmailAddress": "test@test.com", + "notificationEmailMessage": "test", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_clear/patch-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_clear/patch-response.json new file mode 100644 index 000000000..611c8b15b --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_clear/patch-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_clear", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": true, + "notificationEmailAddress": "", + "notificationEmailMessage": "", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsEmail/get-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsEmail/get-response.json new file mode 100644 index 000000000..9029d133d --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsEmail/get-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_updateNotificationsEmail", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": false, + "notificationEmailAddress": "", + "notificationEmailMessage": "", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsEmail/patch-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsEmail/patch-response.json new file mode 100644 index 000000000..6d8370eff --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsEmail/patch-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_updateNotificationsEmail", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": true, + "notificationEmailAddress": "test@test.com", + "notificationEmailMessage": "", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsNote/get-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsNote/get-response.json new file mode 100644 index 000000000..e7ce8363e --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsNote/get-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_updateNotificationsNote", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": false, + "notificationEmailAddress": "test@test.com", + "notificationEmailMessage": "", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsNote/patch-response.json b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsNote/patch-response.json new file mode 100644 index 000000000..87a0707ef --- /dev/null +++ b/test/resources/9999999/automation/v1/dataverifications/testExisting_verification_updateNotificationsNote/patch-response.json @@ -0,0 +1,12 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_updateNotificationsNote", + "targetObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "verificationType": "IsEqualTo", + "value1": 1, + "value2": 0, + "shouldStopOnFailure": true, + "shouldEmailOnFailure": true, + "notificationEmailAddress": "test@test.com", + "notificationEmailMessage": "test", + "createdBy": 700301950 +} diff --git a/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b_updateNotifications/patch-response.json b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b_updateNotifications/patch-response.json new file mode 100644 index 000000000..886964e97 --- /dev/null +++ b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b_updateNotifications/patch-response.json @@ -0,0 +1,31 @@ +{ + "allowErrors": true, + "customerKey": "testExisting_importFile_updateNotifications", + "dateFormatLocale": "en-US", + "deleteFile": false, + "description": "updated on deploy", + "fieldMappingType": "InferFromColumnHeadings", + "fieldMappings": [], + "fileNamingPattern": "blabla", + "fileTransferLocationTypeId": 0, + "fileType": "CSV", + "filter": "", + "hasColumnHeader": true, + "isOrderedImport": true, + "isSequential": true, + "maxFileAgeHours": 0, + "maxFileAgeScheduleOffsetHours": 0, + "maxImportFrequencyHours": 0, + "name": "testExisting_importFile_updateNotifications", + "sendEmailNotification": false, + "standardQuotedStrings": true, + "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24", + "destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "destinationObjectTypeId": 310, + "subscriberImportTypeId": 255, + "updateTypeId": 0, + "importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b_updateNotifications", + "createdDate": "2022-11-09T05:53:03.243", + "destinationId": 0, + "modifiedDate": "2023-07-18T09:11:26.19" +} diff --git a/test/resources/9999999/automation/v1/imports/get-response.json b/test/resources/9999999/automation/v1/imports/get-response.json index 000537e3b..688158665 100644 --- a/test/resources/9999999/automation/v1/imports/get-response.json +++ b/test/resources/9999999/automation/v1/imports/get-response.json @@ -1,7 +1,7 @@ { "page": 1, "pageSize": 500, - "count": 1, + "count": 2, "items": [ { "allowErrors": true, @@ -33,6 +33,37 @@ "subscriberImportTypeId": 255, "updateTypeId": 0, "fileTransferLocationTypeId": 0 + }, + { + "allowErrors": true, + "customerKey": "testExisting_importFile_updateNotifications", + "createdDate": "2022-11-09T05:32:30.533", + "modifiedDate": "2022-11-17T07:13:03.95", + "dateFormatLocale": "en-US", + "deleteFile": false, + "description": "17.11.2022", + "destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "destinationId": 0, + "destinationObjectTypeId": 310, + "fieldMappings": [], + "fieldMappingType": "InferFromColumnHeadings", + "fileNamingPattern": "blabla", + "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24", + "fileType": "CSV", + "filter": "", + "hasColumnHeader": true, + "importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b_updateNotifications", + "isOrderedImport": true, + "isSequential": true, + "maxFileAgeHours": 0, + "maxImportFrequencyHours": 0, + "maxFileAgeScheduleOffsetHours": 0, + "name": "testExisting_importFile_updateNotifications", + "sendEmailNotification": false, + "standardQuotedStrings": true, + "subscriberImportTypeId": 255, + "updateTypeId": 0, + "fileTransferLocationTypeId": 0 } ] } diff --git a/test/resources/9999999/importFile/patch_updateNotifications-expected.json b/test/resources/9999999/importFile/patch_updateNotifications-expected.json new file mode 100644 index 000000000..1e041b354 --- /dev/null +++ b/test/resources/9999999/importFile/patch_updateNotifications-expected.json @@ -0,0 +1,30 @@ +{ + "allowErrors": true, + "createdDate": "2022-11-09T05:32:30.533", + "customerKey": "testExisting_importFile_updateNotifications", + "dateFormatLocale": "en-US", + "deleteFile": false, + "description": "updated on deploy", + "fieldMappingType": "InferFromColumnHeadings", + "fieldMappings": [], + "fileNamingPattern": "blabla", + "fileTransferLocationTypeId": 0, + "fileType": "CSV", + "filter": "", + "hasColumnHeader": true, + "isOrderedImport": true, + "isSequential": true, + "maxFileAgeHours": 0, + "maxFileAgeScheduleOffsetHours": 0, + "maxImportFrequencyHours": 0, + "modifiedDate": "2022-11-17T07:13:03.95", + "name": "testExisting_importFile_updateNotifications", + "sendEmailNotification": true, + "notificationEmailAddress": "test@test.com", + "standardQuotedStrings": true, + "r__fileLocation_name": "ExactTarget Enhanced FTP", + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "c__subscriberImportType": "DataExtension", + "c__dataAction": "AddUpdate" +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_NOTupdateNotifications_InvalidEmails/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_NOTupdateNotifications_InvalidEmails/get-response.json new file mode 100644 index 000000000..76a04c245 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_NOTupdateNotifications_InvalidEmails/get-response.json @@ -0,0 +1,9 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_NOTupdateNotifications_InvalidEmails", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_NOTupdateNotifications_InvalidEmails", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_NOTupdateNotifications_InvalidEmails/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_NOTupdateNotifications_InvalidEmails/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsAll/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsAll/get-response.json new file mode 100644 index 000000000..8306cab4f --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsAll/get-response.json @@ -0,0 +1,13 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsAll", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsAll", + "id": "YjA2NmVlODEtODllOS00NTE4LTkwYzYtMTY4Mzg2ZTk3MGE4OjEyOjA" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsAll", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsAll/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsAll/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsCompletionEmail/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsCompletionEmail/get-response.json new file mode 100644 index 000000000..4cf622609 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsCompletionEmail/get-response.json @@ -0,0 +1,17 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsCompletionEmail", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsCompletionEmail", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsCompletionEmail", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Error", + "definition": "test@test.com", + "body": "test", + "channelType": "Account" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsCompletionEmail/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsCompletionEmail/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsErrorEmail/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsErrorEmail/get-response.json new file mode 100644 index 000000000..8198ec9f7 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsErrorEmail/get-response.json @@ -0,0 +1,17 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsErrorEmail", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsErrorEmail", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Complete", + "definition": "test@test.com", + "body": "test", + "channelType": "Account" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsErrorEmail", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsErrorEmail/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsErrorEmail/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsNotes/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsNotes/get-response.json new file mode 100644 index 000000000..b09f2a715 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsNotes/get-response.json @@ -0,0 +1,21 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsNotes", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsNotes", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Complete", + "definition": "test@test.com", + "body": "", + "channelType": "Account" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_clearNotificationsNotes", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Error", + "definition": "test@test.com", + "body": "", + "channelType": "Account" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsNotes/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsNotes/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNote/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNote/get-response.json new file mode 100644 index 000000000..a9b1aa906 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNote/get-response.json @@ -0,0 +1,9 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailCompletionNote", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailCompletionNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNote/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNote/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNoteErrorNote/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNoteErrorNote/get-response.json new file mode 100644 index 000000000..be727bd92 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNoteErrorNote/get-response.json @@ -0,0 +1,17 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailCompletionNoteErrorNote", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailCompletionNoteErrorNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Complete", + "definition": "test@test.com", + "body": "", + "channelType": "Account" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailCompletionNoteErrorNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNoteErrorNote/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNoteErrorNote/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailErrorNote/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailErrorNote/get-response.json new file mode 100644 index 000000000..3c9f0b2f2 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailErrorNote/get-response.json @@ -0,0 +1,17 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailErrorNote", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailErrorNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Error", + "definition": "test@test.com", + "body": "", + "channelType": "Account" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailErrorNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailErrorNote/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailErrorNote/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailNoteErrorEmailNote/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailNoteErrorEmailNote/get-response.json new file mode 100644 index 000000000..9fac824f0 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailNoteErrorEmailNote/get-response.json @@ -0,0 +1,9 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailNoteErrorEmailNote", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionEmailNoteErrorEmailNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailNoteErrorEmailNote/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailNoteErrorEmailNote/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionNote/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionNote/get-response.json new file mode 100644 index 000000000..cd8f0acae --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionNote/get-response.json @@ -0,0 +1,17 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionNote", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Complete", + "definition": "test@test.com", + "body": "", + "channelType": "Account" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_completionNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionNote/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionNote/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionEmail/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionEmail/get-response.json new file mode 100644 index 000000000..953e1d9f4 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionEmail/get-response.json @@ -0,0 +1,9 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionEmail", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionEmail", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionEmail/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionEmail/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNote/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNote/get-response.json new file mode 100644 index 000000000..6639e3ce3 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNote/get-response.json @@ -0,0 +1,17 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionNote", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Complete", + "definition": "test@test.com", + "body": "", + "channelType": "Account" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNote/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNote/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteCompletionEmail/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteCompletionEmail/get-response.json new file mode 100644 index 000000000..e32ba084e --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteCompletionEmail/get-response.json @@ -0,0 +1,9 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteCompletionEmail/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteCompletionEmail/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteErrorNote/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteErrorNote/get-response.json new file mode 100644 index 000000000..a384cd174 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteErrorNote/get-response.json @@ -0,0 +1,17 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionNoteErrorNote", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionNoteErrorNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA", + "notificationType": "Complete", + "definition": "test@test.com", + "body": "", + "channelType": "Account" + }, + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailCompletionNoteErrorNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteErrorNote/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteErrorNote/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNote/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNote/get-response.json new file mode 100644 index 000000000..eb840cc6a --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNote/get-response.json @@ -0,0 +1,9 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailErrorNote", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailErrorNote", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNote/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNote/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNoteCompletionEmail/get-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNoteCompletionEmail/get-response.json new file mode 100644 index 000000000..3baee9740 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNoteCompletionEmail/get-response.json @@ -0,0 +1,9 @@ +{ + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailErrorNoteCompletionEmail", + "workers": [ + { + "programId": "ZGQ4N2M2ZjEtYjJlZi00MDljLTg3MDctYzYwNWQ0MzdiYWI4OjI1OjA_updateNotifications_errorEmailErrorNoteCompletionEmail", + "id": "NGIzZGQ5N2EtMDI0ZS00MzFiLTg5ZWYtNTdjYTI4ODVjMjQ0OjEyOjA" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNoteCompletionEmail/post-response.json b/test/resources/9999999/legacy/v1/beta/automations/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNoteCompletionEmail/post-response.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json b/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json index 124f8fb90..57f78507a 100644 --- a/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json +++ b/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json @@ -25,6 +25,397 @@ "isPlatformObject": false, "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow", "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionEmail", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionEmail", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionEmail", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_errorEmailCompletionEmail", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clear", + "key": "testExisting_automation_clear", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_clear", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_clear", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsAll", + "key": "testExisting_automation_clearNotificationsAll", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_clearNotificationsAll", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_clearNotificationsAll", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsCompletionEmail", + "key": "testExisting_automation_clearNotificationsCompletionEmail", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_clearNotificationsCompletionEmail", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_clearNotificationsCompletionEmail", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsErrorEmail", + "key": "testExisting_automation_clearNotificationsErrorEmail", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_clearNotificationsErrorEmail", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_clearNotificationsErrorEmail", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_clearNotificationsNotes", + "key": "testExisting_automation_clearNotificationsNotes", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_clearNotificationsNotes", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_clearNotificationsNotes", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNote", + "key": "testExisting_automation_updateNotifications_errorEmailErrorNote", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_errorEmailErrorNote", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_errorEmailErrorNote", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNote", + "key": "testExisting_automation_updateNotifications_completionEmailCompletionNote", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_completionEmailCompletionNote", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_completionEmailCompletionNote", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailErrorNote", + "key": "testExisting_automation_updateNotifications_completionEmailErrorNote", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_completionEmailErrorNote", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_completionEmailErrorNote", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNote", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNote", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNote", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_errorEmailCompletionNote", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_errorEmailCompletionNoteCompletionEmail", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailErrorNoteCompletionEmail", + "key": "testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_errorEmailErrorNoteCompletionEmail", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_errorEmailCompletionNoteErrorNote", + "key": "testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_errorEmailCompletionNoteErrorNote", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailCompletionNoteErrorNote", + "key": "testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_completionEmailCompletionNoteErrorNote", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionNote", + "key": "testExisting_automation_updateNotifications_completionNote", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_completionNote", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_completionNote", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_updateNotifications_completionEmailNoteErrorEmailNote", + "key": "testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_updateNotifications_completionEmailNoteErrorEmailNote", + "automationType": "scheduled" + }, + { + "id": "RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoyNTow_NOTupdateNotifications_InvalidEmails", + "key": "testExisting_automation_NOTupdateNotifications_InvalidEmails", + "createdDate": "2022-01-12T08:41:35.773Z", + "name": "testExisting_automation_NOTupdateNotifications_InvalidEmails", + "description": "bla bla", + "clientId": 9999999, + "status": "Building", + "createdBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "modifiedDate": "2022-11-11T16:42:36.513Z", + "modifiedBy": { + "id": "NzE3MzUzNDA1OjQ6MA", + "name": "Tom Tester", + "email": "tom.tester@accenture.com" + }, + "isPlatformObject": false, + "notifications": "https://mcxxxxx.rest.marketingcloudapis.com/legacy/v1/beta/hub/notifications/RkpOcE9qSVh2VUdnYTVJbWFfWW14dzoxMjow_NOTupdateNotifications_InvalidEmails", + "automationType": "scheduled" } ] } diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_NOTupdateNotifications_InvalidEmails-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_NOTupdateNotifications_InvalidEmails-response.xml new file mode 100644 index 000000000..4f85281cf --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_NOTupdateNotifications_InvalidEmails-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-NOTupdateNotifications_InvalidEmails + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsAll-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsAll-response.xml new file mode 100644 index 000000000..0292c0933 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsAll-response.xml @@ -0,0 +1,32 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + + 08afb0e2-b00a-4c88-ad2e-clearNotificationsAll + + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsCompletionEmail-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsCompletionEmail-response.xml new file mode 100644 index 000000000..3b828b574 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsCompletionEmail-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-clearNotificationsCompletionEmail + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsErrorEmail-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsErrorEmail-response.xml new file mode 100644 index 000000000..76ea00e58 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsErrorEmail-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-clearNotificationsErrorEmail + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsNotes-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsNotes-response.xml new file mode 100644 index 000000000..0dce66c4b --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_clearNotificationsNotes-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-clearNotificationsNotes + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailCompletionNote-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailCompletionNote-response.xml new file mode 100644 index 000000000..519479641 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailCompletionNote-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNote + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote-response.xml new file mode 100644 index 000000000..07123d01a --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNoteErrorNote + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailErrorNote-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailErrorNote-response.xml new file mode 100644 index 000000000..6b480dc28 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailErrorNote-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailErrorNote + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote-response.xml new file mode 100644 index 000000000..e30411bbe --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailNoteErrorEmailNote + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionNote-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionNote-response.xml new file mode 100644 index 000000000..fa67fa56b --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_completionNote-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionNote + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionEmail-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionEmail-response.xml new file mode 100644 index 000000000..73ab8c119 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionEmail-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionEmail + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNote-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNote-response.xml new file mode 100644 index 000000000..06ae715bf --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNote-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNote + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail-response.xml new file mode 100644 index 000000000..3e1ee8835 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteCompletionEmail + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote-response.xml new file mode 100644 index 000000000..854642a62 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteErrorNote + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailErrorNote-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailErrorNote-response.xml new file mode 100644 index 000000000..0d6e9148e --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailErrorNote-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNote + + + + diff --git a/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail-response.xml b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail-response.xml new file mode 100644 index 000000000..bb369ebb1 --- /dev/null +++ b/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:60a72d4a-847e-4d9b-a4eb-a42951078298 + urn:uuid:0b59ed53-72ec-4481-ae06-4ee78912aef2 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-06-01T12:04:20Z + 2023-06-01T12:09:20Z + + + + + + OK + 3b1c8cee-b270-49cb-b77b-e7b33934d1b6 + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNoteCompletionEmail + + + + diff --git a/test/resources/9999999/program/retrieve-response.xml b/test/resources/9999999/program/retrieve-response.xml index 6490d5491..92a50d37f 100644 --- a/test/resources/9999999/program/retrieve-response.xml +++ b/test/resources/9999999/program/retrieve-response.xml @@ -45,6 +45,96 @@ testExisting_automation_fixedKey_paused testExisting_automation_fixKey_pause + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionEmail + testExisting_automation_updateNotifications_errorEmailCompletionEmail + testExisting_automation_updateNotifications_errorEmailCompletionEmail + + + + 08afb0e2-b00a-4c88-ad2e-clearNotificationsAll + testExisting_automation_clearNotificationsAll + testExisting_automation_clearNotificationsAll + + + + 08afb0e2-b00a-4c88-ad2e-clearNotificationsCompletionEmail + testExisting_automation_clearNotificationsCompletionEmail + testExisting_automation_clearNotificationsCompletionEmail + + + + 08afb0e2-b00a-4c88-ad2e-clearNotificationsErrorEmail + testExisting_automation_clearNotificationsErrorEmail + testExisting_automation_clearNotificationsErrorEmail + + + + 08afb0e2-b00a-4c88-ad2e-clearNotificationsNotes + testExisting_automation_clearNotificationsNotes + testExisting_automation_clearNotificationsNotes + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNote + testExisting_automation_updateNotifications_errorEmailErrorNote + testExisting_automation_updateNotifications_errorEmailErrorNote + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNote + testExisting_automation_updateNotifications_completionEmailCompletionNote + testExisting_automation_updateNotifications_completionEmailCompletionNote + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailErrorNote + testExisting_automation_updateNotifications_completionEmailErrorNote + testExisting_automation_updateNotifications_completionEmailErrorNote + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNote + testExisting_automation_updateNotifications_errorEmailCompletionNote + testExisting_automation_updateNotifications_errorEmailCompletionNote + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteCompletionEmail + testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail + testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailErrorNoteCompletionEmail + testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail + testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_errorEmailCompletionNoteErrorNote + testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote + testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailCompletionNoteErrorNote + testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote + testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionNote + testExisting_automation_updateNotifications_completionNote + testExisting_automation_updateNotifications_completionNote + + + + 08afb0e2-b00a-4c88-ad2e-updateNotifications_completionEmailNoteErrorEmailNote + testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote + testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote + diff --git a/test/resources/9999999/verification/NOTupdateNotificationsEmail-expected.json b/test/resources/9999999/verification/NOTupdateNotificationsEmail-expected.json new file mode 100644 index 000000000..40003bb8a --- /dev/null +++ b/test/resources/9999999/verification/NOTupdateNotificationsEmail-expected.json @@ -0,0 +1,11 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_NOTupdateNotificationsEmail", + "notificationEmailAddress": "", + "notificationEmailMessage": "", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "shouldEmailOnFailure": false, + "shouldStopOnFailure": true, + "value1": 1, + "value2": 0, + "verificationType": "IsEqualTo" +} diff --git a/test/resources/9999999/verification/clear-expected.json b/test/resources/9999999/verification/clear-expected.json new file mode 100644 index 000000000..f587fba89 --- /dev/null +++ b/test/resources/9999999/verification/clear-expected.json @@ -0,0 +1,11 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_clear", + "notificationEmailAddress": "", + "notificationEmailMessage": "", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "shouldEmailOnFailure": true, + "shouldStopOnFailure": true, + "value1": 1, + "value2": 0, + "verificationType": "IsEqualTo" +} diff --git a/test/resources/9999999/verification/updateNotificationsEmail-expected.json b/test/resources/9999999/verification/updateNotificationsEmail-expected.json new file mode 100644 index 000000000..b7e493f00 --- /dev/null +++ b/test/resources/9999999/verification/updateNotificationsEmail-expected.json @@ -0,0 +1,11 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_updateNotificationsEmail", + "notificationEmailAddress": "test@test.com", + "notificationEmailMessage": "", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "shouldEmailOnFailure": true, + "shouldStopOnFailure": true, + "value1": 1, + "value2": 0, + "verificationType": "IsEqualTo" +} diff --git a/test/resources/9999999/verification/updateNotificationsNote-expected.json b/test/resources/9999999/verification/updateNotificationsNote-expected.json new file mode 100644 index 000000000..bfbc84e94 --- /dev/null +++ b/test/resources/9999999/verification/updateNotificationsNote-expected.json @@ -0,0 +1,11 @@ +{ + "dataVerificationDefinitionId": "testExisting_verification_updateNotificationsNote", + "notificationEmailAddress": "test@test.com", + "notificationEmailMessage": "test", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "shouldEmailOnFailure": true, + "shouldStopOnFailure": true, + "value1": 1, + "value2": 0, + "verificationType": "IsEqualTo" +} diff --git a/test/type.automation.test.js b/test/type.automation.test.js index d2ebd629c..6ed365607 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -23,8 +23,8 @@ describe('type: automation', () => { const result = cache.getCache(); assert.equal( result.automation ? Object.keys(result.automation).length : 0, - 4, - 'only four automations expected' + 19, + 'only 19 automations expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_automation', 'automation'), @@ -45,7 +45,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 18, + 53, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -78,8 +78,8 @@ describe('type: automation', () => { const cacheResult = cache.getCache(); assert.equal( cacheResult.automation ? Object.keys(cacheResult.automation).length : 0, - 5, - 'three automations expected' + 20, + '20 automations expected' ); // insert assert.deepEqual( @@ -116,10 +116,9 @@ describe('type: automation', () => { ) ) ); - assert.equal( testUtils.getAPIHistoryLength(), - 25, + 45, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -143,8 +142,8 @@ describe('type: automation', () => { const cached = cache.getCache(); assert.equal( cached.automation ? Object.keys(cached.automation).length : 0, - 5, - 'five cached automation expected' + 20, + '20 cached automation expected' ); assert.equal( deployed['testInstance/testBU'].automation @@ -188,7 +187,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 33, + 53, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -212,8 +211,8 @@ describe('type: automation', () => { const cached = cache.getCache(); assert.equal( cached.automation ? Object.keys(cached.automation).length : 0, - 5, - 'five cached automation expected' + 20, + '20 cached automation expected' ); assert.equal( deployed['testInstance/testBU'].automation @@ -256,7 +255,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 29, + 49, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -292,7 +291,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 18, + 38, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -336,7 +335,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 40, + 80, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -380,7 +379,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 42, + 82, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -424,7 +423,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 43, + 83, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -464,7 +463,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 35, + 75, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -505,7 +504,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 41, + 81, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -546,7 +545,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 43, + 83, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -597,14 +596,18 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 20, + 40, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; }); it('Should create a automation template via buildTemplate and build it', async () => { // download first before we test buildTemplate - await handler.retrieve('testInstance/testBU', ['automation']); + await handler.retrieve( + 'testInstance/testBU', + ['automation'], + ['testExisting_automation'] + ); // GIVEN there is a template const result = await handler.buildTemplate( 'testInstance/testBU', @@ -644,7 +647,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 18, + 38, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -885,4 +888,643 @@ describe('type: automation', () => { return; }); }); + describe('Update notifications ================', () => { + it('Should update ERROR EMAIL address and COMPLETION EMAIL address', async () => { + handler.setOptions({ errorEmail: 'test@test.com', completionEmail: 'test@test.com' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_errorEmailCompletionEmail'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_errorEmailCompletionEmail', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_errorEmailCompletionEmail' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update ERROR NOTE and ERROR EMAIL address', async () => { + handler.setOptions({ errorEmail: 'test@test.com', errorNote: 'test' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_errorEmailErrorNote'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_errorEmailErrorNote', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_errorEmailErrorNote' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update COMPLETION NOTE and COMPLETION EMAIL address', async () => { + handler.setOptions({ completionEmail: 'test@test.com', completionNote: 'test' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_completionEmailCompletionNote'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_completionEmailCompletionNote', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_completionEmailCompletionNote' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update COMPLETION EMAIL and ERROR NOTE', async () => { + handler.setOptions({ completionEmail: 'test@test.com', errorNote: 'test' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_completionEmailErrorNote'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_completionEmailErrorNote', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_completionEmailErrorNote' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update ERROR EMAIL and COMPLETION NOTE', async () => { + handler.setOptions({ errorEmail: 'test@test.com', completionNote: 'test' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_errorEmailCompletionNote'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_errorEmailCompletionNote', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_errorEmailCompletionNote' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update ERROR EMAIL, COMPLETION EMAIL and COMPLETION NOTE', async () => { + handler.setOptions({ + errorEmail: 'test@test.com', + completionEmail: 'test@test.com', + completionNote: 'test', + }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + [ + 'testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail', + ] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_errorEmailCompletionNoteCompletionEmail', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_errorEmailCompletionNoteCompletionEmail' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update ERROR EMAIL, COMPLETION EMAIL and ERROR NOTE', async () => { + handler.setOptions({ + errorEmail: 'test@test.com', + errorNote: 'test', + completionEmail: 'test@test.com', + }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_errorEmailErrorNoteCompletionEmail', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_errorEmailErrorNoteCompletionEmail' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update ERROR EMAIL, COMPLETION NOTE and ERROR NOTE', async () => { + handler.setOptions({ + errorEmail: 'test@test.com', + errorNote: 'test', + completionNote: 'test', + }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_errorEmailCompletionNoteErrorNote', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_errorEmailCompletionNoteErrorNote' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update COMPLETION EMAIL, COMPLETION NOTE and ERROR NOTE', async () => { + handler.setOptions({ + errorEmail: 'test@test.com', + errorNote: 'test', + completionNote: 'test@test.com', + }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + [ + 'testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote', + ] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_completionEmailCompletionNoteErrorNote', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_completionEmailCompletionNoteErrorNote' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update COMPLETION NOTE', async () => { + handler.setOptions({ + completionNote: 'test', + }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_completionNote'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_completionNote', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_completionNote' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update all NOTES and both ERROR EMAIL and COMPLETION EMAIL', async () => { + handler.setOptions({ errorEmail: 'test@test.com', errorNote: 'test' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_updateNotifications_completionEmailNoteErrorEmailNote', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'updateNotifications_completionEmailNoteErrorEmailNote' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should NOT update an already existing error email address', async () => { + handler.setOptions({ errorEmail: 'error@test.accenture.com' }); + const updatedNotificationsError = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation'] + ); + assert.equal( + process.exitCode, + false, + 'update error notifications should not have thrown an error' + ); + assert.equal( + updatedNotificationsError['testInstance/testBU'].length, + 0, + 'zero automation keys expected' + ); + return; + }); + it('Should NOT update an already existing completion email address', async () => { + handler.setOptions({ completionEmail: 'complete@test.accenture.com' }); + const updatedNotificationsComplete = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation'] + ); + assert.equal( + process.exitCode, + false, + 'update completion notifications should not have thrown an error' + ); + assert.equal( + updatedNotificationsComplete['testInstance/testBU'].length, + 0, + 'zero automation keys expected' + ); + return; + }); + it('Should NOT update an already existing error note', async () => { + handler.setOptions({ errorNote: 'test' }); + const updatedNotificationsNote = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation'] + ); + assert.equal( + process.exitCode, + false, + 'update error notifications should not have thrown an error' + ); + assert.equal( + updatedNotificationsNote['testInstance/testBU'].length, + 0, + 'zero automation keys expected' + ); + return; + }); + it('Should clear all notes and all notification email addresses', async () => { + handler.setOptions({ clear: 'all' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_clearNotificationsAll'] + ); + assert.equal( + process.exitCode, + false, + 'updateNotifications --clear should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation key expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_clearNotificationsAll', + 'automation' + ), + await testUtils.getExpectedJson('9999999', 'automation', 'clearNotificationsAll'), + 'returned metadata was not equal expected for update' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should clear all eror email addresses', async () => { + handler.setOptions({ clear: 'errorEmail' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_clearNotificationsErrorEmail'] + ); + assert.equal( + process.exitCode, + false, + 'updateNotifications --clear should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation key expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_clearNotificationsErrorEmail', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'clearNotificationsErrorEmail' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should clear all completion emails', async () => { + handler.setOptions({ clear: 'completionEmail' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_clearNotificationsCompletionEmail'] + ); + assert.equal( + process.exitCode, + false, + 'updateNotifications --clear should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation key expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_clearNotificationsCompletionEmail', + 'automation' + ), + await testUtils.getExpectedJson( + '9999999', + 'automation', + 'clearNotificationsCompletionEmail' + ), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should clear all notes', async () => { + handler.setOptions({ clear: 'notes' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_clearNotificationsNotes'] + ); + assert.equal( + process.exitCode, + false, + 'updateNotifications --clear should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation key expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_automation_clearNotificationsNotes', + 'automation' + ), + await testUtils.getExpectedJson('9999999', 'automation', 'clearNotificationsNotes'), + 'returned metadata was not equal expected for update' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 41, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should NOT update email addresses. Invalid email address', async () => { + handler.setOptions({ errorEmail: 'test', completionEmail: 'test' }); + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'automation', + ['testExisting_automation_NOTupdateNotifications_InvalidEmails'] + ); + assert.equal( + process.exitCode, + false, + 'update notifications should not have thrown an error' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 0, + 'zero automations expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 2, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); }); diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 06ca6c009..e2b66ad9d 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -16,7 +16,11 @@ describe('type: importFile', () => { describe('Retrieve ================', () => { it('Should retrieve a importFile', async () => { // WHEN - await handler.retrieve('testInstance/testBU', ['importFile']); + await handler.retrieve( + 'testInstance/testBU', + ['importFile'], + ['testExisting_importFile'] + ); // THEN assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); // get results from cache @@ -53,8 +57,8 @@ describe('type: importFile', () => { const result = cache.getCache(); assert.equal( result.importFile ? Object.keys(result.importFile).length : 0, - 2, - 'two importFiles expected' + 3, + 'three importFiles expected' ); // confirm created item assert.deepEqual( @@ -71,7 +75,7 @@ describe('type: importFile', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 12, + 13, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -189,4 +193,40 @@ describe('type: importFile', () => { return; }); }); + describe('Update notifications ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + it('Should update email notifications', async () => { + handler.setOptions({ completionEmail: 'test@test.com' }); + // WHEN + await handler.updateNotifications('testInstance/testBU', 'importFile', [ + 'testExisting_importFile_updateNotifications', + ]); + // THEN + assert.equal( + process.exitCode, + false, + 'updateNotifications should not have thrown an error' + ); + assert.deepEqual( + await testUtils.getActualDeployJson( + 'testExisting_importFile_updateNotifications', + 'importFile' + ), + await testUtils.getExpectedJson( + '9999999', + 'importFile', + 'patch_updateNotifications' + ), + 'returned deployment JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 21, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); }); diff --git a/test/type.query.test.js b/test/type.query.test.js index 57c16d8f3..f0cea90ef 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -455,7 +455,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 34, + 69, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -495,7 +495,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 36, + 71, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; diff --git a/test/type.verification.test.js b/test/type.verification.test.js index c93a92f08..6f046768e 100644 --- a/test/type.verification.test.js +++ b/test/type.verification.test.js @@ -23,15 +23,15 @@ describe('type: verification', () => { const result = cache.getCache(); assert.equal( result.verification ? Object.keys(result.verification).length : 0, - 1, - 'only one verification expected' + 6, + 'only 6 verifications expected' ); assert.equal( retrieved['testInstance/testBU']?.verification ? Object.keys(retrieved['testInstance/testBU']?.verification).length : 0, - 1, - 'one verifications to be retrieved' + 6, + '6 verifications to be retrieved' ); assert.deepEqual( @@ -44,7 +44,7 @@ describe('type: verification', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 9, + 29, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -64,15 +64,15 @@ describe('type: verification', () => { const result = cache.getCache(); assert.equal( result.verification ? Object.keys(result.verification).length : 0, - 2, - 'two verifications expected' + 7, + '7 verifications expected' ); assert.equal( deployed['testInstance/testBU']?.verification ? Object.keys(deployed['testInstance/testBU']?.verification).length : 0, 2, - 'two verifications to be deployed' + '2 verifications to be deployed' ); // confirm created item assert.deepEqual( @@ -92,7 +92,7 @@ describe('type: verification', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 11, + 31, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -145,7 +145,7 @@ describe('type: verification', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 9, + 29, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -169,4 +169,195 @@ describe('type: verification', () => { return; }); }); + describe('UpdateNotifications ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + it('Should update notification email', async () => { + handler.setOptions({ completionEmail: 'test@test.com' }); + // WHEN + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'verification', + ['testExisting_verification_updateNotificationsEmail'] + ); + // THEN + assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.verification ? Object.keys(result.verification).length : 0, + 6, + 'only 6 verification expected' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation key expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_verification_updateNotificationsEmail', + 'verification' + ), + await testUtils.getExpectedJson( + '9999999', + 'verification', + 'updateNotificationsEmail' + ), + 'returned metadata was not equal expected for update query' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 34, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should update notification note', async () => { + handler.setOptions({ completionNote: 'test' }); + // WHEN + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'verification', + ['testExisting_verification_updateNotificationsNote'] + ); + // THEN + assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.verification ? Object.keys(result.verification).length : 0, + 6, + 'only 6 verifications expected' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation key expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_verification_updateNotificationsNote', + 'verification' + ), + await testUtils.getExpectedJson( + '9999999', + 'verification', + 'updateNotificationsNote' + ), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 34, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should NOT update notification email', async () => { + handler.setOptions({ completionEmail: 'notAnEmail' }); + // WHEN + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'verification', + ['testExisting_verification_NOTupdateNotificationsEmail'] + ); + // THEN + assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.verification ? Object.keys(result.verification).length : 0, + 6, + 'only 6 verification expected' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + 'one automation key expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_verification_NOTupdateNotificationsEmail', + 'verification' + ), + await testUtils.getExpectedJson( + '9999999', + 'verification', + 'NOTupdateNotificationsEmail' + ), + 'returned metadata was not equal expected for update query' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 34, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should NOT update notification note', async () => { + handler.setOptions({ completionNote: 'test' }); + // WHEN + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'verification', + ['testExisting_verification_NOTupdateNotificationsNote'] + ); + // THEN + assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.verification ? Object.keys(result.verification).length : 0, + 1, + 'only 1 verifications expected' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 0, + '0 automation key expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 4, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should clear notifications', async () => { + handler.setOptions({ clear: 'true' }); + // WHEN + const updatedNotifications = await handler.updateNotifications( + 'testInstance/testBU', + 'verification', + ['testExisting_verification_clear'] + ); + // THEN + assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.verification ? Object.keys(result.verification).length : 0, + 6, + 'only 6 verifications expected' + ); + assert.equal( + updatedNotifications['testInstance/testBU'].length, + 1, + '1 automation key expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_verification_clear', 'verification'), + await testUtils.getExpectedJson('9999999', 'verification', 'clear'), + 'returned metadata was not equal expected for update query' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 34, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); });