Have you considered Ansible by chance? Check Point has modules for the set/show/delete application-site APIs:
https://docs.ansible.com/ansible/latest/collections/check_point/mgmt/cp_mgmt_application_site_module...
With this, you can specify that attribute as part of the request. Ansible will handle your login session and you get a consistent interface.
---
- name: Manage application sites
hosts: mgmt_server
connection: httpapi
gather_facts: false
become: false
vars:
ansible_api_key: MGMT_API_KEY
ansible_network_os: check_point.mgmt.checkpoint
block_list:
name: Sample_Blocklist
primary_category: High Risk
url_list:
add:
- '\/site.com'
- '\.site\.com'
remove:
- dummy
tasks:
- name: Get application site info
check_point.mgmt.cp_mgmt_application_site:
name: app_site_facts
- name: Update application sites
check_point.mgmt.cp_mgmt_application_site:
name: "{{ block_list.name }}"
primary_category: "{{ block_list.primary_category }}"
url_list: "{{ (app_site_facts['ansible_facts']['application_site']['url_list'] |list) + block_list.url_list.add | difference(block_list.url_list.remove) }}"
urls_defined_as_regular_expression: true
...
(Untested, but should be close)
The idea is to "model" the object you want then work with the model. It pays enormous dividends, tho.