import requests
import sys
import Apikeys

APIKEY = Apikeys.NORMSANDBOX
BASEURL = "https://api.northpass.com/v2/people/"

HEADERS = {
    "accept": "application/json",
    "X-Api-Key": APIKEY
}

def people():
    count = 0
    url = f"https://api.northpass.com/v2/people?page={count}"
    count += 1
    response = requests.get(url, header=HEADERS)
    respon = response.json()['data']

    person_uuid = respon['id']
    person_status = respon['attributes']['registration_status']
    person_tuple = (person_uuid, person_status, '')

    propurl = "https://api.northpass.com/v2/properties/people"
    prop_payload = { }

def people_role():
    if len(sys.argv) != 2:
        print(f"Usage: python {sys.argv[0]} <parameter>")
        sys.exit(1)

    parameter = sys.argv[1]
    print(f"Parameter received: {parameter}")
    url = f"{BASEURL}?filter[email][eq]={parameter}&filter[partnerships_type][eq]=Partnerships::Admin"
    getpart = requests.get(url, headers=HEADERS)
    print(getpart.text)
    print(getpart.status_code)

if __name__ == "__main__":
    people_role()
