11# -*- coding: utf-8 -*-
22#
3- # Copyright 2019 Google LLC
3+ # Copyright 2020 Google LLC
44#
55# Licensed under the Apache License, Version 2.0 (the "License");
66# you may not use this file except in compliance with the License.
@@ -81,12 +81,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8181
8282 @classmethod
8383 def recommendation_path (cls , project , location , recommender , recommendation ):
84- """DEPRECATED. Return a fully-qualified recommendation string."""
85- warnings .warn (
86- "Resource name helper functions are deprecated." ,
87- PendingDeprecationWarning ,
88- stacklevel = 1 ,
89- )
84+ """Return a fully-qualified recommendation string."""
9085 return google .api_core .path_template .expand (
9186 "projects/{project}/locations/{location}/recommenders/{recommender}/recommendations/{recommendation}" ,
9287 project = project ,
@@ -97,12 +92,7 @@ def recommendation_path(cls, project, location, recommender, recommendation):
9792
9893 @classmethod
9994 def recommender_path (cls , project , location , recommender ):
100- """DEPRECATED. Return a fully-qualified recommender string."""
101- warnings .warn (
102- "Resource name helper functions are deprecated." ,
103- PendingDeprecationWarning ,
104- stacklevel = 1 ,
105- )
95+ """Return a fully-qualified recommender string."""
10696 return google .api_core .path_template .expand (
10797 "projects/{project}/locations/{location}/recommenders/{recommender}" ,
10898 project = project ,
@@ -234,7 +224,7 @@ def list_recommendations(
234224 ):
235225 """
236226 Lists recommendations for a Cloud project. Requires the
237- recommender.*.list IAM permission for the specified recommender.
227+ recommender.\ *.list IAM permission for the specified recommender.
238228
239229 Example:
240230 >>> from google.cloud import recommender_v1
@@ -263,7 +253,7 @@ def list_recommendations(
263253
264254 1.
265255
266- "projects/[PROJECT_NUMBER ]/locations/[LOCATION]/recommenders/[RECOMMENDER_ID ]",
256+ "projects/[PROJECT\_NUMBER ]/locations/[LOCATION]/recommenders/[RECOMMENDER\_ID ]",
267257
268258 LOCATION here refers to GCP Locations:
269259 https://cloud.google.com/about/locations/
@@ -272,9 +262,9 @@ def list_recommendations(
272262 resource, this parameter does not affect the return value. If page
273263 streaming is performed per-page, this determines the maximum number
274264 of resources in a page.
275- filter_ (str): Filter expression to restrict the recommendations returned.
276- Supported filter fields: state_info .state Eg:
277- \`state_info. state:"DISMISSED" or state_info .state:"FAILED"
265+ filter_ (str): Filter expression to restrict the recommendations returned. Supported
266+ filter fields: state\_info .state Eg: \`state\_info.state:"DISMISSED" or
267+ state\_info .state:"FAILED"
278268 retry (Optional[google.api_core.retry.Retry]): A retry object used
279269 to retry requests. If ``None`` is specified, requests will
280270 be retried using a default configuration.
@@ -347,8 +337,8 @@ def get_recommendation(
347337 metadata = None ,
348338 ):
349339 """
350- Gets the requested recommendation. Requires the recommender.*.get
351- IAM permission for the specified recommender.
340+ Gets the requested recommendation. Requires the recommender.\ *.get IAM
341+ permission for the specified recommender.
352342
353343 Example:
354344 >>> from google.cloud import recommender_v1
@@ -419,15 +409,15 @@ def mark_recommendation_claimed(
419409 metadata = None ,
420410 ):
421411 """
422- Mark the Recommendation State as Claimed. Users can use this method
423- to indicate to the Recommender API that they are starting to apply the
412+ Mark the Recommendation State as Claimed. Users can use this method to
413+ indicate to the Recommender API that they are starting to apply the
424414 recommendation themselves. This stops the recommendation content from
425415 being updated.
426416
427417 MarkRecommendationClaimed can be applied to recommendations in CLAIMED,
428418 SUCCEEDED, FAILED, or ACTIVE state.
429419
430- Requires the recommender.*.update IAM permission for the specified
420+ Requires the recommender.\ *.update IAM permission for the specified
431421 recommender.
432422
433423 Example:
@@ -447,8 +437,8 @@ def mark_recommendation_claimed(
447437 etag (str): Required. Fingerprint of the Recommendation. Provides optimistic locking.
448438 state_metadata (dict[str -> str]): State properties to include with this state. Overwrites any existing
449439 ``state_metadata``. Keys must match the regex
450- ``/^[a-z0-9][a-z0-9_ .-]{0,62}$/``. Values must match the regex
451- ``/^[a-zA-Z0-9_ ./-]{0,255}$/``.
440+ ``/^[a-z0-9][a-z0-9\_ .-]{0,62}$/``. Values must match the regex
441+ ``/^[a-zA-Z0-9\_ ./-]{0,255}$/``.
452442 retry (Optional[google.api_core.retry.Retry]): A retry object used
453443 to retry requests. If ``None`` is specified, requests will
454444 be retried using a default configuration.
@@ -511,15 +501,15 @@ def mark_recommendation_succeeded(
511501 metadata = None ,
512502 ):
513503 """
514- Mark the Recommendation State as Succeeded. Users can use this
515- method to indicate to the Recommender API that they have applied the
504+ Mark the Recommendation State as Succeeded. Users can use this method to
505+ indicate to the Recommender API that they have applied the
516506 recommendation themselves, and the operation was successful. This stops
517507 the recommendation content from being updated.
518508
519509 MarkRecommendationSucceeded can be applied to recommendations in ACTIVE,
520510 CLAIMED, SUCCEEDED, or FAILED state.
521511
522- Requires the recommender.*.update IAM permission for the specified
512+ Requires the recommender.\ *.update IAM permission for the specified
523513 recommender.
524514
525515 Example:
@@ -539,8 +529,8 @@ def mark_recommendation_succeeded(
539529 etag (str): Required. Fingerprint of the Recommendation. Provides optimistic locking.
540530 state_metadata (dict[str -> str]): State properties to include with this state. Overwrites any existing
541531 ``state_metadata``. Keys must match the regex
542- ``/^[a-z0-9][a-z0-9_ .-]{0,62}$/``. Values must match the regex
543- ``/^[a-zA-Z0-9_ ./-]{0,255}$/``.
532+ ``/^[a-z0-9][a-z0-9\_ .-]{0,62}$/``. Values must match the regex
533+ ``/^[a-zA-Z0-9\_ ./-]{0,255}$/``.
544534 retry (Optional[google.api_core.retry.Retry]): A retry object used
545535 to retry requests. If ``None`` is specified, requests will
546536 be retried using a default configuration.
@@ -603,15 +593,15 @@ def mark_recommendation_failed(
603593 metadata = None ,
604594 ):
605595 """
606- Mark the Recommendation State as Failed. Users can use this method
607- to indicate to the Recommender API that they have applied the
596+ Mark the Recommendation State as Failed. Users can use this method to
597+ indicate to the Recommender API that they have applied the
608598 recommendation themselves, and the operation failed. This stops the
609599 recommendation content from being updated.
610600
611601 MarkRecommendationFailed can be applied to recommendations in ACTIVE,
612602 CLAIMED, SUCCEEDED, or FAILED state.
613603
614- Requires the recommender.*.update IAM permission for the specified
604+ Requires the recommender.\ *.update IAM permission for the specified
615605 recommender.
616606
617607 Example:
@@ -631,8 +621,8 @@ def mark_recommendation_failed(
631621 etag (str): Required. Fingerprint of the Recommendation. Provides optimistic locking.
632622 state_metadata (dict[str -> str]): State properties to include with this state. Overwrites any existing
633623 ``state_metadata``. Keys must match the regex
634- ``/^[a-z0-9][a-z0-9_ .-]{0,62}$/``. Values must match the regex
635- ``/^[a-zA-Z0-9_ ./-]{0,255}$/``.
624+ ``/^[a-z0-9][a-z0-9\_ .-]{0,62}$/``. Values must match the regex
625+ ``/^[a-zA-Z0-9\_ ./-]{0,255}$/``.
636626 retry (Optional[google.api_core.retry.Retry]): A retry object used
637627 to retry requests. If ``None`` is specified, requests will
638628 be retried using a default configuration.
0 commit comments