Skip to content

Commit a17e8db

Browse files
Chronicle Teamcopybara-github
authored andcommitted
Updates input format in the UpdateSubject RPC in the sample Python script
PiperOrigin-RevId: 410917742
1 parent 7549f5e commit a17e8db

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

access_control/update_subject.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,16 @@ def update_subject(http_session: requests.AuthorizedSession, name: str,
9999
(response.status_code >= 400).
100100
"""
101101
url = f"{CHRONICLE_API_BASE_URL}/v1/subjects/{name}"
102+
103+
roles_json = []
104+
for role in roles:
105+
roles_json += {
106+
"name": role,
107+
},
108+
102109
body = {
103110
"name": name,
104-
"roles": roles,
111+
"roles": roles_json,
105112
}
106113
update_fields = ["subject.roles"]
107114
params = {"update_mask": ",".join(update_fields)}

0 commit comments

Comments
 (0)