Skip to content

Commit 1773b80

Browse files
authored
Update link_manager_to_client example (#676)
1 parent 3c59584 commit 1773b80

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

examples/account_management/link_manager_to_client.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# limitations under the License.
1515
"""This example shows how to link a manager customer to a client customer."""
1616

17-
1817
import argparse
18+
import sys
1919

2020
from google.api_core import protobuf_helpers
2121

@@ -85,12 +85,8 @@ def main(client, customer_id, manager_customer_id):
8585
)
8686
manager_link_operation = client.get_type("CustomerManagerLinkOperation")
8787
manager_link = manager_link_operation.update
88-
manager_link.resource_name = (
89-
customer_manager_link_service.customer_manager_link_path(
90-
customer_id,
91-
manager_customer_id,
92-
manager_link_id,
93-
)
88+
manager_link.resource_name = customer_manager_link_service.customer_manager_link_path(
89+
customer_id, manager_customer_id, manager_link_id,
9490
)
9591

9692
manager_link.status = client.enums.ManagerLinkStatusEnum.ACTIVE
@@ -100,7 +96,7 @@ def main(client, customer_id, manager_customer_id):
10096
)
10197

10298
response = customer_manager_link_service.mutate_customer_manager_link(
103-
customer_id=manager_customer_id, operations=[manager_link_operation]
99+
customer_id=customer_id, operations=[manager_link_operation]
104100
)
105101
print(
106102
"Client accepted invitation with resource_name: "
@@ -136,10 +132,10 @@ def main(client, customer_id, manager_customer_id):
136132
main(googleads_client, args.customer_id, args.manager_customer_id)
137133
except GoogleAdsException as ex:
138134
print(
139-
f'Request with ID "{exception.request_id}" failed with status '
140-
f'"{exception.error.code().name}" and includes the following errors:'
135+
f'Request with ID "{ex.request_id}" failed with status '
136+
f'"{ex.error.code().name}" and includes the following errors:'
141137
)
142-
for error in exception.failure.errors:
138+
for error in ex.failure.errors:
143139
print(f'\tError with message "{error.message}".')
144140
if error.location:
145141
for field_path_element in error.location.field_path_elements:

0 commit comments

Comments
 (0)