from utils import apikeys
import requests

# JSON Payload for SCORM file
baseurl = "https://api.northpass.com"

# Migration Sandbox Items
# projectid = "f33ce6c1-65cf-48a2-96c8-825beee2ff88"
# activityId = "49ebb402-39ed-4aeb-8ed4-801cd0c09fd1"
# course_uuid = "07b97dea-ca66-4a9c-ae32-ebf3aa7205c2"

# Norm's Sandbox Items:
course_uuid = "1de95b11-f2b6-473c-9637-4a6b5f9f98be"
project_uuid = "a1a36fbf-f11e-40c7-add4-89a0ae7bf76c"
item_uuid = "3bec2531-705a-47c1-a1b6-5c68ec955698"
scorm_uuid = "a030164d-00b1-430c-8f41-211416d573e2"
section_uuid = "b6414605-9d43-4f27-9f85-bccd5928bafb"

apikey = apikeys.NORMSANDBOX
endpoint = f"{baseurl}/v2/migration/projects/{project_uuid}/items/{item_uuid}/activity_resources"
headers = { "X-Api-Key": apikey, "content-type": "application/json" }
payload = {
    "data": [
        {
            "type": "activity_resource",
            "attributes": {
                "uuid": "6aeea279-e70e-40b8-98a0-776fa93779d8",
                "display_name": "SCORM File 38",
                "data": {
                    "name": "Introduction to Agile SCORM",
                    "type": "activities/scorm_sco",
                    "course_id": course_uuid,
                    "section_id": section_uuid,
                    "activity_attributes": {
                        "upload_id": scorm_uuid,
                        "description": "Explore Agile as a concept and why it's effective in today's project environments. SCORM file",
                        "body": scorm_uuid,
                        "position": 2
                    },
                },
            },
        }
    ]
}

post_load = requests.post(endpoint, headers=headers, json=payload)
print(post_load.text)
print(post_load.status_code)
