Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace string templating with interpolation #449

Merged
merged 3 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test:
docs:
npm run jsdoc

clean: node_modules
clean:
rm -rf node_modules

API_DEFINITIONS_SHA=$(shell git log --oneline | grep Regenerated | head -n1 | cut -d ' ' -f 5)
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/accounts/v1/credential/aws.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ AwsList = function AwsList(version) {
AwsListInstance._version = version;
// Path Solution
AwsListInstance._solution = {};
AwsListInstance._uri = _.template(
'/Credentials/AWS' // jshint ignore:line
)(AwsListInstance._solution);
AwsListInstance._uri = `/Credentials/AWS`;
/* jshint ignore:start */
/**
* Streams AwsInstance records from the API.
Expand Down Expand Up @@ -587,9 +585,7 @@ AwsContext = function AwsContext(version, sid) {

// Path Solution
this._solution = {sid: sid, };
this._uri = _.template(
'/Credentials/AWS/<%= sid %>' // jshint ignore:line
)(this._solution);
this._uri = `/Credentials/AWS/${sid}`;
};

/* jshint ignore:start */
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/accounts/v1/credential/publicKey.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ PublicKeyList = function PublicKeyList(version) {
PublicKeyListInstance._version = version;
// Path Solution
PublicKeyListInstance._solution = {};
PublicKeyListInstance._uri = _.template(
'/Credentials/PublicKeys' // jshint ignore:line
)(PublicKeyListInstance._solution);
PublicKeyListInstance._uri = `/Credentials/PublicKeys`;
/* jshint ignore:start */
/**
* Streams PublicKeyInstance records from the API.
Expand Down Expand Up @@ -589,9 +587,7 @@ PublicKeyContext = function PublicKeyContext(version, sid) {

// Path Solution
this._solution = {sid: sid, };
this._uri = _.template(
'/Credentials/PublicKeys/<%= sid %>' // jshint ignore:line
)(this._solution);
this._uri = `/Credentials/PublicKeys/${sid}`;
};

/* jshint ignore:start */
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ AccountList = function AccountList(version) {
AccountListInstance._version = version;
// Path Solution
AccountListInstance._solution = {};
AccountListInstance._uri = _.template(
'/Accounts.json' // jshint ignore:line
)(AccountListInstance._solution);
AccountListInstance._uri = `/Accounts.json`;
/* jshint ignore:start */
/**
* create a AccountInstance
Expand Down Expand Up @@ -991,9 +989,7 @@ AccountContext = function AccountContext(version, sid) {

// Path Solution
this._solution = {sid: sid, };
this._uri = _.template(
'/Accounts/<%= sid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${sid}.json`;

// Dependents
this._addresses = undefined;
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/address.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ AddressList = function AddressList(version, accountSid) {
AddressListInstance._version = version;
// Path Solution
AddressListInstance._solution = {accountSid: accountSid};
AddressListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Addresses.json' // jshint ignore:line
)(AddressListInstance._solution);
AddressListInstance._uri = `/Accounts/${accountSid}/Addresses.json`;
/* jshint ignore:start */
/**
* create a AddressInstance
Expand Down Expand Up @@ -699,9 +697,7 @@ AddressContext = function AddressContext(version, accountSid, sid) {

// Path Solution
this._solution = {accountSid: accountSid, sid: sid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/Addresses/<%= sid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/Addresses/${sid}.json`;

// Dependents
this._dependentPhoneNumbers = undefined;
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/api/v2010/account/address/dependentPhoneNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ DependentPhoneNumberList = function DependentPhoneNumberList(version,
DependentPhoneNumberListInstance._version = version;
// Path Solution
DependentPhoneNumberListInstance._solution = {accountSid: accountSid, addressSid: addressSid};
DependentPhoneNumberListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Addresses/<%= addressSid %>/DependentPhoneNumbers.json' // jshint ignore:line
)(DependentPhoneNumberListInstance._solution);
DependentPhoneNumberListInstance._uri = `/Accounts/${accountSid}/Addresses/${addressSid}/DependentPhoneNumbers.json`;
/* jshint ignore:start */
/**
* Streams DependentPhoneNumberInstance records from the API.
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ ApplicationList = function ApplicationList(version, accountSid) {
ApplicationListInstance._version = version;
// Path Solution
ApplicationListInstance._solution = {accountSid: accountSid};
ApplicationListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Applications.json' // jshint ignore:line
)(ApplicationListInstance._solution);
ApplicationListInstance._uri = `/Accounts/${accountSid}/Applications.json`;
/* jshint ignore:start */
/**
* create a ApplicationInstance
Expand Down Expand Up @@ -710,9 +708,7 @@ ApplicationContext = function ApplicationContext(version, accountSid, sid) {

// Path Solution
this._solution = {accountSid: accountSid, sid: sid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/Applications/<%= sid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/Applications/${sid}.json`;
};

/* jshint ignore:start */
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/authorizedConnectApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ AuthorizedConnectAppList = function AuthorizedConnectAppList(version,
AuthorizedConnectAppListInstance._version = version;
// Path Solution
AuthorizedConnectAppListInstance._solution = {accountSid: accountSid};
AuthorizedConnectAppListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AuthorizedConnectApps.json' // jshint ignore:line
)(AuthorizedConnectAppListInstance._solution);
AuthorizedConnectAppListInstance._uri = `/Accounts/${accountSid}/AuthorizedConnectApps.json`;
/* jshint ignore:start */
/**
* Streams AuthorizedConnectAppInstance records from the API.
Expand Down Expand Up @@ -529,9 +527,7 @@ AuthorizedConnectAppContext = function AuthorizedConnectAppContext(version,

// Path Solution
this._solution = {accountSid: accountSid, connectAppSid: connectAppSid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/AuthorizedConnectApps/<%= connectAppSid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/AuthorizedConnectApps/${connectAppSid}.json`;
};

/* jshint ignore:start */
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/availablePhoneNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ AvailablePhoneNumberCountryList = function
AvailablePhoneNumberCountryListInstance._version = version;
// Path Solution
AvailablePhoneNumberCountryListInstance._solution = {accountSid: accountSid};
AvailablePhoneNumberCountryListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers.json' // jshint ignore:line
)(AvailablePhoneNumberCountryListInstance._solution);
AvailablePhoneNumberCountryListInstance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers.json`;
/* jshint ignore:start */
/**
* Streams AvailablePhoneNumberCountryInstance records from the API.
Expand Down Expand Up @@ -652,9 +650,7 @@ AvailablePhoneNumberCountryContext = function

// Path Solution
this._solution = {accountSid: accountSid, countryCode: countryCode, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}.json`;

// Dependents
this._local = undefined;
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/api/v2010/account/availablePhoneNumber/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ LocalList = function LocalList(version, accountSid, countryCode) {
LocalListInstance._version = version;
// Path Solution
LocalListInstance._solution = {accountSid: accountSid, countryCode: countryCode};
LocalListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/Local.json' // jshint ignore:line
)(LocalListInstance._solution);
LocalListInstance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/Local.json`;
/* jshint ignore:start */
/**
* Streams LocalInstance records from the API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ MachineToMachineList = function MachineToMachineList(version, accountSid,
MachineToMachineListInstance._version = version;
// Path Solution
MachineToMachineListInstance._solution = {accountSid: accountSid, countryCode: countryCode};
MachineToMachineListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/MachineToMachine.json' // jshint ignore:line
)(MachineToMachineListInstance._solution);
MachineToMachineListInstance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/MachineToMachine.json`;
/* jshint ignore:start */
/**
* Streams MachineToMachineInstance records from the API.
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/api/v2010/account/availablePhoneNumber/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ MobileList = function MobileList(version, accountSid, countryCode) {
MobileListInstance._version = version;
// Path Solution
MobileListInstance._solution = {accountSid: accountSid, countryCode: countryCode};
MobileListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/Mobile.json' // jshint ignore:line
)(MobileListInstance._solution);
MobileListInstance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/Mobile.json`;
/* jshint ignore:start */
/**
* Streams MobileInstance records from the API.
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/api/v2010/account/availablePhoneNumber/national.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ NationalList = function NationalList(version, accountSid, countryCode) {
NationalListInstance._version = version;
// Path Solution
NationalListInstance._solution = {accountSid: accountSid, countryCode: countryCode};
NationalListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/National.json' // jshint ignore:line
)(NationalListInstance._solution);
NationalListInstance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/National.json`;
/* jshint ignore:start */
/**
* Streams NationalInstance records from the API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ SharedCostList = function SharedCostList(version, accountSid, countryCode) {
SharedCostListInstance._version = version;
// Path Solution
SharedCostListInstance._solution = {accountSid: accountSid, countryCode: countryCode};
SharedCostListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/SharedCost.json' // jshint ignore:line
)(SharedCostListInstance._solution);
SharedCostListInstance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/SharedCost.json`;
/* jshint ignore:start */
/**
* Streams SharedCostInstance records from the API.
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/api/v2010/account/availablePhoneNumber/tollFree.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ TollFreeList = function TollFreeList(version, accountSid, countryCode) {
TollFreeListInstance._version = version;
// Path Solution
TollFreeListInstance._solution = {accountSid: accountSid, countryCode: countryCode};
TollFreeListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/TollFree.json' // jshint ignore:line
)(TollFreeListInstance._solution);
TollFreeListInstance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/TollFree.json`;
/* jshint ignore:start */
/**
* Streams TollFreeInstance records from the API.
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/api/v2010/account/availablePhoneNumber/voip.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ VoipList = function VoipList(version, accountSid, countryCode) {
VoipListInstance._version = version;
// Path Solution
VoipListInstance._solution = {accountSid: accountSid, countryCode: countryCode};
VoipListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/AvailablePhoneNumbers/<%= countryCode %>/Voip.json' // jshint ignore:line
)(VoipListInstance._solution);
VoipListInstance._uri = `/Accounts/${accountSid}/AvailablePhoneNumbers/${countryCode}/Voip.json`;
/* jshint ignore:start */
/**
* Streams VoipInstance records from the API.
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/api/v2010/account/balance.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ BalanceList = function BalanceList(version, accountSid) {
BalanceListInstance._version = version;
// Path Solution
BalanceListInstance._solution = {accountSid: accountSid};
BalanceListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Balance.json' // jshint ignore:line
)(BalanceListInstance._solution);
BalanceListInstance._uri = `/Accounts/${accountSid}/Balance.json`;
/* jshint ignore:start */
/**
* fetch a BalanceInstance
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/call.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ CallList = function CallList(version, accountSid) {
CallListInstance._version = version;
// Path Solution
CallListInstance._solution = {accountSid: accountSid};
CallListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Calls.json' // jshint ignore:line
)(CallListInstance._solution);
CallListInstance._uri = `/Accounts/${accountSid}/Calls.json`;

// Components
CallListInstance._feedbackSummaries = undefined;
Expand Down Expand Up @@ -857,9 +855,7 @@ CallContext = function CallContext(version, accountSid, sid) {

// Path Solution
this._solution = {accountSid: accountSid, sid: sid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/<%= sid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/Calls/${sid}.json`;

// Dependents
this._recordings = undefined;
Expand Down
4 changes: 1 addition & 3 deletions lib/rest/api/v2010/account/call/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,7 @@ FeedbackContext = function FeedbackContext(version, accountSid, callSid) {

// Path Solution
this._solution = {accountSid: accountSid, callSid: callSid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Feedback.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Feedback.json`;
};

/* jshint ignore:start */
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/call/feedbackSummary.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ FeedbackSummaryList = function FeedbackSummaryList(version, accountSid) {
FeedbackSummaryListInstance._version = version;
// Path Solution
FeedbackSummaryListInstance._solution = {accountSid: accountSid};
FeedbackSummaryListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/FeedbackSummary.json' // jshint ignore:line
)(FeedbackSummaryListInstance._solution);
FeedbackSummaryListInstance._uri = `/Accounts/${accountSid}/Calls/FeedbackSummary.json`;
/* jshint ignore:start */
/**
* create a FeedbackSummaryInstance
Expand Down Expand Up @@ -373,9 +371,7 @@ FeedbackSummaryContext = function FeedbackSummaryContext(version, accountSid,

// Path Solution
this._solution = {accountSid: accountSid, sid: sid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/FeedbackSummary/<%= sid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/Calls/FeedbackSummary/${sid}.json`;
};

/* jshint ignore:start */
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/call/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ NotificationList = function NotificationList(version, accountSid, callSid) {
NotificationListInstance._version = version;
// Path Solution
NotificationListInstance._solution = {accountSid: accountSid, callSid: callSid};
NotificationListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Notifications.json' // jshint ignore:line
)(NotificationListInstance._solution);
NotificationListInstance._uri = `/Accounts/${accountSid}/Calls/${callSid}/Notifications.json`;
/* jshint ignore:start */
/**
* Streams NotificationInstance records from the API.
Expand Down Expand Up @@ -590,9 +588,7 @@ NotificationContext = function NotificationContext(version, accountSid, callSid,

// Path Solution
this._solution = {accountSid: accountSid, callSid: callSid, sid: sid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Notifications/<%= sid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Notifications/${sid}.json`;
};

/* jshint ignore:start */
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/call/recording.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ RecordingList = function RecordingList(version, accountSid, callSid) {
RecordingListInstance._version = version;
// Path Solution
RecordingListInstance._solution = {accountSid: accountSid, callSid: callSid};
RecordingListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Recordings.json' // jshint ignore:line
)(RecordingListInstance._solution);
RecordingListInstance._uri = `/Accounts/${accountSid}/Calls/${callSid}/Recordings.json`;
/* jshint ignore:start */
/**
* create a RecordingInstance
Expand Down Expand Up @@ -668,9 +666,7 @@ RecordingContext = function RecordingContext(version, accountSid, callSid, sid)

// Path Solution
this._solution = {accountSid: accountSid, callSid: callSid, sid: sid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/Calls/<%= callSid %>/Recordings/<%= sid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/Calls/${callSid}/Recordings/${sid}.json`;
};

/* jshint ignore:start */
Expand Down
8 changes: 2 additions & 6 deletions lib/rest/api/v2010/account/conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ ConferenceList = function ConferenceList(version, accountSid) {
ConferenceListInstance._version = version;
// Path Solution
ConferenceListInstance._solution = {accountSid: accountSid};
ConferenceListInstance._uri = _.template(
'/Accounts/<%= accountSid %>/Conferences.json' // jshint ignore:line
)(ConferenceListInstance._solution);
ConferenceListInstance._uri = `/Accounts/${accountSid}/Conferences.json`;
/* jshint ignore:start */
/**
* Streams ConferenceInstance records from the API.
Expand Down Expand Up @@ -631,9 +629,7 @@ ConferenceContext = function ConferenceContext(version, accountSid, sid) {

// Path Solution
this._solution = {accountSid: accountSid, sid: sid, };
this._uri = _.template(
'/Accounts/<%= accountSid %>/Conferences/<%= sid %>.json' // jshint ignore:line
)(this._solution);
this._uri = `/Accounts/${accountSid}/Conferences/${sid}.json`;

// Dependents
this._participants = undefined;
Expand Down
Loading