-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#61: add retrieve/cache support for SendClassification
- Loading branch information
1 parent
4a5dbc9
commit 3d4be2c
Showing
5 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
|
||
const TYPE = require('../../types/mcdev.d'); | ||
const MetadataType = require('./MetadataType'); | ||
|
||
/** | ||
* SendClassification MetadataType | ||
* | ||
* @augments MetadataType | ||
*/ | ||
class SendClassification extends MetadataType { | ||
/** | ||
* Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata | ||
* | ||
* @param {string} retrieveDir Directory where retrieved metadata directory will be saved | ||
* @param {void} [_] unused parameter | ||
* @param {void} [__] unused parameter | ||
* @param {string} [key] customer key of single item to retrieve | ||
* @returns {Promise.<TYPE.MetadataTypeMapObj>} Promise of metadata | ||
*/ | ||
static retrieve(retrieveDir, _, __, key) { | ||
/** @type {TYPE.SoapRequestParams} */ | ||
let requestParams = null; | ||
if (key) { | ||
requestParams = { | ||
filter: { | ||
leftOperand: 'CustomerKey', | ||
operator: 'equals', | ||
rightOperand: key, | ||
}, | ||
}; | ||
} | ||
return super.retrieveSOAP(retrieveDir, requestParams); | ||
} | ||
} | ||
|
||
// Assign definition to static attributes | ||
SendClassification.definition = require('../MetadataTypeDefinitions').sendClassification; | ||
|
||
module.exports = SendClassification; |
113 changes: 113 additions & 0 deletions
113
lib/metadataTypes/definitions/SendClassification.definition.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
// https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/sendclassification.html | ||
module.exports = { | ||
bodyIteratorField: 'Results', | ||
dependencies: [], | ||
filter: {}, | ||
hasExtended: false, | ||
idField: 'ObjectID', | ||
keyField: 'CustomerKey', | ||
nameField: 'Name', | ||
createdDateField: 'CreatedDate', | ||
createdNameField: null, | ||
lastmodDateField: 'ModifiedDate', | ||
lastmodNameField: null, | ||
restPagination: false, | ||
type: 'sendClassification', | ||
typeDescription: | ||
'Lets admins define Delivery Profile, Sender Profile and CAN-SPAM for an email job in a central location.', | ||
typeRetrieveByDefault: false, | ||
typeName: 'SendClassification', | ||
fields: { | ||
'Client.ID': { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
CreatedDate: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
ModifiedDate: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
CustomerKey: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: true, | ||
template: false, | ||
}, | ||
ObjectID: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: true, | ||
template: false, | ||
}, | ||
Name: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: true, | ||
template: false, | ||
}, | ||
Description: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: true, | ||
template: false, | ||
}, | ||
PartnerKey: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
PartnerProperties: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
|
||
ArchiveEmail: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: true, | ||
template: true, | ||
}, | ||
DeliveryProfile: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
HonorPublicationListOptOutsForTransactionalSends: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
SendClassificationType: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: true, | ||
template: true, | ||
}, | ||
SenderProfile: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
SendPriority: { | ||
isCreateable: false, | ||
isUpdateable: false, | ||
retrieving: false, | ||
template: false, | ||
}, | ||
}, | ||
}; |