converted two old examples to use search_stream - #253
Conversation
| f'payments_account_name "{payments_account_info.payments_account_name.value}", ' | ||
| f'payments_profile_id {payments_account_info.payments_profile_id.value}, ' | ||
| f'payments_profile_name "{payments_account_info.payments_profile_name.value}", ' | ||
| f'secondary_payments_profile_id "{payments_account_info.secondary_payments_profile_id.value}".') |
There was a problem hiding this comment.
Nit: this is a little tough to read, would it be worth setting some of these values to variables above the print statement so that the printed string is a easier to parse visually?
There was a problem hiding this comment.
Used a shorter prefix variable name. Looking forward to getting rid of .value
| @@ -1,5 +1,5 @@ | |||
| #!/usr/bin/env python | |||
| # Copyright 2018 Google LLC | |||
| # Copyright 2020 Google LLC | |||
There was a problem hiding this comment.
No, we don't change copy right for the existing examples.
| print(f'Billing setup with ID {billing_setup.id.value}, ' | ||
| f'status "{billing_setup_status_enum.Name(billing_setup.status)}", ' | ||
| f'payments_account "{billing_setup.payments_account.value}" ' | ||
| f'payments_account_id "{pai.payments_account_id.value}", ' |
There was a problem hiding this comment.
ID doesn't need quotes. Same for secondary_payments_profile_id below.
There was a problem hiding this comment.
Note that if secondary_payments_profile_id is empty (as it is in my case), the result is just a blank space.
| if pai.secondary_payments_profile_id.value: | ||
| secondary_payments_profile_id = pai.secondary_payments_profile_id.value | ||
| else: | ||
| secondary_payments_profile_id = "None" |
There was a problem hiding this comment.
Can't this be just:
secondary_payments_profile_id = (pai.secondary_payments_profile_id.value
if pai.secondary_payments_profile_id.value
else "None")?
There was a problem hiding this comment.
It can be, but I'm not a big fan of that syntax as it hides intentionality somewhat. Since the rest of this example does not use it, I didn't want to introduce it.
As part of doc update to streaming, moving over two old examples to streaming