Create sample for list recommendations

PiperOrigin-RevId: 282665402
This commit is contained in:
Google APIs 2019-11-26 16:49:30 -08:00 committed by Copybara-Service
parent f88e2ca657
commit 2cc56cb83e
2 changed files with 19 additions and 0 deletions

View File

@ -8,6 +8,7 @@ common:
- .
service_yaml: recommender_v1beta1.yaml
gapic_yaml: recommender_gapic.yaml
samples: samples
artifacts:
- name: gapic_config
type: GAPIC_CONFIG

View File

@ -0,0 +1,18 @@
type: com.google.api.codegen.samplegen.v1p2.SampleConfigProto
schema_version: 1.2.0
samples:
- title: List Recommendations
service: google.cloud.recommender.v1beta1.Recommender
description: |
List recommendations for a specified project, location, and recommender.
rpc: ListRecommendations
request:
- field: parent
value: "projects/[PROJECT_NUMBER]/locations/[LOCATION]/recommenders/[RECOMMENDER]"
response:
- define: recommendation = $resp
- print: ["Recommendation name: %s", recommendation.name]
- print: ["- description: %s", recommendation.description]
- print: ["- primary_impact.category: %s", recommendation.primary_impact.category]
- print: ["- state_info.state: %s", recommendation.state_info.state]
- print: ["- last_refresh_time: %s", recommendation.last_refresh_time]