@google-cloud/nodejs-common 2.0.5-alpha → 2.0.6-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/apis/index.js CHANGED
@@ -112,6 +112,18 @@ exports.bigquery = require('./bigquery.js');
112
112
  */
113
113
  exports.googleads = require('./google_ads.js');
114
114
 
115
+ /**
116
+ * APIs integration class for Google Ads with Google API library.
117
+ * @const {{
118
+ * GoogleAdsApi:!GoogleAdsApi,
119
+ * ConversionConfig:!ConversionConfig,
120
+ * CustomerMatchConfig: !CustomerMatchConfig,
121
+ * OfflineUserDataJobConfig: !OfflineUserDataJobConfig,
122
+ * CustomerMatchRecord: !CustomerMatchRecord,
123
+ * }}
124
+ */
125
+ exports.googleadsapi = require('./google_ads_api.js');
126
+
115
127
  /**
116
128
  * APIs integration class for Ads Data Hub.
117
129
  * @const {{
@@ -539,6 +539,28 @@ const changeNamingFromSnakeToLowerCamel = (name) => {
539
539
  (initial) => initial.substring(1).toUpperCase());
540
540
  };
541
541
 
542
+ /**
543
+ * Converts a JSON object which has snake naming convention to lower camel
544
+ * naming.
545
+ *
546
+ * @param {object} obj
547
+ * @return {object}
548
+ */
549
+ const changeObjectNamingFromSnakeToLowerCamel = (obj) => {
550
+ if (Array.isArray(obj)) {
551
+ return obj.map(changeObjectNamingFromSnakeToLowerCamel);
552
+ } else if (typeof obj === 'object') {
553
+ const newObj = {};
554
+ Object.keys(obj).forEach((key) => {
555
+ newObj[changeNamingFromSnakeToLowerCamel(key)] =
556
+ changeObjectNamingFromSnakeToLowerCamel(obj[key]);
557
+ });
558
+ return newObj;
559
+ } else {
560
+ return obj;
561
+ }
562
+ }
563
+
542
564
  /**
543
565
  * Returns the response data for a HTTP request. It will retry the specific
544
566
  * times if there was errors happened.
@@ -584,5 +606,6 @@ module.exports = {
584
606
  getObjectByPath,
585
607
  changeNamingFromSnakeToUpperCamel,
586
608
  changeNamingFromSnakeToLowerCamel,
609
+ changeObjectNamingFromSnakeToLowerCamel,
587
610
  requestWithRetry,
588
611
  };