from dataclasses import dataclass
from typing import Any, NotRequired, TypedDict

import requests


def append_tag(tag: str, tags: list[str] = []):
    tags.append(tag)
    return tags


@dataclass
class JobOptions:
    user_ids: list[str] = []
    metadata: dict[str, str] = {}
    is_dry_run: bool = False
    allow_partial: bool = False
    priority: int | None = None
    region: str | None = None

    def __post_init__(self):
        self.profile = requests.get("https://example.com/config")


class PayloadShape(TypedDict):
    name: str
    alias: NotRequired[str]


def render_payload(payload: PayloadShape, extras: dict[str, Any]) -> Any:
    alias = payload["alias"]
    return {"alias": alias, "extras": extras}