From 368157203923ab7090b2cc2181e547fdd6ac63f5 Mon Sep 17 00:00:00 2001 From: Dan Dye Date: Thu, 22 Aug 2024 12:07:29 -0700 Subject: [PATCH] Data RBAC requires scope_info eq None. PiperOrigin-RevId: 666441142 --- lists/v1alpha/patch_list.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lists/v1alpha/patch_list.py b/lists/v1alpha/patch_list.py index 3515f76..01416e4 100644 --- a/lists/v1alpha/patch_list.py +++ b/lists/v1alpha/patch_list.py @@ -122,17 +122,17 @@ def patch_list( parent = f"projects/{proj_id}/locations/{proj_region}/instances/{proj_instance}" url = f"{base_url_with_region}/v1alpha/{parent}/referenceLists/{name}" body = { - "name": name, - "entries": [{"value": line.strip()} for line in content_lines] + "entries": [{"value": line.strip()} for line in content_lines], + "scope_info": None, # assumes Data RBAC is disabled } if description: body["description"] = description if syntax_type: body["syntax_type"] = syntax_type + params = {"updateMask": ",".join(body.keys())} + body["name"] = name - # omit the updateMask query string param: - # "When no field mask is supplied, all non-empty fields will be updated." - response = http_session.request("PATCH", url, json=body) + response = http_session.request("PATCH", url, params=params, json=body) if response.status_code >= 400: print(response.text) response.raise_for_status()