Skip to content

Commit 4c2560c

Browse files
authored
Fix dismiss_recommendation_example. (#611)
1 parent 8d18441 commit 4c2560c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/recommendations/dismiss_recommendation.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,16 @@
2626

2727

2828
def main(client, customer_id, recommendation_id):
29-
rec_service = client.get_service("RecommendationService")
30-
operation = client.get_type("DismissRecommendationOperation")
29+
recommendation_service = client.get_service("RecommendationService")
30+
request = client.get_type("DismissRecommendationRequest")
31+
operation = request.DismissRecommendationOperation()
3132
operation.resource_name = recommendation_service.recommendation_path(
3233
customer_id, recommendation_id
3334
)
35+
request.customer_id = customer_id
36+
request.operations.append(operation)
3437

35-
response = rec_service.dismiss_recommendation(
36-
customer_id=customer_id, operations=[operation]
37-
)
38+
response = recommendation_service.dismiss_recommendation(request=request)
3839

3940
print(
4041
"Dismissed recommendation with resource name: "

0 commit comments

Comments
 (0)