From 80384c0f2c4cdec2d75de4497141814d60dd232b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 6 Jan 2021 16:19:28 -0800 Subject: [PATCH] feat: Add support for "billingAccounts" as another parent resource name for recommendations and insights APIs. (#138) BREAKING CHANGE: resource path helper recommenderPath has been removed --- packages/google-cloud-recommender/README.md | 2 +- .../google/cloud/recommender/v1/insight.proto | 2 + .../cloud/recommender/v1/recommendation.proto | 8 +- .../recommender/v1/recommender_service.proto | 32 + .../protos/protos.d.ts | 12 + .../google-cloud-recommender/protos/protos.js | 78 ++- .../protos/protos.json | 75 ++- .../samples/quickstart.js | 6 +- .../src/v1/recommender_client.ts | 621 ++++++++++++++---- .../google-cloud-recommender/synth.metadata | 6 +- .../test/gapic_recommender_v1.ts | 546 ++++++++++++--- 11 files changed, 1168 insertions(+), 220 deletions(-) diff --git a/packages/google-cloud-recommender/README.md b/packages/google-cloud-recommender/README.md index beca47bd785..3cee77b9659 100644 --- a/packages/google-cloud-recommender/README.md +++ b/packages/google-cloud-recommender/README.md @@ -66,7 +66,7 @@ async function listRecommendations() { // recommenderId = 'google.compute.instance.MachineTypeRecommender'; const [recommendations] = await recommender.listRecommendations({ - parent: recommender.recommenderPath(project, 'global', recommenderId), + parent: recommender.projectLocationRecommenderPath(project, 'global', recommenderId), }); console.info(`recommendations for ${recommenderId}:`); for (const recommendation of recommendations) { diff --git a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/insight.proto b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/insight.proto index 783a714776e..3708c8355f5 100644 --- a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/insight.proto +++ b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/insight.proto @@ -30,6 +30,7 @@ option objc_class_prefix = "CREC"; option (google.api.resource_definition) = { type: "recommender.googleapis.com/InsightType" pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}" + pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}" }; // An insight along with the information used to derive the insight. The insight @@ -38,6 +39,7 @@ message Insight { option (google.api.resource) = { type: "recommender.googleapis.com/Insight" pattern: "projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" + pattern: "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" }; // Reference to an associated recommendation. diff --git a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommendation.proto b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommendation.proto index aa8321eeb42..42345d8e1d0 100644 --- a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommendation.proto +++ b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommendation.proto @@ -30,6 +30,7 @@ option objc_class_prefix = "CREC"; option (google.api.resource_definition) = { type: "recommender.googleapis.com/Recommender" pattern: "projects/{project}/locations/{location}/recommenders/{recommender}" + pattern: "billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}" }; // A recommendation along with a suggested action. E.g., a rightsizing @@ -38,6 +39,7 @@ message Recommendation { option (google.api.resource) = { type: "recommender.googleapis.com/Recommendation" pattern: "projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" + pattern: "billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" }; // Reference to an associated insight. @@ -170,12 +172,12 @@ message Operation { // "/versions/*/targetSize/percent": 20 // } // * Example: { - // "/bindings/*/role": "roles/admin" + // "/bindings/*/role": "roles/owner" // "/bindings/*/condition" : null // } // * Example: { - // "/bindings/*/role": "roles/admin" - // "/bindings/*/members/*" : ["x@google.com", "y@google.com"] + // "/bindings/*/role": "roles/owner" + // "/bindings/*/members/*" : ["x@example.com", "y@example.com"] // } // When both path_filters and path_value_matchers are set, an implicit AND // must be performed. diff --git a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommender_service.proto b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommender_service.proto index 4f24a050959..3bd54f836b8 100644 --- a/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommender_service.proto +++ b/packages/google-cloud-recommender/protos/google/cloud/recommender/v1/recommender_service.proto @@ -43,6 +43,9 @@ service Recommender { rpc ListInsights(ListInsightsRequest) returns (ListInsightsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights" + additional_bindings { + get: "/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights" + } }; option (google.api.method_signature) = "parent"; } @@ -52,6 +55,9 @@ service Recommender { rpc GetInsight(GetInsightRequest) returns (Insight) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}" + additional_bindings { + get: "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}" + } }; option (google.api.method_signature) = "name"; } @@ -66,6 +72,10 @@ service Recommender { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted" body: "*" + additional_bindings { + post: "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted" + body: "*" + } }; option (google.api.method_signature) = "name,state_metadata,etag"; } @@ -75,6 +85,9 @@ service Recommender { rpc ListRecommendations(ListRecommendationsRequest) returns (ListRecommendationsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations" + additional_bindings { + get: "/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations" + } }; option (google.api.method_signature) = "parent"; option (google.api.method_signature) = "parent,filter"; @@ -85,6 +98,9 @@ service Recommender { rpc GetRecommendation(GetRecommendationRequest) returns (Recommendation) { option (google.api.http) = { get: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}" + additional_bindings { + get: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}" + } }; option (google.api.method_signature) = "name"; } @@ -103,6 +119,10 @@ service Recommender { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed" body: "*" + additional_bindings { + post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed" + body: "*" + } }; option (google.api.method_signature) = "name,state_metadata,etag"; } @@ -122,6 +142,10 @@ service Recommender { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded" body: "*" + additional_bindings { + post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded" + body: "*" + } }; option (google.api.method_signature) = "name,state_metadata,etag"; } @@ -141,6 +165,10 @@ service Recommender { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed" body: "*" + additional_bindings { + post: "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed" + body: "*" + } }; option (google.api.method_signature) = "name,state_metadata,etag"; } @@ -156,6 +184,8 @@ message ListInsightsRequest { // // LOCATION here refers to GCP Locations: // https://cloud.google.com/about/locations/ + // INSIGHT_TYPE_ID refers to supported insight types: + // https://cloud.google.com/recommender/docs/insights/insight-types.) string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -229,6 +259,8 @@ message ListRecommendationsRequest { // // LOCATION here refers to GCP Locations: // https://cloud.google.com/about/locations/ + // RECOMMENDER_ID refers to supported recommenders: + // https://cloud.google.com/recommender/docs/recommenders. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { diff --git a/packages/google-cloud-recommender/protos/protos.d.ts b/packages/google-cloud-recommender/protos/protos.d.ts index ed0e809b5f0..bc31eba437f 100644 --- a/packages/google-cloud-recommender/protos/protos.d.ts +++ b/packages/google-cloud-recommender/protos/protos.d.ts @@ -2572,6 +2572,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -2601,6 +2604,9 @@ export namespace google { /** ResourceDescriptor singular. */ public singular: string; + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + /** * Creates a new ResourceDescriptor instance using the specified properties. * @param [properties] Properties to set @@ -2680,6 +2686,12 @@ export namespace google { ORIGINALLY_SINGLE_PATTERN = 1, FUTURE_MULTI_PATTERN = 2 } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } } /** Properties of a ResourceReference. */ diff --git a/packages/google-cloud-recommender/protos/protos.js b/packages/google-cloud-recommender/protos/protos.js index 39ad1ac0da5..ace10af9547 100644 --- a/packages/google-cloud-recommender/protos/protos.js +++ b/packages/google-cloud-recommender/protos/protos.js @@ -6367,6 +6367,7 @@ * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history * @property {string|null} [plural] ResourceDescriptor plural * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style */ /** @@ -6379,6 +6380,7 @@ */ function ResourceDescriptor(properties) { this.pattern = []; + this.style = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6433,6 +6435,14 @@ */ ResourceDescriptor.prototype.singular = ""; + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + /** * Creates a new ResourceDescriptor instance using the specified properties. * @function create @@ -6470,6 +6480,12 @@ writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } return writer; }; @@ -6524,6 +6540,16 @@ case 6: message.singular = reader.string(); break; + case 10: + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; default: reader.skipType(tag & 7); break; @@ -6587,6 +6613,18 @@ if (message.singular != null && message.hasOwnProperty("singular")) if (!$util.isString(message.singular)) return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } return null; }; @@ -6631,6 +6669,23 @@ message.plural = String(object.plural); if (object.singular != null) message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } return message; }; @@ -6647,8 +6702,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.pattern = []; + object.style = []; + } if (options.defaults) { object.type = ""; object.nameField = ""; @@ -6671,6 +6728,11 @@ object.plural = message.plural; if (message.singular != null && message.hasOwnProperty("singular")) object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } return object; }; @@ -6701,6 +6763,20 @@ return values; })(); + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + return ResourceDescriptor; })(); diff --git a/packages/google-cloud-recommender/protos/protos.json b/packages/google-cloud-recommender/protos/protos.json index 8512eb6942f..7be5025029b 100644 --- a/packages/google-cloud-recommender/protos/protos.json +++ b/packages/google-cloud-recommender/protos/protos.json @@ -15,13 +15,13 @@ "java_package": "com.google.cloud.recommender.v1", "objc_class_prefix": "CREC", "(google.api.resource_definition).type": "recommender.googleapis.com/Recommender", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/recommenders/{recommender}" + "(google.api.resource_definition).pattern": "billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}" }, "nested": { "Insight": { "options": { "(google.api.resource).type": "recommender.googleapis.com/Insight", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" + "(google.api.resource).pattern": "billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}" }, "fields": { "name": { @@ -117,7 +117,7 @@ "Recommendation": { "options": { "(google.api.resource).type": "recommender.googleapis.com/Recommendation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" + "(google.api.resource).pattern": "billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" }, "fields": { "name": { @@ -339,12 +339,16 @@ "responseType": "ListInsightsResponse", "options": { "(google.api.http).get": "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights", + "(google.api.http).additional_bindings.get": "/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights" + "get": "/v1/{parent=projects/*/locations/*/insightTypes/*}/insights", + "additional_bindings": { + "get": "/v1/{parent=billingAccounts/*/locations/*/insightTypes/*}/insights" + } } }, { @@ -357,12 +361,16 @@ "responseType": "Insight", "options": { "(google.api.http).get": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}" + "get": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}", + "additional_bindings": { + "get": "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}" + } } }, { @@ -376,13 +384,19 @@ "options": { "(google.api.http).post": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,state_metadata,etag" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{name=projects/*/locations/*/insightTypes/*/insights/*}:markAccepted", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v1/{name=billingAccounts/*/locations/*/insightTypes/*/insights/*}:markAccepted", + "body": "*" + } } }, { @@ -395,12 +409,16 @@ "responseType": "ListRecommendationsResponse", "options": { "(google.api.http).get": "/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations", + "(google.api.http).additional_bindings.get": "/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations", "(google.api.method_signature)": "parent,filter" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations" + "get": "/v1/{parent=projects/*/locations/*/recommenders/*}/recommendations", + "additional_bindings": { + "get": "/v1/{parent=billingAccounts/*/locations/*/recommenders/*}/recommendations" + } } }, { @@ -416,12 +434,16 @@ "responseType": "Recommendation", "options": { "(google.api.http).get": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}", + "(google.api.http).additional_bindings.get": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}" + "get": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}", + "additional_bindings": { + "get": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}" + } } }, { @@ -435,13 +457,19 @@ "options": { "(google.api.http).post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,state_metadata,etag" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markClaimed", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markClaimed", + "body": "*" + } } }, { @@ -455,13 +483,19 @@ "options": { "(google.api.http).post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,state_metadata,etag" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markSucceeded", + "body": "*" + } } }, { @@ -475,13 +509,19 @@ "options": { "(google.api.http).post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed", "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "name,state_metadata,etag" }, "parsedOptions": [ { "(google.api.http)": { "post": "/v1/{name=projects/*/locations/*/recommenders/*/recommendations/*}:markFailed", - "body": "*" + "body": "*", + "additional_bindings": { + "post": "/v1/{name=billingAccounts/*/locations/*/recommenders/*/recommendations/*}:markFailed", + "body": "*" + } } }, { @@ -761,6 +801,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -770,6 +815,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -908,7 +959,7 @@ }, "protobuf": { "options": { - "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "go_package": "google.golang.org/protobuf/types/descriptorpb", "java_package": "com.google.protobuf", "java_outer_classname": "DescriptorProtos", "csharp_namespace": "Google.Protobuf.Reflection", diff --git a/packages/google-cloud-recommender/samples/quickstart.js b/packages/google-cloud-recommender/samples/quickstart.js index a8314c5ad34..3ec850b519f 100644 --- a/packages/google-cloud-recommender/samples/quickstart.js +++ b/packages/google-cloud-recommender/samples/quickstart.js @@ -33,7 +33,11 @@ async function main( // recommenderId = 'google.compute.instance.MachineTypeRecommender'; const [recommendations] = await recommender.listRecommendations({ - parent: recommender.recommenderPath(project, 'global', recommenderId), + parent: recommender.projectLocationRecommenderPath( + project, + 'global', + recommenderId + ), }); console.info(`recommendations for ${recommenderId}:`); for (const recommendation of recommendations) { diff --git a/packages/google-cloud-recommender/src/v1/recommender_client.ts b/packages/google-cloud-recommender/src/v1/recommender_client.ts index 10836b5b11a..849785fba65 100644 --- a/packages/google-cloud-recommender/src/v1/recommender_client.ts +++ b/packages/google-cloud-recommender/src/v1/recommender_client.ts @@ -169,18 +169,30 @@ export class RecommenderClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { - insightPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}' + billingAccountLocationInsightTypePathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}' + ), + billingAccountLocationInsightTypeInsightPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/insightTypes/{insight_type}/insights/{insight}' + ), + billingAccountLocationRecommenderPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}' + ), + billingAccountLocationRecommenderRecommendationPathTemplate: new this._gaxModule.PathTemplate( + 'billingAccounts/{billing_account}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}' ), - insightTypePathTemplate: new this._gaxModule.PathTemplate( + projectLocationInsightTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/insightTypes/{insight_type}' ), - recommendationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}' + projectLocationInsightTypeInsightPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/insightTypes/{insight_type}/insights/{insight}' ), - recommenderPathTemplate: new this._gaxModule.PathTemplate( + projectLocationRecommenderPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/recommenders/{recommender}' ), + projectLocationRecommenderRecommendationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}' + ), }; // Some of the methods on this service return "paged" results, @@ -1025,6 +1037,8 @@ export class RecommenderClient { * * LOCATION here refers to GCP Locations: * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types.) * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. Non-positive * values are ignored. If not specified, the server will determine the number @@ -1109,6 +1123,8 @@ export class RecommenderClient { * * LOCATION here refers to GCP Locations: * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types.) * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. Non-positive * values are ignored. If not specified, the server will determine the number @@ -1171,6 +1187,8 @@ export class RecommenderClient { * * LOCATION here refers to GCP Locations: * https://cloud.google.com/about/locations/ + * INSIGHT_TYPE_ID refers to supported insight types: + * https://cloud.google.com/recommender/docs/insights/insight-types.) * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. Non-positive * values are ignored. If not specified, the server will determine the number @@ -1268,6 +1286,8 @@ export class RecommenderClient { * * LOCATION here refers to GCP Locations: * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. Non-positive * values are ignored. If not specified, the server will determine the number @@ -1352,6 +1372,8 @@ export class RecommenderClient { * * LOCATION here refers to GCP Locations: * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. Non-positive * values are ignored. If not specified, the server will determine the number @@ -1414,6 +1436,8 @@ export class RecommenderClient { * * LOCATION here refers to GCP Locations: * https://cloud.google.com/about/locations/ + * RECOMMENDER_ID refers to supported recommenders: + * https://cloud.google.com/recommender/docs/recommenders. * @param {number} [request.pageSize] * Optional. The maximum number of results to return from this request. Non-positive * values are ignored. If not specified, the server will determine the number @@ -1470,83 +1494,323 @@ export class RecommenderClient { // -------------------- /** - * Return a fully-qualified insight resource name string. + * Return a fully-qualified billingAccountLocationInsightType resource name string. * - * @param {string} project + * @param {string} billing_account + * @param {string} location + * @param {string} insight_type + * @returns {string} Resource name string. + */ + billingAccountLocationInsightTypePath( + billingAccount: string, + location: string, + insightType: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypePathTemplate.render( + { + billing_account: billingAccount, + location: location, + insight_type: insightType, + } + ); + } + + /** + * Parse the billing_account from BillingAccountLocationInsightType resource. + * + * @param {string} billingAccountLocationInsightTypeName + * A fully-qualified path representing billing_account_location_insight_type resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationInsightTypeName( + billingAccountLocationInsightTypeName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypePathTemplate.match( + billingAccountLocationInsightTypeName + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationInsightType resource. + * + * @param {string} billingAccountLocationInsightTypeName + * A fully-qualified path representing billing_account_location_insight_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationInsightTypeName( + billingAccountLocationInsightTypeName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypePathTemplate.match( + billingAccountLocationInsightTypeName + ).location; + } + + /** + * Parse the insight_type from BillingAccountLocationInsightType resource. + * + * @param {string} billingAccountLocationInsightTypeName + * A fully-qualified path representing billing_account_location_insight_type resource. + * @returns {string} A string representing the insight_type. + */ + matchInsightTypeFromBillingAccountLocationInsightTypeName( + billingAccountLocationInsightTypeName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypePathTemplate.match( + billingAccountLocationInsightTypeName + ).insight_type; + } + + /** + * Return a fully-qualified billingAccountLocationInsightTypeInsight resource name string. + * + * @param {string} billing_account * @param {string} location * @param {string} insight_type * @param {string} insight * @returns {string} Resource name string. */ - insightPath( - project: string, + billingAccountLocationInsightTypeInsightPath( + billingAccount: string, location: string, insightType: string, insight: string ) { - return this.pathTemplates.insightPathTemplate.render({ - project: project, - location: location, - insight_type: insightType, - insight: insight, - }); + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.render( + { + billing_account: billingAccount, + location: location, + insight_type: insightType, + insight: insight, + } + ); } /** - * Parse the project from Insight resource. + * Parse the billing_account from BillingAccountLocationInsightTypeInsight resource. * - * @param {string} insightName - * A fully-qualified path representing Insight resource. - * @returns {string} A string representing the project. + * @param {string} billingAccountLocationInsightTypeInsightName + * A fully-qualified path representing billing_account_location_insight_type_insight resource. + * @returns {string} A string representing the billing_account. */ - matchProjectFromInsightName(insightName: string) { - return this.pathTemplates.insightPathTemplate.match(insightName).project; + matchBillingAccountFromBillingAccountLocationInsightTypeInsightName( + billingAccountLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match( + billingAccountLocationInsightTypeInsightName + ).billing_account; } /** - * Parse the location from Insight resource. + * Parse the location from BillingAccountLocationInsightTypeInsight resource. * - * @param {string} insightName - * A fully-qualified path representing Insight resource. + * @param {string} billingAccountLocationInsightTypeInsightName + * A fully-qualified path representing billing_account_location_insight_type_insight resource. * @returns {string} A string representing the location. */ - matchLocationFromInsightName(insightName: string) { - return this.pathTemplates.insightPathTemplate.match(insightName).location; + matchLocationFromBillingAccountLocationInsightTypeInsightName( + billingAccountLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match( + billingAccountLocationInsightTypeInsightName + ).location; } /** - * Parse the insight_type from Insight resource. + * Parse the insight_type from BillingAccountLocationInsightTypeInsight resource. * - * @param {string} insightName - * A fully-qualified path representing Insight resource. + * @param {string} billingAccountLocationInsightTypeInsightName + * A fully-qualified path representing billing_account_location_insight_type_insight resource. * @returns {string} A string representing the insight_type. */ - matchInsightTypeFromInsightName(insightName: string) { - return this.pathTemplates.insightPathTemplate.match(insightName) - .insight_type; + matchInsightTypeFromBillingAccountLocationInsightTypeInsightName( + billingAccountLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match( + billingAccountLocationInsightTypeInsightName + ).insight_type; } /** - * Parse the insight from Insight resource. + * Parse the insight from BillingAccountLocationInsightTypeInsight resource. * - * @param {string} insightName - * A fully-qualified path representing Insight resource. + * @param {string} billingAccountLocationInsightTypeInsightName + * A fully-qualified path representing billing_account_location_insight_type_insight resource. * @returns {string} A string representing the insight. */ - matchInsightFromInsightName(insightName: string) { - return this.pathTemplates.insightPathTemplate.match(insightName).insight; + matchInsightFromBillingAccountLocationInsightTypeInsightName( + billingAccountLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match( + billingAccountLocationInsightTypeInsightName + ).insight; + } + + /** + * Return a fully-qualified billingAccountLocationRecommender resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} recommender + * @returns {string} Resource name string. + */ + billingAccountLocationRecommenderPath( + billingAccount: string, + location: string, + recommender: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderPathTemplate.render( + { + billing_account: billingAccount, + location: location, + recommender: recommender, + } + ); + } + + /** + * Parse the billing_account from BillingAccountLocationRecommender resource. + * + * @param {string} billingAccountLocationRecommenderName + * A fully-qualified path representing billing_account_location_recommender resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationRecommenderName( + billingAccountLocationRecommenderName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderPathTemplate.match( + billingAccountLocationRecommenderName + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationRecommender resource. + * + * @param {string} billingAccountLocationRecommenderName + * A fully-qualified path representing billing_account_location_recommender resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationRecommenderName( + billingAccountLocationRecommenderName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderPathTemplate.match( + billingAccountLocationRecommenderName + ).location; + } + + /** + * Parse the recommender from BillingAccountLocationRecommender resource. + * + * @param {string} billingAccountLocationRecommenderName + * A fully-qualified path representing billing_account_location_recommender resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromBillingAccountLocationRecommenderName( + billingAccountLocationRecommenderName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderPathTemplate.match( + billingAccountLocationRecommenderName + ).recommender; + } + + /** + * Return a fully-qualified billingAccountLocationRecommenderRecommendation resource name string. + * + * @param {string} billing_account + * @param {string} location + * @param {string} recommender + * @param {string} recommendation + * @returns {string} Resource name string. + */ + billingAccountLocationRecommenderRecommendationPath( + billingAccount: string, + location: string, + recommender: string, + recommendation: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.render( + { + billing_account: billingAccount, + location: location, + recommender: recommender, + recommendation: recommendation, + } + ); + } + + /** + * Parse the billing_account from BillingAccountLocationRecommenderRecommendation resource. + * + * @param {string} billingAccountLocationRecommenderRecommendationName + * A fully-qualified path representing billing_account_location_recommender_recommendation resource. + * @returns {string} A string representing the billing_account. + */ + matchBillingAccountFromBillingAccountLocationRecommenderRecommendationName( + billingAccountLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match( + billingAccountLocationRecommenderRecommendationName + ).billing_account; + } + + /** + * Parse the location from BillingAccountLocationRecommenderRecommendation resource. + * + * @param {string} billingAccountLocationRecommenderRecommendationName + * A fully-qualified path representing billing_account_location_recommender_recommendation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBillingAccountLocationRecommenderRecommendationName( + billingAccountLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match( + billingAccountLocationRecommenderRecommendationName + ).location; + } + + /** + * Parse the recommender from BillingAccountLocationRecommenderRecommendation resource. + * + * @param {string} billingAccountLocationRecommenderRecommendationName + * A fully-qualified path representing billing_account_location_recommender_recommendation resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromBillingAccountLocationRecommenderRecommendationName( + billingAccountLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match( + billingAccountLocationRecommenderRecommendationName + ).recommender; + } + + /** + * Parse the recommendation from BillingAccountLocationRecommenderRecommendation resource. + * + * @param {string} billingAccountLocationRecommenderRecommendationName + * A fully-qualified path representing billing_account_location_recommender_recommendation resource. + * @returns {string} A string representing the recommendation. + */ + matchRecommendationFromBillingAccountLocationRecommenderRecommendationName( + billingAccountLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match( + billingAccountLocationRecommenderRecommendationName + ).recommendation; } /** - * Return a fully-qualified insightType resource name string. + * Return a fully-qualified projectLocationInsightType resource name string. * * @param {string} project * @param {string} location * @param {string} insight_type * @returns {string} Resource name string. */ - insightTypePath(project: string, location: string, insightType: string) { - return this.pathTemplates.insightTypePathTemplate.render({ + projectLocationInsightTypePath( + project: string, + location: string, + insightType: string + ) { + return this.pathTemplates.projectLocationInsightTypePathTemplate.render({ project: project, location: location, insight_type: insightType, @@ -1554,126 +1818,149 @@ export class RecommenderClient { } /** - * Parse the project from InsightType resource. + * Parse the project from ProjectLocationInsightType resource. * - * @param {string} insightTypeName - * A fully-qualified path representing InsightType resource. + * @param {string} projectLocationInsightTypeName + * A fully-qualified path representing project_location_insight_type resource. * @returns {string} A string representing the project. */ - matchProjectFromInsightTypeName(insightTypeName: string) { - return this.pathTemplates.insightTypePathTemplate.match(insightTypeName) - .project; + matchProjectFromProjectLocationInsightTypeName( + projectLocationInsightTypeName: string + ) { + return this.pathTemplates.projectLocationInsightTypePathTemplate.match( + projectLocationInsightTypeName + ).project; } /** - * Parse the location from InsightType resource. + * Parse the location from ProjectLocationInsightType resource. * - * @param {string} insightTypeName - * A fully-qualified path representing InsightType resource. + * @param {string} projectLocationInsightTypeName + * A fully-qualified path representing project_location_insight_type resource. * @returns {string} A string representing the location. */ - matchLocationFromInsightTypeName(insightTypeName: string) { - return this.pathTemplates.insightTypePathTemplate.match(insightTypeName) - .location; + matchLocationFromProjectLocationInsightTypeName( + projectLocationInsightTypeName: string + ) { + return this.pathTemplates.projectLocationInsightTypePathTemplate.match( + projectLocationInsightTypeName + ).location; } /** - * Parse the insight_type from InsightType resource. + * Parse the insight_type from ProjectLocationInsightType resource. * - * @param {string} insightTypeName - * A fully-qualified path representing InsightType resource. + * @param {string} projectLocationInsightTypeName + * A fully-qualified path representing project_location_insight_type resource. * @returns {string} A string representing the insight_type. */ - matchInsightTypeFromInsightTypeName(insightTypeName: string) { - return this.pathTemplates.insightTypePathTemplate.match(insightTypeName) - .insight_type; + matchInsightTypeFromProjectLocationInsightTypeName( + projectLocationInsightTypeName: string + ) { + return this.pathTemplates.projectLocationInsightTypePathTemplate.match( + projectLocationInsightTypeName + ).insight_type; } /** - * Return a fully-qualified recommendation resource name string. + * Return a fully-qualified projectLocationInsightTypeInsight resource name string. * * @param {string} project * @param {string} location - * @param {string} recommender - * @param {string} recommendation + * @param {string} insight_type + * @param {string} insight * @returns {string} Resource name string. */ - recommendationPath( + projectLocationInsightTypeInsightPath( project: string, location: string, - recommender: string, - recommendation: string + insightType: string, + insight: string ) { - return this.pathTemplates.recommendationPathTemplate.render({ - project: project, - location: location, - recommender: recommender, - recommendation: recommendation, - }); + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.render( + { + project: project, + location: location, + insight_type: insightType, + insight: insight, + } + ); } /** - * Parse the project from Recommendation resource. + * Parse the project from ProjectLocationInsightTypeInsight resource. * - * @param {string} recommendationName - * A fully-qualified path representing Recommendation resource. + * @param {string} projectLocationInsightTypeInsightName + * A fully-qualified path representing project_location_insight_type_insight resource. * @returns {string} A string representing the project. */ - matchProjectFromRecommendationName(recommendationName: string) { - return this.pathTemplates.recommendationPathTemplate.match( - recommendationName + matchProjectFromProjectLocationInsightTypeInsightName( + projectLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match( + projectLocationInsightTypeInsightName ).project; } /** - * Parse the location from Recommendation resource. + * Parse the location from ProjectLocationInsightTypeInsight resource. * - * @param {string} recommendationName - * A fully-qualified path representing Recommendation resource. + * @param {string} projectLocationInsightTypeInsightName + * A fully-qualified path representing project_location_insight_type_insight resource. * @returns {string} A string representing the location. */ - matchLocationFromRecommendationName(recommendationName: string) { - return this.pathTemplates.recommendationPathTemplate.match( - recommendationName + matchLocationFromProjectLocationInsightTypeInsightName( + projectLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match( + projectLocationInsightTypeInsightName ).location; } /** - * Parse the recommender from Recommendation resource. + * Parse the insight_type from ProjectLocationInsightTypeInsight resource. * - * @param {string} recommendationName - * A fully-qualified path representing Recommendation resource. - * @returns {string} A string representing the recommender. + * @param {string} projectLocationInsightTypeInsightName + * A fully-qualified path representing project_location_insight_type_insight resource. + * @returns {string} A string representing the insight_type. */ - matchRecommenderFromRecommendationName(recommendationName: string) { - return this.pathTemplates.recommendationPathTemplate.match( - recommendationName - ).recommender; + matchInsightTypeFromProjectLocationInsightTypeInsightName( + projectLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match( + projectLocationInsightTypeInsightName + ).insight_type; } /** - * Parse the recommendation from Recommendation resource. + * Parse the insight from ProjectLocationInsightTypeInsight resource. * - * @param {string} recommendationName - * A fully-qualified path representing Recommendation resource. - * @returns {string} A string representing the recommendation. + * @param {string} projectLocationInsightTypeInsightName + * A fully-qualified path representing project_location_insight_type_insight resource. + * @returns {string} A string representing the insight. */ - matchRecommendationFromRecommendationName(recommendationName: string) { - return this.pathTemplates.recommendationPathTemplate.match( - recommendationName - ).recommendation; + matchInsightFromProjectLocationInsightTypeInsightName( + projectLocationInsightTypeInsightName: string + ) { + return this.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match( + projectLocationInsightTypeInsightName + ).insight; } /** - * Return a fully-qualified recommender resource name string. + * Return a fully-qualified projectLocationRecommender resource name string. * * @param {string} project * @param {string} location * @param {string} recommender * @returns {string} Resource name string. */ - recommenderPath(project: string, location: string, recommender: string) { - return this.pathTemplates.recommenderPathTemplate.render({ + projectLocationRecommenderPath( + project: string, + location: string, + recommender: string + ) { + return this.pathTemplates.projectLocationRecommenderPathTemplate.render({ project: project, location: location, recommender: recommender, @@ -1681,39 +1968,133 @@ export class RecommenderClient { } /** - * Parse the project from Recommender resource. + * Parse the project from ProjectLocationRecommender resource. * - * @param {string} recommenderName - * A fully-qualified path representing Recommender resource. + * @param {string} projectLocationRecommenderName + * A fully-qualified path representing project_location_recommender resource. * @returns {string} A string representing the project. */ - matchProjectFromRecommenderName(recommenderName: string) { - return this.pathTemplates.recommenderPathTemplate.match(recommenderName) - .project; + matchProjectFromProjectLocationRecommenderName( + projectLocationRecommenderName: string + ) { + return this.pathTemplates.projectLocationRecommenderPathTemplate.match( + projectLocationRecommenderName + ).project; + } + + /** + * Parse the location from ProjectLocationRecommender resource. + * + * @param {string} projectLocationRecommenderName + * A fully-qualified path representing project_location_recommender resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationRecommenderName( + projectLocationRecommenderName: string + ) { + return this.pathTemplates.projectLocationRecommenderPathTemplate.match( + projectLocationRecommenderName + ).location; + } + + /** + * Parse the recommender from ProjectLocationRecommender resource. + * + * @param {string} projectLocationRecommenderName + * A fully-qualified path representing project_location_recommender resource. + * @returns {string} A string representing the recommender. + */ + matchRecommenderFromProjectLocationRecommenderName( + projectLocationRecommenderName: string + ) { + return this.pathTemplates.projectLocationRecommenderPathTemplate.match( + projectLocationRecommenderName + ).recommender; + } + + /** + * Return a fully-qualified projectLocationRecommenderRecommendation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} recommender + * @param {string} recommendation + * @returns {string} Resource name string. + */ + projectLocationRecommenderRecommendationPath( + project: string, + location: string, + recommender: string, + recommendation: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.render( + { + project: project, + location: location, + recommender: recommender, + recommendation: recommendation, + } + ); } /** - * Parse the location from Recommender resource. + * Parse the project from ProjectLocationRecommenderRecommendation resource. * - * @param {string} recommenderName - * A fully-qualified path representing Recommender resource. + * @param {string} projectLocationRecommenderRecommendationName + * A fully-qualified path representing project_location_recommender_recommendation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationRecommenderRecommendationName( + projectLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match( + projectLocationRecommenderRecommendationName + ).project; + } + + /** + * Parse the location from ProjectLocationRecommenderRecommendation resource. + * + * @param {string} projectLocationRecommenderRecommendationName + * A fully-qualified path representing project_location_recommender_recommendation resource. * @returns {string} A string representing the location. */ - matchLocationFromRecommenderName(recommenderName: string) { - return this.pathTemplates.recommenderPathTemplate.match(recommenderName) - .location; + matchLocationFromProjectLocationRecommenderRecommendationName( + projectLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match( + projectLocationRecommenderRecommendationName + ).location; } /** - * Parse the recommender from Recommender resource. + * Parse the recommender from ProjectLocationRecommenderRecommendation resource. * - * @param {string} recommenderName - * A fully-qualified path representing Recommender resource. + * @param {string} projectLocationRecommenderRecommendationName + * A fully-qualified path representing project_location_recommender_recommendation resource. * @returns {string} A string representing the recommender. */ - matchRecommenderFromRecommenderName(recommenderName: string) { - return this.pathTemplates.recommenderPathTemplate.match(recommenderName) - .recommender; + matchRecommenderFromProjectLocationRecommenderRecommendationName( + projectLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match( + projectLocationRecommenderRecommendationName + ).recommender; + } + + /** + * Parse the recommendation from ProjectLocationRecommenderRecommendation resource. + * + * @param {string} projectLocationRecommenderRecommendationName + * A fully-qualified path representing project_location_recommender_recommendation resource. + * @returns {string} A string representing the recommendation. + */ + matchRecommendationFromProjectLocationRecommenderRecommendationName( + projectLocationRecommenderRecommendationName: string + ) { + return this.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match( + projectLocationRecommenderRecommendationName + ).recommendation; } /** diff --git a/packages/google-cloud-recommender/synth.metadata b/packages/google-cloud-recommender/synth.metadata index 29a1541f45d..42be1cf521d 100644 --- a/packages/google-cloud-recommender/synth.metadata +++ b/packages/google-cloud-recommender/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-recommender.git", - "sha": "559e94ac98f3539b7e68d86f9dd575f8239a2081" + "sha": "e06347ac86941705801aad1e3c3b6b87092aa535" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" + "sha": "5256ab60f3d396a3d1bd393043776936b9651c5b", + "internalRef": "347703845" } }, { diff --git a/packages/google-cloud-recommender/test/gapic_recommender_v1.ts b/packages/google-cloud-recommender/test/gapic_recommender_v1.ts index 68135dfe6d4..c184a97509f 100644 --- a/packages/google-cloud-recommender/test/gapic_recommender_v1.ts +++ b/packages/google-cloud-recommender/test/gapic_recommender_v1.ts @@ -1490,10 +1490,85 @@ describe('v1.RecommenderClient', () => { }); describe('Path templates', () => { - describe('insight', () => { - const fakePath = '/rendered/path/insight'; + describe('billingAccountLocationInsightType', () => { + const fakePath = '/rendered/path/billingAccountLocationInsightType'; const expectedParameters = { - project: 'projectValue', + billing_account: 'billingAccountValue', + location: 'locationValue', + insight_type: 'insightTypeValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountLocationInsightTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountLocationInsightTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountLocationInsightTypePath', () => { + const result = client.billingAccountLocationInsightTypePath( + 'billingAccountValue', + 'locationValue', + 'insightTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.billingAccountLocationInsightTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountLocationInsightTypeName', () => { + const result = client.matchBillingAccountFromBillingAccountLocationInsightTypeName( + fakePath + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + (client.pathTemplates.billingAccountLocationInsightTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBillingAccountLocationInsightTypeName', () => { + const result = client.matchLocationFromBillingAccountLocationInsightTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.billingAccountLocationInsightTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInsightTypeFromBillingAccountLocationInsightTypeName', () => { + const result = client.matchInsightTypeFromBillingAccountLocationInsightTypeName( + fakePath + ); + assert.strictEqual(result, 'insightTypeValue'); + assert( + (client.pathTemplates.billingAccountLocationInsightTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('billingAccountLocationInsightTypeInsight', () => { + const fakePath = + '/rendered/path/billingAccountLocationInsightTypeInsight'; + const expectedParameters = { + billing_account: 'billingAccountValue', location: 'locationValue', insight_type: 'insightTypeValue', insight: 'insightValue', @@ -1503,71 +1578,258 @@ describe('v1.RecommenderClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.insightPathTemplate.render = sinon + client.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.insightPathTemplate.match = sinon + client.pathTemplates.billingAccountLocationInsightTypeInsightPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('insightPath', () => { - const result = client.insightPath( - 'projectValue', + it('billingAccountLocationInsightTypeInsightPath', () => { + const result = client.billingAccountLocationInsightTypeInsightPath( + 'billingAccountValue', 'locationValue', 'insightTypeValue', 'insightValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.insightPathTemplate.render as SinonStub) + (client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromInsightName', () => { - const result = client.matchProjectFromInsightName(fakePath); - assert.strictEqual(result, 'projectValue'); + it('matchBillingAccountFromBillingAccountLocationInsightTypeInsightName', () => { + const result = client.matchBillingAccountFromBillingAccountLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'billingAccountValue'); assert( - (client.pathTemplates.insightPathTemplate.match as SinonStub) + (client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromInsightName', () => { - const result = client.matchLocationFromInsightName(fakePath); + it('matchLocationFromBillingAccountLocationInsightTypeInsightName', () => { + const result = client.matchLocationFromBillingAccountLocationInsightTypeInsightName( + fakePath + ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.insightPathTemplate.match as SinonStub) + (client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchInsightTypeFromInsightName', () => { - const result = client.matchInsightTypeFromInsightName(fakePath); + it('matchInsightTypeFromBillingAccountLocationInsightTypeInsightName', () => { + const result = client.matchInsightTypeFromBillingAccountLocationInsightTypeInsightName( + fakePath + ); assert.strictEqual(result, 'insightTypeValue'); assert( - (client.pathTemplates.insightPathTemplate.match as SinonStub) + (client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchInsightFromInsightName', () => { - const result = client.matchInsightFromInsightName(fakePath); + it('matchInsightFromBillingAccountLocationInsightTypeInsightName', () => { + const result = client.matchInsightFromBillingAccountLocationInsightTypeInsightName( + fakePath + ); assert.strictEqual(result, 'insightValue'); assert( - (client.pathTemplates.insightPathTemplate.match as SinonStub) + (client.pathTemplates + .billingAccountLocationInsightTypeInsightPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('billingAccountLocationRecommender', () => { + const fakePath = '/rendered/path/billingAccountLocationRecommender'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + recommender: 'recommenderValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountLocationRecommenderPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountLocationRecommenderPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountLocationRecommenderPath', () => { + const result = client.billingAccountLocationRecommenderPath( + 'billingAccountValue', + 'locationValue', + 'recommenderValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.billingAccountLocationRecommenderPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountLocationRecommenderName', () => { + const result = client.matchBillingAccountFromBillingAccountLocationRecommenderName( + fakePath + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + (client.pathTemplates.billingAccountLocationRecommenderPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBillingAccountLocationRecommenderName', () => { + const result = client.matchLocationFromBillingAccountLocationRecommenderName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.billingAccountLocationRecommenderPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromBillingAccountLocationRecommenderName', () => { + const result = client.matchRecommenderFromBillingAccountLocationRecommenderName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + (client.pathTemplates.billingAccountLocationRecommenderPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('billingAccountLocationRecommenderRecommendation', () => { + const fakePath = + '/rendered/path/billingAccountLocationRecommenderRecommendation'; + const expectedParameters = { + billing_account: 'billingAccountValue', + location: 'locationValue', + recommender: 'recommenderValue', + recommendation: 'recommendationValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.billingAccountLocationRecommenderRecommendationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('billingAccountLocationRecommenderRecommendationPath', () => { + const result = client.billingAccountLocationRecommenderRecommendationPath( + 'billingAccountValue', + 'locationValue', + 'recommenderValue', + 'recommendationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchBillingAccountFromBillingAccountLocationRecommenderRecommendationName', () => { + const result = client.matchBillingAccountFromBillingAccountLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'billingAccountValue'); + assert( + (client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBillingAccountLocationRecommenderRecommendationName', () => { + const result = client.matchLocationFromBillingAccountLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromBillingAccountLocationRecommenderRecommendationName', () => { + const result = client.matchRecommenderFromBillingAccountLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + (client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommendationFromBillingAccountLocationRecommenderRecommendationName', () => { + const result = client.matchRecommendationFromBillingAccountLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommendationValue'); + assert( + (client.pathTemplates + .billingAccountLocationRecommenderRecommendationPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); }); - describe('insightType', () => { - const fakePath = '/rendered/path/insightType'; + describe('projectLocationInsightType', () => { + const fakePath = '/rendered/path/projectLocationInsightType'; const expectedParameters = { project: 'projectValue', location: 'locationValue', @@ -1578,138 +1840,159 @@ describe('v1.RecommenderClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.insightTypePathTemplate.render = sinon + client.pathTemplates.projectLocationInsightTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.insightTypePathTemplate.match = sinon + client.pathTemplates.projectLocationInsightTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('insightTypePath', () => { - const result = client.insightTypePath( + it('projectLocationInsightTypePath', () => { + const result = client.projectLocationInsightTypePath( 'projectValue', 'locationValue', 'insightTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.insightTypePathTemplate.render as SinonStub) + (client.pathTemplates.projectLocationInsightTypePathTemplate + .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromInsightTypeName', () => { - const result = client.matchProjectFromInsightTypeName(fakePath); + it('matchProjectFromProjectLocationInsightTypeName', () => { + const result = client.matchProjectFromProjectLocationInsightTypeName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.insightTypePathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationInsightTypePathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromInsightTypeName', () => { - const result = client.matchLocationFromInsightTypeName(fakePath); + it('matchLocationFromProjectLocationInsightTypeName', () => { + const result = client.matchLocationFromProjectLocationInsightTypeName( + fakePath + ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.insightTypePathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationInsightTypePathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchInsightTypeFromInsightTypeName', () => { - const result = client.matchInsightTypeFromInsightTypeName(fakePath); + it('matchInsightTypeFromProjectLocationInsightTypeName', () => { + const result = client.matchInsightTypeFromProjectLocationInsightTypeName( + fakePath + ); assert.strictEqual(result, 'insightTypeValue'); assert( - (client.pathTemplates.insightTypePathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationInsightTypePathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); }); - describe('recommendation', () => { - const fakePath = '/rendered/path/recommendation'; + describe('projectLocationInsightTypeInsight', () => { + const fakePath = '/rendered/path/projectLocationInsightTypeInsight'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - recommender: 'recommenderValue', - recommendation: 'recommendationValue', + insight_type: 'insightTypeValue', + insight: 'insightValue', }; const client = new recommenderModule.v1.RecommenderClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.recommendationPathTemplate.render = sinon + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.recommendationPathTemplate.match = sinon + client.pathTemplates.projectLocationInsightTypeInsightPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('recommendationPath', () => { - const result = client.recommendationPath( + it('projectLocationInsightTypeInsightPath', () => { + const result = client.projectLocationInsightTypeInsightPath( 'projectValue', 'locationValue', - 'recommenderValue', - 'recommendationValue' + 'insightTypeValue', + 'insightValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.recommendationPathTemplate.render as SinonStub) + (client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromRecommendationName', () => { - const result = client.matchProjectFromRecommendationName(fakePath); + it('matchProjectFromProjectLocationInsightTypeInsightName', () => { + const result = client.matchProjectFromProjectLocationInsightTypeInsightName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.recommendationPathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromRecommendationName', () => { - const result = client.matchLocationFromRecommendationName(fakePath); + it('matchLocationFromProjectLocationInsightTypeInsightName', () => { + const result = client.matchLocationFromProjectLocationInsightTypeInsightName( + fakePath + ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.recommendationPathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchRecommenderFromRecommendationName', () => { - const result = client.matchRecommenderFromRecommendationName(fakePath); - assert.strictEqual(result, 'recommenderValue'); + it('matchInsightTypeFromProjectLocationInsightTypeInsightName', () => { + const result = client.matchInsightTypeFromProjectLocationInsightTypeInsightName( + fakePath + ); + assert.strictEqual(result, 'insightTypeValue'); assert( - (client.pathTemplates.recommendationPathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchRecommendationFromRecommendationName', () => { - const result = client.matchRecommendationFromRecommendationName( + it('matchInsightFromProjectLocationInsightTypeInsightName', () => { + const result = client.matchInsightFromProjectLocationInsightTypeInsightName( fakePath ); - assert.strictEqual(result, 'recommendationValue'); + assert.strictEqual(result, 'insightValue'); assert( - (client.pathTemplates.recommendationPathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationInsightTypeInsightPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); }); - describe('recommender', () => { - const fakePath = '/rendered/path/recommender'; + describe('projectLocationRecommender', () => { + const fakePath = '/rendered/path/projectLocationRecommender'; const expectedParameters = { project: 'projectValue', location: 'locationValue', @@ -1720,52 +2003,157 @@ describe('v1.RecommenderClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.recommenderPathTemplate.render = sinon + client.pathTemplates.projectLocationRecommenderPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.recommenderPathTemplate.match = sinon + client.pathTemplates.projectLocationRecommenderPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('recommenderPath', () => { - const result = client.recommenderPath( + it('projectLocationRecommenderPath', () => { + const result = client.projectLocationRecommenderPath( 'projectValue', 'locationValue', 'recommenderValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.recommenderPathTemplate.render as SinonStub) + (client.pathTemplates.projectLocationRecommenderPathTemplate + .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromRecommenderName', () => { - const result = client.matchProjectFromRecommenderName(fakePath); + it('matchProjectFromProjectLocationRecommenderName', () => { + const result = client.matchProjectFromProjectLocationRecommenderName( + fakePath + ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.recommenderPathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationRecommenderPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromRecommenderName', () => { - const result = client.matchLocationFromRecommenderName(fakePath); + it('matchLocationFromProjectLocationRecommenderName', () => { + const result = client.matchLocationFromProjectLocationRecommenderName( + fakePath + ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.recommenderPathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationRecommenderPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchRecommenderFromRecommenderName', () => { - const result = client.matchRecommenderFromRecommenderName(fakePath); + it('matchRecommenderFromProjectLocationRecommenderName', () => { + const result = client.matchRecommenderFromProjectLocationRecommenderName( + fakePath + ); assert.strictEqual(result, 'recommenderValue'); assert( - (client.pathTemplates.recommenderPathTemplate.match as SinonStub) + (client.pathTemplates.projectLocationRecommenderPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationRecommenderRecommendation', () => { + const fakePath = + '/rendered/path/projectLocationRecommenderRecommendation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + recommender: 'recommenderValue', + recommendation: 'recommendationValue', + }; + const client = new recommenderModule.v1.RecommenderClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationRecommenderRecommendationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationRecommenderRecommendationPath', () => { + const result = client.projectLocationRecommenderRecommendationPath( + 'projectValue', + 'locationValue', + 'recommenderValue', + 'recommendationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationRecommenderRecommendationName', () => { + const result = client.matchProjectFromProjectLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationRecommenderRecommendationName', () => { + const result = client.matchLocationFromProjectLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommenderFromProjectLocationRecommenderRecommendationName', () => { + const result = client.matchRecommenderFromProjectLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommenderValue'); + assert( + (client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRecommendationFromProjectLocationRecommenderRecommendationName', () => { + const result = client.matchRecommendationFromProjectLocationRecommenderRecommendationName( + fakePath + ); + assert.strictEqual(result, 'recommendationValue'); + assert( + (client.pathTemplates + .projectLocationRecommenderRecommendationPathTemplate + .match as SinonStub) .getCall(-1) .calledWith(fakePath) );