Skip to content

Commit

Permalink
Merge pull request #194 from DougMidgley/develop
Browse files Browse the repository at this point in the history
February 28 2023 release of SFMC-SDK
  • Loading branch information
DougMidgley authored Feb 28, 2023
2 parents 7af5556 + 957c151 commit fe9644e
Show file tree
Hide file tree
Showing 5 changed files with 8,051 additions and 7,938 deletions.
36 changes: 36 additions & 0 deletions lib/soap.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,42 @@ module.exports = class Soap {
this.options.requestAttempts
);
}
/**
* Method used to configure data via SOAP API
*
* @private
* @param {string} type -SOAP Object type
* @param {object[]} configArr - Properties which should be updated
* @returns {Promise.<object>} SOAP object converted from XML
*/
configure(type, configArr) {
if (!type) {
throw new Error('Configure requires a type');
}
if (!Array.isArray(configArr) || configArr?.length == 0) {
throw new Error('Configure request requires one or more entries');
}
const body = {
ConfigureRequestMsg: {
'@_xmlns': 'http://exacttarget.com/wsdl/partnerAPI',
Action: 'assign',
Configurations: { Configuration: configArr },
},
};
for (const configuration of configArr) {
configuration['@_xsi:type'] = type;
}

return this._apiRequest(
{
action: 'Configure',
req: body,
key: 'ConfigureResponseMsg',
},
this.options.requestAttempts
);
}

/**
* Method that makes the api request
*
Expand Down
Loading

0 comments on commit fe9644e

Please sign in to comment.