import json
from typing import Any


class Token:

    extra_fields: dict[str, Any]

    def __init__(
        self,
        token: str = "",
        expires_utc: str = "",
        **kwargs: Any
    ):
        self.token = token
        self.expires_utc = expires_utc

        camel_to_snake = {
            "expiresUtc": "expires_utc",
        }

        for camel_key, snake_key in camel_to_snake.items():
            if camel_key in kwargs:
                setattr(self, snake_key, kwargs.pop(camel_key))

        self.extra_fields = kwargs

        if kwargs:
            print(f"Extra fields: {kwargs}")

    def to_dict(self):
        return {
            "token": self.token,
            "expiresUtc": self.expires_utc,
        }

    def to_json(self):
        return json.dumps(self.to_dict())