{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from api import BigApi\n",
    "\n",
    "BigApi.init(\".admin.ocean.env\")\n",
    "BigApi.adminLogin()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "bigOrderId = \"\"\n",
    "\n",
    "data = BigApi.adminPut(f\"/admin/shop/order/{bigOrderId}\", {\"action\": \"AdminOverrideIPD\", \"ipd\": 67})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "scanRequestId = \"\"\n",
    "data = BigApi.adminPut(f\"/admin/fabricator/scan_request/{scanRequestId}\", {\"scanRequestState\": \"ReadyForFabricator\"})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = BigApi.adminGet(\"/admin/inventory/sync\")\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = BigApi.adminGet(\"/admin/inventory/report\")\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "accountId = \"ACCOUNT_ID_HERE\"\n",
    "username_who_should_be_blocked = \"whatever\"\n",
    "cursorId = None\n",
    "while True:\n",
    "    url = f\"/admin/account/{accountId}/social/graph/blocked?limit=1000\"\n",
    "    if cursorId != None:\n",
    "        url += f\"&cursorId={cursorId}\"\n",
    "    data = BigApi.cloudGet(url)\n",
    "    print(len(data[\"items\"]))\n",
    "    for v in data[\"items\"]:\n",
    "        if \"targetSocialProfileSnapshot\" in v:\n",
    "            if v[\"targetSocialProfileSnapshot\"][\"username\"] == username_who_should_be_blocked:\n",
    "                print(v)\n",
    "    if \"cursorId\" in data:\n",
    "        cursorId = data[\"cursorId\"]\n",
    "    else:\n",
    "        break"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
