diff --git a/src/v2/config_service_v2_client.js b/src/v2/config_service_v2_client.js index 80767569..4fb4e1f4 100644 --- a/src/v2/config_service_v2_client.js +++ b/src/v2/config_service_v2_client.js @@ -96,7 +96,7 @@ function ConfigServiceV2Client(gaxGrpc, grpcClients, opts) { var configServiceV2Stub = gaxGrpc.createStub( servicePath, port, - grpcClients.configServiceV2Client.google.logging.v2.ConfigServiceV2, + grpcClients.google.logging.v2.ConfigServiceV2, {sslCreds: sslCreds}); var configServiceV2StubMethods = [ 'listSinks', @@ -117,31 +117,31 @@ function ConfigServiceV2Client(gaxGrpc, grpcClients, opts) { // Path templates -var PARENT_PATH_TEMPLATE = new gax.PathTemplate( +var PROJECT_PATH_TEMPLATE = new gax.PathTemplate( 'projects/{project}'); var SINK_PATH_TEMPLATE = new gax.PathTemplate( 'projects/{project}/sinks/{sink}'); /** - * Returns a fully-qualified parent resource name string. + * Returns a fully-qualified project resource name string. * @param {String} project * @returns {String} */ -ConfigServiceV2Client.prototype.parentPath = function(project) { - return PARENT_PATH_TEMPLATE.render({ +ConfigServiceV2Client.prototype.projectPath = function(project) { + return PROJECT_PATH_TEMPLATE.render({ project: project }); }; /** - * Parses the parentName from a parent resource. - * @param {String} parentName - * A fully-qualified path representing a parent resources. + * Parses the projectName from a project resource. + * @param {String} projectName + * A fully-qualified path representing a project resources. * @returns {String} - A string representing the project. */ -ConfigServiceV2Client.prototype.matchProjectFromParentName = function(parentName) { - return PARENT_PATH_TEMPLATE.match(parentName).project; +ConfigServiceV2Client.prototype.matchProjectFromProjectName = function(projectName) { + return PROJECT_PATH_TEMPLATE.match(projectName).project; }; /** @@ -221,7 +221,7 @@ ConfigServiceV2Client.prototype.matchSinkFromSinkName = function(sinkName) { * @example * * var client = loggingV2.configServiceV2Client(); - * var formattedParent = client.parentPath("[PROJECT]"); + * var formattedParent = client.projectPath("[PROJECT]"); * // Iterate over all elements. * client.listSinks({parent: formattedParent}).then(function(responses) { * var resources = responses[0]; @@ -302,7 +302,7 @@ ConfigServiceV2Client.prototype.listSinks = function(request, options, callback) * @example * * var client = loggingV2.configServiceV2Client(); - * var formattedParent = client.parentPath("[PROJECT]"); + * var formattedParent = client.projectPath("[PROJECT]"); * client.listSinksStream({parent: formattedParent}).on('data', function(element) { * // doThingsWith(element) * }).on('error', function(err) { @@ -396,7 +396,7 @@ ConfigServiceV2Client.prototype.getSink = function(request, options, callback) { * @example * * var client = loggingV2.configServiceV2Client(); - * var formattedParent = client.parentPath("[PROJECT]"); + * var formattedParent = client.projectPath("[PROJECT]"); * var sink = {}; * var request = { * parent: formattedParent, @@ -537,9 +537,6 @@ function ConfigServiceV2ClientBuilder(gaxGrpc) { }]); extend(this, configServiceV2Client.google.logging.v2); - var grpcClients = { - configServiceV2Client: configServiceV2Client - }; /** * Build a new instance of {@link ConfigServiceV2Client}. @@ -560,7 +557,7 @@ function ConfigServiceV2ClientBuilder(gaxGrpc) { * The version of the calling service. */ this.configServiceV2Client = function(opts) { - return new ConfigServiceV2Client(gaxGrpc, grpcClients, opts); + return new ConfigServiceV2Client(gaxGrpc, configServiceV2Client, opts); }; extend(this.configServiceV2Client, ConfigServiceV2Client); } diff --git a/src/v2/logging_service_v2_client.js b/src/v2/logging_service_v2_client.js index 343d5cf8..4b5037e0 100644 --- a/src/v2/logging_service_v2_client.js +++ b/src/v2/logging_service_v2_client.js @@ -99,7 +99,7 @@ function LoggingServiceV2Client(gaxGrpc, grpcClients, opts) { var loggingServiceV2Stub = gaxGrpc.createStub( servicePath, port, - grpcClients.loggingServiceV2Client.google.logging.v2.LoggingServiceV2, + grpcClients.google.logging.v2.LoggingServiceV2, {sslCreds: sslCreds}); var loggingServiceV2StubMethods = [ 'deleteLog', @@ -119,31 +119,31 @@ function LoggingServiceV2Client(gaxGrpc, grpcClients, opts) { // Path templates -var PARENT_PATH_TEMPLATE = new gax.PathTemplate( +var PROJECT_PATH_TEMPLATE = new gax.PathTemplate( 'projects/{project}'); var LOG_PATH_TEMPLATE = new gax.PathTemplate( 'projects/{project}/logs/{log}'); /** - * Returns a fully-qualified parent resource name string. + * Returns a fully-qualified project resource name string. * @param {String} project * @returns {String} */ -LoggingServiceV2Client.prototype.parentPath = function(project) { - return PARENT_PATH_TEMPLATE.render({ +LoggingServiceV2Client.prototype.projectPath = function(project) { + return PROJECT_PATH_TEMPLATE.render({ project: project }); }; /** - * Parses the parentName from a parent resource. - * @param {String} parentName - * A fully-qualified path representing a parent resources. + * Parses the projectName from a project resource. + * @param {String} projectName + * A fully-qualified path representing a project resources. * @returns {String} - A string representing the project. */ -LoggingServiceV2Client.prototype.matchProjectFromParentName = function(parentName) { - return PARENT_PATH_TEMPLATE.match(parentName).project; +LoggingServiceV2Client.prototype.matchProjectFromProjectName = function(projectName) { + return PROJECT_PATH_TEMPLATE.match(projectName).project; }; /** @@ -633,9 +633,6 @@ function LoggingServiceV2ClientBuilder(gaxGrpc) { }]); extend(this, loggingServiceV2Client.google.logging.v2); - var grpcClients = { - loggingServiceV2Client: loggingServiceV2Client - }; /** * Build a new instance of {@link LoggingServiceV2Client}. @@ -656,7 +653,7 @@ function LoggingServiceV2ClientBuilder(gaxGrpc) { * The version of the calling service. */ this.loggingServiceV2Client = function(opts) { - return new LoggingServiceV2Client(gaxGrpc, grpcClients, opts); + return new LoggingServiceV2Client(gaxGrpc, loggingServiceV2Client, opts); }; extend(this.loggingServiceV2Client, LoggingServiceV2Client); } diff --git a/src/v2/metrics_service_v2_client.js b/src/v2/metrics_service_v2_client.js index a8f3d989..7ecf32cb 100644 --- a/src/v2/metrics_service_v2_client.js +++ b/src/v2/metrics_service_v2_client.js @@ -95,7 +95,7 @@ function MetricsServiceV2Client(gaxGrpc, grpcClients, opts) { var metricsServiceV2Stub = gaxGrpc.createStub( servicePath, port, - grpcClients.metricsServiceV2Client.google.logging.v2.MetricsServiceV2, + grpcClients.google.logging.v2.MetricsServiceV2, {sslCreds: sslCreds}); var metricsServiceV2StubMethods = [ 'listLogMetrics', @@ -116,31 +116,31 @@ function MetricsServiceV2Client(gaxGrpc, grpcClients, opts) { // Path templates -var PARENT_PATH_TEMPLATE = new gax.PathTemplate( +var PROJECT_PATH_TEMPLATE = new gax.PathTemplate( 'projects/{project}'); var METRIC_PATH_TEMPLATE = new gax.PathTemplate( 'projects/{project}/metrics/{metric}'); /** - * Returns a fully-qualified parent resource name string. + * Returns a fully-qualified project resource name string. * @param {String} project * @returns {String} */ -MetricsServiceV2Client.prototype.parentPath = function(project) { - return PARENT_PATH_TEMPLATE.render({ +MetricsServiceV2Client.prototype.projectPath = function(project) { + return PROJECT_PATH_TEMPLATE.render({ project: project }); }; /** - * Parses the parentName from a parent resource. - * @param {String} parentName - * A fully-qualified path representing a parent resources. + * Parses the projectName from a project resource. + * @param {String} projectName + * A fully-qualified path representing a project resources. * @returns {String} - A string representing the project. */ -MetricsServiceV2Client.prototype.matchProjectFromParentName = function(parentName) { - return PARENT_PATH_TEMPLATE.match(parentName).project; +MetricsServiceV2Client.prototype.matchProjectFromProjectName = function(projectName) { + return PROJECT_PATH_TEMPLATE.match(projectName).project; }; /** @@ -219,7 +219,7 @@ MetricsServiceV2Client.prototype.matchMetricFromMetricName = function(metricName * @example * * var client = loggingV2.metricsServiceV2Client(); - * var formattedParent = client.parentPath("[PROJECT]"); + * var formattedParent = client.projectPath("[PROJECT]"); * // Iterate over all elements. * client.listLogMetrics({parent: formattedParent}).then(function(responses) { * var resources = responses[0]; @@ -299,7 +299,7 @@ MetricsServiceV2Client.prototype.listLogMetrics = function(request, options, cal * @example * * var client = loggingV2.metricsServiceV2Client(); - * var formattedParent = client.parentPath("[PROJECT]"); + * var formattedParent = client.projectPath("[PROJECT]"); * client.listLogMetricsStream({parent: formattedParent}).on('data', function(element) { * // doThingsWith(element) * }).on('error', function(err) { @@ -387,7 +387,7 @@ MetricsServiceV2Client.prototype.getLogMetric = function(request, options, callb * @example * * var client = loggingV2.metricsServiceV2Client(); - * var formattedParent = client.parentPath("[PROJECT]"); + * var formattedParent = client.projectPath("[PROJECT]"); * var metric = {}; * var request = { * parent: formattedParent, @@ -516,9 +516,6 @@ function MetricsServiceV2ClientBuilder(gaxGrpc) { }]); extend(this, metricsServiceV2Client.google.logging.v2); - var grpcClients = { - metricsServiceV2Client: metricsServiceV2Client - }; /** * Build a new instance of {@link MetricsServiceV2Client}. @@ -539,7 +536,7 @@ function MetricsServiceV2ClientBuilder(gaxGrpc) { * The version of the calling service. */ this.metricsServiceV2Client = function(opts) { - return new MetricsServiceV2Client(gaxGrpc, grpcClients, opts); + return new MetricsServiceV2Client(gaxGrpc, metricsServiceV2Client, opts); }; extend(this.metricsServiceV2Client, MetricsServiceV2Client); }