Skip to content

Commit d847461

Browse files
dandyecopybara-github
authored andcommitted
Data RBAC requires scope_info eq None.
PiperOrigin-RevId: 666766219
1 parent 40aaa3c commit d847461

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

lists/v1alpha/patch_list.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,17 @@ def patch_list(
122122
parent = f"projects/{proj_id}/locations/{proj_region}/instances/{proj_instance}"
123123
url = f"{base_url_with_region}/v1alpha/{parent}/referenceLists/{name}"
124124
body = {
125-
"name": name,
126-
"entries": [{"value": line.strip()} for line in content_lines]
125+
"entries": [{"value": line.strip()} for line in content_lines],
126+
"scope_info": None, # assumes Data RBAC is disabled
127127
}
128128
if description:
129129
body["description"] = description
130130
if syntax_type:
131131
body["syntax_type"] = syntax_type
132+
params = {"updateMask": ",".join(body.keys())}
133+
body["name"] = name
132134

133-
# omit the updateMask query string param:
134-
# "When no field mask is supplied, all non-empty fields will be updated."
135-
response = http_session.request("PATCH", url, json=body)
135+
response = http_session.request("PATCH", url, params=params, json=body)
136136
if response.status_code >= 400:
137137
print(response.text)
138138
response.raise_for_status()

0 commit comments

Comments
 (0)