# FinanceGPT generated client starter
# Source: FinanceGPT API v2 OpenAPI index
# OpenAPI SHA-256: 228f3cf999f801d03634f0dad1fc6d296671bc13a8cf0d80994b00a57b62f910
# Operations: post-investment-collateral-xva-netting-sets
# Credential: FINANCEGPT_API_KEY environment variable; no credential is embedded.
# Authority: API identity and generated code do not create model-promotion, QLM-binding or Financial Actions authority.

if not __import__('os').environ.get('FINANCEGPT_API_KEY'):
    raise RuntimeError('FINANCEGPT_API_KEY is required')

# Record an evidence-backed netting set | scope: investment:run
import json
import os
import requests

response = requests.request(
    'POST',
    'https://financegpt.dev/api/v2/investment/collateral-xva/netting-sets',
    headers={
        'Authorization': 'Bearer ' + os.environ['FINANCEGPT_API_KEY'],
        'Accept': 'application/json',
    },
    json=json.loads('{"name":"string","counterparty_id":1,"agreement_type":"bilateral","currency":"string","threshold_minor":0,"minimum_transfer_minor":0,"independent_amount_minor":0,"amount_scale":2,"source_reference":"string","source_hash":"string"}'),
)
response.raise_for_status()
print(response.json())
