Repository: Accenture/sfmc-devtools
Pull request #1209 (2024-02-06 12:29:39)

Feature/745 get mobileCode and mobileKeyword for importActivities with target SMS-list
# PR details

## What changes did you make? (Give an overview)

- improves (but not closes) #745 

## Further details (optional)

- this covers getting additional relevant data for the mobile imports
- there will need to be an additional PR to cover deployments of such mobile imports

## Checklist

- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] test scripts updated
- [ ] Wiki updated (if applicable)



Patch:
diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md
index f871d731..65671247 100644
--- a/docs/dist/documentation.md
+++ b/docs/dist/documentation.md
@@ -242,12 +242,6 @@ helper for <a href="DataExtension.#fixShared_item">DataExtension.#fixShared_item
 <dt><a href="#setupSDK">setupSDK(sessionKey, authObject)</a> ⇒ <code><a href="#SDK">SDK</a></code></dt>
 <dd><p>Returns an SDK instance to be used for API calls</p>
 </dd>
-<dt><a href="#getActualJson">getActualJson(customerKey, type, subtype, [buName])</a> ⇒ <code>Promise.&lt;string&gt;</code></dt>
-<dd><p>gets file from Retrieve folder</p>
-</dd>
-<dt><a href="#getActualFile">getActualFile(customerKey, type, subtype, ext)</a> ⇒ <code>string</code></dt>
-<dd><p>gets file from Retrieve folder</p>
-</dd>
 </dl>
 
 ## Typedefs
@@ -3038,6 +3032,7 @@ ImportFile MetadataType
     * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
     * [.create(importFile)](#ImportFile.create) ⇒ <code>Promise</code>
     * [.update(importFile)](#ImportFile.update) ⇒ <code>Promise</code>
+    * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMap&gt;</code>
     * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ <code>Promise</code>
     * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ <code>TYPE.MetadataTypeItem</code>
     * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ <code>Promise.&lt;boolean&gt;</code>
@@ -3111,6 +3106,20 @@ Updates a single Import File
 | --- | --- | --- |
 | importFile | <code>TYPE.MetadataTypeItem</code> | a single Import File |
 
+<a name="ImportFile.deploy"></a>
+
+### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMap&gt;</code>
+Deploys metadata
+
+**Kind**: static method of [<code>ImportFile</code>](#ImportFile)  
+**Returns**: <code>Promise.&lt;TYPE.MetadataTypeMap&gt;</code> - Promise of keyField => metadata map  
+
+| Param | Type | Description |
+| --- | --- | --- |
+| metadataMap | <code>TYPE.MetadataTypeMap</code> | metadata mapped by their keyField |
+| deployDir | <code>string</code> | directory where deploy metadata are saved |
+| retrieveDir | <code>string</code> | directory where metadata after deploy should be saved |
+
 <a name="ImportFile.preDeployTasks"></a>
 
 ### ImportFile.preDeployTasks(metadata) ⇒ <code>Promise</code>
@@ -8467,36 +8476,6 @@ Returns an SDK instance to be used for API calls
 | sessionKey | <code>string</code> | key for specific BU |
 | authObject | <code>TYPE.AuthObject</code> | credentials for specific BU |
 
-<a name="getActualJson"></a>
-
-## getActualJson(customerKey, type, subtype, [buName]) ⇒ <code>Promise.&lt;string&gt;</code>
-gets file from Retrieve folder
-
-**Kind**: global function  
-**Returns**: <code>Promise.&lt;string&gt;</code> - file in string form  
-
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| customerKey | <code>string</code> |  | of metadata |
-| type | <code>string</code> |  | of metadata |
-| subtype | <code>string</code> |  | of metadata |
-| [buName] | <code>string</code> | <code>&quot;testBU&quot;</code> | used when we need to test on ParentBU |
-
-<a name="getActualFile"></a>
-
-## getActualFile(customerKey, type, subtype, ext) ⇒ <code>string</code>
-gets file from Retrieve folder
-
-**Kind**: global function  
-**Returns**: <code>string</code> - file path  
-
-| Param | Type | Description |
-| --- | --- | --- |
-| customerKey | <code>string</code> | of metadata |
-| type | <code>string</code> | of metadata |
-| subtype | <code>string</code> | of metadata |
-| ext | <code>string</code> | file extension |
-
 <a name="TypeKeyCombo"></a>
 
 ## TypeKeyCombo : <code>Object.&lt;string, string&gt;</code>
diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js
index 447e1c0e..22225a82 100644
--- a/lib/metadataTypes/ImportFile.js
+++ b/lib/metadataTypes/ImportFile.js
@@ -36,6 +36,33 @@ class ImportFile extends MetadataType {
                 return { metadata: {}, type: this.definition.type };
             }
         }
+        Util.logger.debug(' - retrieving extended metadata for SMS imports');
+        const smsImportResults = await this.client.rest.getBulk(
+            '/legacy/v1/beta/mobile/imports/',
+            50
+        );
+        this.smsImports = {};
+        if (smsImportResults.totalResults > 0 && smsImportResults.entry.length > 0) {
+            Util.logger.info(`Caching dependent Metadata: dataExtension (source for SMS imports)`);
+            const sourceObject = {};
+            for (const item of smsImportResults.entry) {
+                // this api does not show the key but the name is assumed to be unique
+                this.smsImports[item.name] = item;
+
+                try {
+                    if (!sourceObject[item.sourceObjectId]) {
+                        sourceObject[item.sourceObjectId] = await this.client.rest.get(
+                            '/legacy/v1/beta/object/' + item.sourceObjectId
+                        );
+                    }
+                    item.sourceObjectKey = sourceObject[item.sourceObjectId].key;
+                } catch {
+                    Util.logger.warn(
+                        `endpoint /legacy/v1/beta/object/${item.sourceObjectId} does not exist`
+                    );
+                }
+            }
+        }
 
         return super.retrieveREST(
             retrieveDir,
@@ -149,6 +176,35 @@ class ImportFile extends MetadataType {
             '/automation/v1/imports/' + importFile.importDefinitionId
         );
     }
+    /**
+     * Deploys metadata
+     *
+     * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField
+     * @param {string} deployDir directory where deploy metadata are saved
+     * @param {string} retrieveDir directory where metadata after deploy should be saved
+     * @returns {Promise.<TYPE.MetadataTypeMap>} Promise of keyField => metadata map
+     */
+    static async deploy(metadataMap, deployDir, retrieveDir) {
+        if (
+            Object.values(metadataMap).filter((item) => item.c__destinationType === 'SMS').length >
+            0
+        ) {
+            Util.logger.info(`Caching dependent Metadata: dataExtension (source for SMS imports)`);
+
+            const dataExtensionLegacyResult = await this.client.rest.getBulk(
+                '/legacy/v1/beta/object/',
+                500
+            );
+            this.dataExtensionsLegacy = {};
+            if (dataExtensionLegacyResult?.entry?.length) {
+                for (const item of dataExtensionLegacyResult.entry) {
+                    this.dataExtensionsLegacy[item.key] = item;
+                }
+            }
+        }
+
+        return super.deploy(metadataMap, deployDir, retrieveDir);
+    }
 
     /**
      * prepares a import definition for deployment
@@ -157,44 +213,96 @@ class ImportFile extends MetadataType {
      * @returns {Promise} Promise
      */
     static async preDeployTasks(metadata) {
-        metadata.fileTransferLocationId = cache.searchForField(
-            'fileLocation',
-            metadata.r__fileLocation_name,
-            'name',
-            'id'
-        );
+        const fileLocation = cache.getByKey('fileLocation', metadata.r__fileLocation_name);
+        if (!fileLocation) {
+            throw new Error(`fileLocation ${metadata.r__fileLocation_name} not found in cache`);
+        }
+
+        metadata.fileTransferLocationId = fileLocation.id;
+        metadata.fileTransferLocationTypeId = fileLocation.locationTypeId;
         delete metadata.r__fileLocation_name;
 
-        if (metadata.c__destinationType === 'DataExtension') {
-            if (metadata.r__dataExtension_CustomerKey) {
-                metadata.destinationObjectId = cache.searchForField(
-                    'dataExtension',
-                    metadata.r__dataExtension_CustomerKey,
-                    'CustomerKey',
-                    'ObjectID'
+        switch (metadata.c__destinationType) {
+            case 'DataExtension': {
+                if (metadata.r__dataExtension_CustomerKey) {
+                    metadata.destinationObjectId = cache.searchForField(
+                        'dataExtension',
+                        metadata.r__dataExtension_CustomerKey,
+                        'CustomerKey',
+                        'ObjectID'
+                    );
+                    delete metadata.r__dataExtension_CustomerKey;
+                } else {
+                    throw new Error('Import Destination DataExtension not defined');
+                }
+                break;
+            }
+            case 'List': {
+                if (metadata.r__list_PathName) {
+                    metadata.destinationObjectId = cache.getListObjectId(
+                        metadata.r__list_PathName,
+                        'ObjectID'
+                    );
+                    // destinationId is also needed for List types
+                    metadata.destinationId = cache.getListObjectId(metadata.r__list_PathName, 'ID');
+                    delete metadata.r__list_PathName;
+                } else {
+                    throw new Error('Import Destination List not defined');
+                }
+                break;
+            }
+            case 'SMS': {
+                if (metadata.c__codeKeyword) {
+                    // code
+                    const codeObj = cache.getByKey(
+                        'mobileCode',
+                        metadata.c__codeKeyword.split('.')[0]
+                    );
+                    if (!codeObj) {
+                        throw new Error(`mobileCode ${metadata.c__codeKeyword} not found in cache`);
+                    }
+                    metadata.code = codeObj;
+
+                    // keyword
+                    const keywordObj = cache.getByKey('mobileKeyword', metadata.c__codeKeyword);
+                    if (!keywordObj) {
+                        throw new Error(
+                            `mobileKeyword ${metadata.c__codeKeyword} not found in cache`
+                        );
+                    }
+                    metadata.keyword = keywordObj;
+                } else {
+                    Util.logger.error(
+                        ` - importFile ${metadata[this.definition.keyField]}: No code or keyword info found. Please re-download this from the source.`
+                    );
+                }
+
+                // destination
+                metadata.destinationObjectId = '00000000-0000-0000-0000-000000000000';
+                metadata.destinationObjectType = 'MobileSubscription';
+                // source
+                if (this.dataExtensionsLegacy[metadata.c__sourceObjectKey]) {
+                    metadata.sourceObjectId =
+                        this.dataExtensionsLegacy[metadata.c__sourceObjectKey].id;
+                    metadata.sourceObjectName =
+                        this.dataExtensionsLegacy[metadata.c__sourceObjectKey].dataExtensionName;
+                    delete metadata.c__sourceObjectKey;
+                }
+
+                Util.logger.debug(
+                    ` - importFile ${metadata[this.definition.keyField]}: Import Destination Type ${
+                        metadata.c__destinationType
+                    } not fully supported. Deploy might fail.`
                 );
-                delete metadata.r__dataExtension_CustomerKey;
-            } else {
-                throw new Error('Import Destination DataExtension not defined');
+                break;
             }
-        } else if (metadata.c__destinationType === 'List') {
-            if (metadata.r__list_PathName) {
-                metadata.destinationObjectId = cache.getListObjectId(
-                    metadata.r__list_PathName,
-                    'ObjectID'
+            default: {
+                Util.logger.debug(
+                    ` - importFile ${metadata[this.definition.keyField]}: Import Destination Type ${
+                        metadata.c__destinationType
+                    } not fully supported. Deploy might fail.`
                 );
-                // destinationId is also needed for List types
-                metadata.destinationId = cache.getListObjectId(metadata.r__list_PathName, 'ID');
-                delete metadata.r__list_PathName;
-            } else {
-                throw new Error('Import Destination List not defined');
             }
-        } else {
-            Util.logger.debug(
-                ` - importFile ${metadata[this.definition.keyField]}: Import Destination Type ${
-                    metadata.c__destinationType
-                } not fully supported. Deploy might fail.`
-            );
         }
         if (metadata.c__blankFileProcessing) {
             // omit this if not set
@@ -230,30 +338,63 @@ class ImportFile extends MetadataType {
             this.definition.destinationObjectTypeMapping,
             metadata.destinationObjectTypeId
         );
-        delete metadata.destinationObjectTypeId;
-        if (metadata.c__destinationType === 'DataExtension') {
-            try {
-                metadata.r__dataExtension_CustomerKey = cache.searchForField(
-                    'dataExtension',
-                    metadata.destinationObjectId,
-                    'ObjectID',
-                    'CustomerKey'
-                );
+        switch (metadata.c__destinationType) {
+            case 'DataExtension': {
+                try {
+                    metadata.r__dataExtension_CustomerKey = cache.searchForField(
+                        'dataExtension',
+                        metadata.destinationObjectId,
+                        'ObjectID',
+                        'CustomerKey'
+                    );
+                    delete metadata.destinationObjectId;
+                } catch (ex) {
+                    Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`);
+                }
+
+                break;
+            }
+            case 'List': {
+                try {
+                    metadata.r__list_PathName = cache.getListPathName(
+                        metadata.destinationObjectId,
+                        'ObjectID'
+                    );
+                    delete metadata.destinationObjectId;
+                } catch (ex) {
+                    Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`);
+                }
+
+                break;
+            }
+            case 'SMS': {
+                if (this.smsImports[metadata.name]) {
+                    const smsImport = this.smsImports[metadata.name];
+                    // code + keyword
+                    metadata.c__codeKeyword =
+                        smsImport.code?.code + '.' + smsImport.keyword?.keyword;
+                    // source dataExtension
+                    if (smsImport.sourceObjectKey) {
+                        metadata.c__sourceObjectKey = smsImport.sourceObjectKey;
+                    }
+                } else {
+                    Util.logger.debug(
+                        ` - ImportFile ${metadata.customerKey}: Could not find mobile code and keyword nor source for this SMS import activity.`
+                    );
+                }
+                // remove empty desitination
                 delete metadata.destinationObjectId;
-            } catch (ex) {
-                Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`);
+
+                break;
             }
-        } else if (metadata.c__destinationType === 'List') {
-            try {
-                metadata.r__list_PathName = cache.getListPathName(
-                    metadata.destinationObjectId,
-                    'ObjectID'
+            default: {
+                Util.logger.debug(
+                    ` - ImportFile ${metadata.customerKey}: Destination Type ${metadata.destinationObjectTypeId} not fully supported. Deploy might fail.`
                 );
-                delete metadata.destinationObjectId;
-            } catch (ex) {
-                Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`);
             }
         }
+        delete metadata.destinationObjectTypeId;
+
         if (metadata.blankFileProcessingType) {
             // omit this if not set
             metadata.c__blankFileProcessing = Util.inverseGet(
diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js
index 0b3aa28a..cbefdc7b 100644
--- a/lib/metadataTypes/definitions/ImportFile.definition.js
+++ b/lib/metadataTypes/definitions/ImportFile.definition.js
@@ -145,8 +145,8 @@ export default {
         fileTransferLocationTypeId: {
             isCreateable: true,
             isUpdateable: true,
-            retrieving: true,
-            template: true,
+            retrieving: false,
+            template: false,
         },
         fileType: {
             isCreateable: true,


Test patch:
diff --git a/test/resources/9999999/automation/v1/imports/1ebf557b-372e-eb11-b81b-48df37d1dbd7/get-response.json b/test/resources/9999999/automation/v1/imports/1ebf557b-372e-eb11-b81b-48df37d1dbd7/get-response.json
new file mode 100644
index 00000000..87a475ff
--- /dev/null
+++ b/test/resources/9999999/automation/v1/imports/1ebf557b-372e-eb11-b81b-48df37d1dbd7/get-response.json
@@ -0,0 +1,78 @@
+{
+    "allowErrors": true,
+    "customerKey": "testExisting_importFileSMS",
+    "createdDate": "2022-11-24T03:29:01.05",
+    "modifiedDate": "2023-07-19T23:06:33.577",
+    "dateFormatLocale": "en-US",
+    "deleteFile": false,
+    "description": "Unsub for Keyword",
+    "destinationObjectId": "00000000-0000-0000-0000-000000000000",
+    "destinationId": 0,
+    "destinationObjectTypeId": 584,
+    "fieldMappings": [
+        {
+            "sourceFieldName": "Locale",
+            "destinationFieldName": "_CountryCode"
+        },
+        {
+            "sourceFieldName": "FirstName",
+            "destinationFieldName": "_FirstName"
+        },
+        {
+            "sourceFieldName": "IsHonorDST",
+            "destinationFieldName": "_IsHonorDST"
+        },
+        {
+            "sourceFieldName": "LastName",
+            "destinationFieldName": "_LastName"
+        },
+        {
+            "sourceFieldName": "MobileNumber",
+            "destinationFieldName": "_MobileNumber"
+        },
+        {
+            "sourceFieldName": "Status",
+            "destinationFieldName": "_Status"
+        },
+        {
+            "sourceFieldName": "ContactKey",
+            "destinationFieldName": "_SubscriberKey"
+        },
+        {
+            "sourceFieldName": "UTCoffset",
+            "destinationFieldName": "_UTCOffset"
+        },
+        {
+            "sourceFieldName": "Action",
+            "destinationFieldName": "Action"
+        },
+        {
+            "sourceFieldName": "ModifiedDate",
+            "destinationFieldName": "SalesforceModified"
+        },
+        {
+            "sourceFieldName": "SFContactID",
+            "destinationFieldName": "SFContactID"
+        }
+    ],
+    "fieldMappingType": "ManualMap",
+    "fileNamingPattern": "_CustomObject",
+    "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
+    "fileTransferLocationName": "ExactTarget Enhanced FTP",
+    "fileType": "CSV",
+    "filter": "",
+    "hasColumnHeader": true,
+    "importDefinitionId": "1ebf557b-372e-eb11-b81b-48df37d1dbd7",
+    "isOrderedImport": false,
+    "isSequential": true,
+    "maxFileAgeHours": 0,
+    "maxImportFrequencyHours": 0,
+    "maxFileAgeScheduleOffsetHours": 0,
+    "name": "testExisting_importFileSMS",
+    "notificationEmailAddress": "joern.berkefeld@accenture.com",
+    "sendEmailNotification": true,
+    "standardQuotedStrings": false,
+    "subscriberImportTypeId": 255,
+    "updateTypeId": 0,
+    "fileTransferLocationTypeId": 0
+}
diff --git a/test/resources/9999999/automation/v1/imports/get-response.json b/test/resources/9999999/automation/v1/imports/get-response.json
index 000537e3..6b60cf36 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,83 @@
             "subscriberImportTypeId": 255,
             "updateTypeId": 0,
             "fileTransferLocationTypeId": 0
+        },
+        {
+            "allowErrors": true,
+            "customerKey": "testExisting_importFileSMS",
+            "createdDate": "2022-11-24T03:29:01.05",
+            "modifiedDate": "2023-07-19T23:06:33.577",
+            "dateFormatLocale": "en-US",
+            "deleteFile": false,
+            "description": "Unsub for Keyword",
+            "destinationObjectId": "00000000-0000-0000-0000-000000000000",
+            "destinationId": 0,
+            "destinationObjectTypeId": 584,
+            "fieldMappings": [
+                {
+                    "sourceFieldName": "Locale",
+                    "destinationFieldName": "_CountryCode"
+                },
+                {
+                    "sourceFieldName": "FirstName",
+                    "destinationFieldName": "_FirstName"
+                },
+                {
+                    "sourceFieldName": "IsHonorDST",
+                    "destinationFieldName": "_IsHonorDST"
+                },
+                {
+                    "sourceFieldName": "LastName",
+                    "destinationFieldName": "_LastName"
+                },
+                {
+                    "sourceFieldName": "MobileNumber",
+                    "destinationFieldName": "_MobileNumber"
+                },
+                {
+                    "sourceFieldName": "Status",
+                    "destinationFieldName": "_Status"
+                },
+                {
+                    "sourceFieldName": "ContactKey",
+                    "destinationFieldName": "_SubscriberKey"
+                },
+                {
+                    "sourceFieldName": "UTCoffset",
+                    "destinationFieldName": "_UTCOffset"
+                },
+                {
+                    "sourceFieldName": "Action",
+                    "destinationFieldName": "Action"
+                },
+                {
+                    "sourceFieldName": "ModifiedDate",
+                    "destinationFieldName": "SalesforceModified"
+                },
+                {
+                    "sourceFieldName": "SFContactID",
+                    "destinationFieldName": "SFContactID"
+                }
+            ],
+            "fieldMappingType": "ManualMap",
+            "fileNamingPattern": "_CustomObject",
+            "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24",
+            "fileType": "CSV",
+            "filter": "",
+            "hasColumnHeader": true,
+            "importDefinitionId": "1ebf557b-372e-eb11-b81b-48df37d1dbd7",
+            "isOrderedImport": false,
+            "isSequential": true,
+            "maxFileAgeHours": 0,
+            "maxImportFrequencyHours": 0,
+            "maxFileAgeScheduleOffsetHours": 0,
+            "name": "testExisting_importFileSMS",
+            "notificationEmailAddress": "joern.berkefeld@accenture.com",
+            "sendEmailNotification": true,
+            "standardQuotedStrings": false,
+            "subscriberImportTypeId": 255,
+            "updateTypeId": 0,
+            "fileTransferLocationTypeId": 0
         }
     ]
 }
diff --git a/test/resources/9999999/importFile/build-expected.json b/test/resources/9999999/importFile/build-expected.json
index 11e81a29..33e915ff 100644
--- a/test/resources/9999999/importFile/build-expected.json
+++ b/test/resources/9999999/importFile/build-expected.json
@@ -12,7 +12,6 @@
     "fieldMappings": [],
     "fieldMappingType": "InferFromColumnHeadings",
     "fileNamingPattern": "blabla",
-    "fileTransferLocationTypeId": 0,
     "fileType": "CSV",
     "filter": "",
     "hasColumnHeader": true,
diff --git a/test/resources/9999999/importFile/get-expected.json b/test/resources/9999999/importFile/get-expected.json
index a704e228..c60924af 100644
--- a/test/resources/9999999/importFile/get-expected.json
+++ b/test/resources/9999999/importFile/get-expected.json
@@ -13,7 +13,6 @@
     "fieldMappings": [],
     "fieldMappingType": "InferFromColumnHeadings",
     "fileNamingPattern": "blabla",
-    "fileTransferLocationTypeId": 0,
     "fileType": "CSV",
     "filter": "",
     "hasColumnHeader": true,
diff --git a/test/resources/9999999/importFile/get-sms-expected.json b/test/resources/9999999/importFile/get-sms-expected.json
new file mode 100644
index 00000000..230885a1
--- /dev/null
+++ b/test/resources/9999999/importFile/get-sms-expected.json
@@ -0,0 +1,73 @@
+{
+    "allowErrors": true,
+    "c__dataAction": "AddUpdate",
+    "c__destinationType": "SMS",
+    "c__subscriberImportType": "DataExtension",
+    "createdDate": "2022-11-24T03:29:01.05",
+    "customerKey": "testExisting_importFileSMS",
+    "dateFormatLocale": "en-US",
+    "deleteFile": false,
+    "description": "Unsub for Keyword",
+    "fieldMappingType": "ManualMap",
+    "fieldMappings": [
+        {
+            "destinationFieldName": "_CountryCode",
+            "sourceFieldName": "Locale"
+        },
+        {
+            "destinationFieldName": "_FirstName",
+            "sourceFieldName": "FirstName"
+        },
+        {
+            "destinationFieldName": "_IsHonorDST",
+            "sourceFieldName": "IsHonorDST"
+        },
+        {
+            "destinationFieldName": "_LastName",
+            "sourceFieldName": "LastName"
+        },
+        {
+            "destinationFieldName": "_MobileNumber",
+            "sourceFieldName": "MobileNumber"
+        },
+        {
+            "destinationFieldName": "_Status",
+            "sourceFieldName": "Status"
+        },
+        {
+            "destinationFieldName": "_SubscriberKey",
+            "sourceFieldName": "ContactKey"
+        },
+        {
+            "destinationFieldName": "_UTCOffset",
+            "sourceFieldName": "UTCoffset"
+        },
+        {
+            "destinationFieldName": "Action",
+            "sourceFieldName": "Action"
+        },
+        {
+            "destinationFieldName": "SalesforceModified",
+            "sourceFieldName": "ModifiedDate"
+        },
+        {
+            "destinationFieldName": "SFContactID",
+            "sourceFieldName": "SFContactID"
+        }
+    ],
+    "fileNamingPattern": "_CustomObject",
+    "fileType": "CSV",
+    "filter": "",
+    "hasColumnHeader": true,
+    "isOrderedImport": false,
+    "isSequential": true,
+    "maxFileAgeHours": 0,
+    "maxFileAgeScheduleOffsetHours": 0,
+    "maxImportFrequencyHours": 0,
+    "modifiedDate": "2023-07-19T23:06:33.577",
+    "name": "testExisting_importFileSMS",
+    "notificationEmailAddress": "joern.berkefeld@accenture.com",
+    "r__fileLocation_name": "ExactTarget Enhanced FTP",
+    "sendEmailNotification": true,
+    "standardQuotedStrings": false
+}
diff --git a/test/resources/9999999/importFile/patch-expected.json b/test/resources/9999999/importFile/patch-expected.json
index 0d761839..c0c07862 100644
--- a/test/resources/9999999/importFile/patch-expected.json
+++ b/test/resources/9999999/importFile/patch-expected.json
@@ -13,7 +13,6 @@
     "fieldMappings": [],
     "fieldMappingType": "InferFromColumnHeadings",
     "fileNamingPattern": "blabla",
-    "fileTransferLocationTypeId": 0,
     "fileType": "CSV",
     "filter": "",
     "hasColumnHeader": true,
diff --git a/test/resources/9999999/importFile/post-expected.json b/test/resources/9999999/importFile/post-expected.json
index 0a9440db..4fb99f81 100644
--- a/test/resources/9999999/importFile/post-expected.json
+++ b/test/resources/9999999/importFile/post-expected.json
@@ -11,7 +11,6 @@
     "fieldMappingType": "InferFromColumnHeadings",
     "fieldMappings": [],
     "fileNamingPattern": "blabla",
-    "fileTransferLocationTypeId": 0,
     "fileType": "CSV",
     "filter": "",
     "hasColumnHeader": true,
diff --git a/test/resources/9999999/importFile/template-expected.json b/test/resources/9999999/importFile/template-expected.json
index ff26a685..52508601 100644
--- a/test/resources/9999999/importFile/template-expected.json
+++ b/test/resources/9999999/importFile/template-expected.json
@@ -12,7 +12,6 @@
     "fieldMappingType": "InferFromColumnHeadings",
     "fieldMappings": [],
     "fileNamingPattern": "blabla",
-    "fileTransferLocationTypeId": 0,
     "fileType": "CSV",
     "filter": "",
     "hasColumnHeader": true,
diff --git a/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json b/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json
new file mode 100644
index 00000000..2a4ea6fc
--- /dev/null
+++ b/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json
@@ -0,0 +1,112 @@
+{
+    "startIndex": 0,
+    "itemsPerPage": 50,
+    "totalResults": 3,
+    "entry": [
+        {
+            "id": "ZTFXX0hpNDNFZXU0RzBqZk45SGIxdzo0MTow",
+            "name": "Contact_SMS_DEV_2",
+            "sourceFile": "_CustomObject",
+            "audience": {
+                "id": "QUFBQUFBQUFBQUFBQUFBQUFBQUFBQTo2Mzow",
+                "name": "Contact_SMS_DEV_2",
+                "description": ""
+            },
+            "code": {
+                "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow",
+                "code": "491771783703",
+                "codeType": "PRIVATE",
+                "isShortCode": false,
+                "isGsmCharacterSetOnly": false,
+                "isMms": false,
+                "isStackIndependant": false,
+                "dipSwitches": 0,
+                "moEngineVersion": 0,
+                "supportsConcatenation": false,
+                "isClientOwned": false,
+                "isOwner": false
+            },
+            "keyword": {
+                "id": "Y0ZDXzVjVHdYVUNlQVJlT2U2dzVKZzo4Njow",
+                "keyword": "ONEDEVICE_DEV",
+                "restriction": "NONE",
+                "isInherited": false,
+                "isLinkShorteningEnabled": false,
+                "isSubscriberTrackingEnabled": false,
+                "shortenerType": "BitLy"
+            },
+            "sourceObjectId": "NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow",
+            "sourceObjectName": "testExisting_dataExtension"
+        },
+        {
+            "id": "MVZtWUtidEVFZWlpdnhRQzdKVHM4UTo0MTow",
+            "name": "ContactSMS_DEV",
+            "sourceFile": "_CustomObject",
+            "audience": {
+                "id": "QUFBQUFBQUFBQUFBQUFBQUFBQUFBQTo2Mzow",
+                "name": "ContactSMS_DEV",
+                "description": ""
+            },
+            "code": {
+                "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow",
+                "code": "491771783703",
+                "codeType": "PRIVATE",
+                "isShortCode": false,
+                "isGsmCharacterSetOnly": false,
+                "isMms": false,
+                "isStackIndependant": false,
+                "dipSwitches": 0,
+                "moEngineVersion": 0,
+                "supportsConcatenation": false,
+                "isClientOwned": false,
+                "isOwner": false
+            },
+            "keyword": {
+                "id": "X2RqemdvVHFja1dpTzlKcERRQ25MZzo4Njow",
+                "keyword": "COMMUNITYCLOUD_DEV",
+                "restriction": "NONE",
+                "isInherited": false,
+                "isLinkShorteningEnabled": false,
+                "isSubscriberTrackingEnabled": false,
+                "shortenerType": "BitLy"
+            },
+            "sourceObjectId": "NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow",
+            "sourceObjectName": "testExisting_dataExtension"
+        },
+        {
+            "id": "NHNwUFR5YTdFZTY0WVVqZk45SGNlUTo0MTow",
+            "name": "ContactSMS_DEV3",
+            "sourceFile": "_CustomObject",
+            "audience": {
+                "id": "QUFBQUFBQUFBQUFBQUFBQUFBQUFBQTo2Mzow",
+                "name": "ContactSMS_DEV3",
+                "description": ""
+            },
+            "code": {
+                "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow",
+                "code": "491771783703",
+                "codeType": "PRIVATE",
+                "isShortCode": false,
+                "isGsmCharacterSetOnly": false,
+                "isMms": false,
+                "isStackIndependant": false,
+                "dipSwitches": 0,
+                "moEngineVersion": 0,
+                "supportsConcatenation": false,
+                "isClientOwned": false,
+                "isOwner": false
+            },
+            "keyword": {
+                "id": "X2RqemdvVHFja1dpTzlKcERRQ25MZzo4Njow",
+                "keyword": "COMMUNITYCLOUD_DEV",
+                "restriction": "NONE",
+                "isInherited": false,
+                "isLinkShorteningEnabled": false,
+                "isSubscriberTrackingEnabled": false,
+                "shortenerType": "BitLy"
+            },
+            "sourceObjectId": "NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow",
+            "sourceObjectName": "testExisting_dataExtension"
+        }
+    ]
+}
diff --git a/test/resources/9999999/legacy/v1/beta/object/NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow/get-response.json b/test/resources/9999999/legacy/v1/beta/object/NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow/get-response.json
new file mode 100644
index 00000000..2af253c3
--- /dev/null
+++ b/test/resources/9999999/legacy/v1/beta/object/NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow/get-response.json
@@ -0,0 +1,12 @@
+{
+    "id": "NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow",
+    "key": "testExisting_dataExtension",
+    "dataExtensionName": "testExisting_dataExtension",
+    "description": "",
+    "isSendable": true,
+    "sendableDataExtensionField": "ContactKey",
+    "sendableSubscriberField": "_SubscriberKey",
+    "isTestable": false,
+    "isPublic": false,
+    "isPlatformObject": false
+}
diff --git a/test/type.automation.test.js b/test/type.automation.test.js
index 3703d251..a2a7c64d 100644
--- a/test/type.automation.test.js
+++ b/test/type.automation.test.js
@@ -50,7 +50,7 @@ describe('type: automation', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                19,
+                22,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -126,7 +126,7 @@ describe('type: automation', () => {
 
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                26,
+                29,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -196,7 +196,7 @@ describe('type: automation', () => {
 
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                34,
+                37,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -265,7 +265,7 @@ describe('type: automation', () => {
 
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                30,
+                33,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -302,7 +302,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                19,
+                22,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -347,7 +347,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                42,
+                48,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -392,7 +392,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                44,
+                50,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -437,7 +437,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                45,
+                51,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -478,7 +478,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                37,
+                43,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -520,7 +520,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                43,
+                49,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -562,7 +562,7 @@ describe('type: automation', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                45,
+                51,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -614,7 +614,7 @@ describe('type: automation', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                21,
+                24,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -662,7 +662,7 @@ describe('type: automation', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                19,
+                22,
                 '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 8e2ce81c..7471426d 100644
--- a/test/type.importFile.test.js
+++ b/test/type.importFile.test.js
@@ -26,17 +26,22 @@ describe('type: importFile', () => {
             const result = cache.getCache();
             assert.equal(
                 result.importFile ? Object.keys(result.importFile).length : 0,
-                1,
-                'only one importFile expected'
+                2,
+                'only 2 importFile expected'
             );
             assert.deepEqual(
                 await testUtils.getActualJson('testExisting_importFile', 'importFile'),
                 await testUtils.getExpectedJson('9999999', 'importFile', 'get'),
                 'returned JSON was not equal expected'
             );
+            assert.deepEqual(
+                await testUtils.getActualJson('testExisting_importFileSMS', 'importFile'),
+                await testUtils.getExpectedJson('9999999', 'importFile', 'get-sms'),
+                'returned JSON was not equal expected'
+            );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                11,
+                14,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -65,7 +70,7 @@ describe('type: importFile', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                11,
+                13,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -87,8 +92,8 @@ describe('type: importFile', () => {
             const result = cache.getCache();
             assert.equal(
                 result.importFile ? Object.keys(result.importFile).length : 0,
-                2,
-                'two importFiles expected'
+                3,
+                '3 importFiles expected'
             );
             // confirm created item
             assert.deepEqual(
@@ -105,7 +110,7 @@ describe('type: importFile', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                13,
+                16,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -151,7 +156,7 @@ describe('type: importFile', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                11,
+                13,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -197,7 +202,7 @@ describe('type: importFile', () => {
             );
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                11,
+                14,
                 '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 4b3f2114..0734274b 100644
--- a/test/type.query.test.js
+++ b/test/type.query.test.js
@@ -472,7 +472,7 @@ describe('type: query', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                35,
+                38,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;
@@ -513,7 +513,7 @@ describe('type: query', () => {
             // check number of API calls
             assert.equal(
                 testUtils.getAPIHistoryLength(),
-                37,
+                40,
                 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests'
             );
             return;