:py:mod:`masterblaster` ======================= .. py:module:: masterblaster Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 gameaccount/index.rst headers/index.rst image/index.rst masterblaster/index.rst member/index.rst player/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: masterblaster.Header masterblaster.MasterBlaster masterblaster.Member masterblaster.Image masterblaster.GameAccount masterblaster.Player .. py:class:: Header Bases: :py:obj:`collections.abc.MutableMapping` Wrapper for http header-fields :ivar fields: The header fields .. py:method:: add(name: str, value: str) -> Header Add a header field :param name: The name of the header field :type name: str :param value: The value of the header field :type value: str :returns: The header object :rtype: Header .. py:method:: remove(name: str) -> Header Remove a header field :param name: The name of the header field :type name: str :returns: The header object :rtype: Header .. py:class:: MasterBlaster(access_token: Optional[str], org_name: str) MasterBlaster is the main class for interacting with the MasterBlaster API :param access_token: The access token for the organization :param org_name: The name of the organization :ivar id: The id of the organization :ivar name: The name of the organization :ivar is_admin: Whether or not the current token is an admin for the organization :ivar access_token: The access token for the organization :ivar members: A list of all members in the organization :ivar images: A list of all images in the organization :ivar headers: The headers used for the session .. py:method:: teardown() -> None :async: Close the session :param None: :rtype: None .. py:method:: create(access_token: str, org_name: str) -> MasterBlaster :classmethod: :async: Create a new fully setup MasterBlaster instance :param access_token: The access token for the organization :type access_token: str :param org_name: The name of the organization :type org_name: str :rtype: MasterBlaster .. py:method:: get_org(org_id: str) -> dict[str, str | dict] :async: Returns the organization for the given organization id :param org_id (str): :type org_id (str): The organization id :returns: Information about the organization :rtype: json .. py:method:: get_all_orgs() -> list[dict[str, Any]] :async: Returns all organizations related to the current token :param None: :returns: Short information about all organizations related to current token :rtype: json .. py:method:: change_org(org_name: str) -> None :async: Change the organization Will re-initialize the organization: id, members, and images :param org_name: Name of the organization to change to :type org_name: str :rtype: None .. py:method:: get_members() -> list[masterblaster.member.Member] :async: Returns all members of the organization :param None: :returns: **members** -- A list of all members in the organization :rtype: List[Member] .. py:method:: get_images() -> list[masterblaster.image.Image] :async: Returns images of the organization :param None: :returns: **images** -- A list of all images in the organization :rtype: list[Image] .. py:class:: Member(player: dict, email: str, name: str, playerId: str, role: int, addedAt: str, invitedAt) Class for organization members :param player: The player object :param email: The member email :param name: The member name :param playerId: The player id :param role: The member role :param addedAt: When the member was added :param invitedAt: When the member was invited :ivar player: The member's related player object :ivar email: The member's email-address :ivar name: The member's name :ivar player_id: The member's player id :ivar role: The member's role :ivar added_at: When the member was added :ivar invited_at: When the member was invited .. py:class:: Image(imageType: int, imageId: str, originalImageId: str) MasterBlaster Image Object :param imageType: The type of image :param imageId: The id of the image :param originalImageId: The id of the original image :ivar type: The type of image :ivar id: The id of the image :ivar original_id: The id of the original image .. py:class:: GameAccount(id: str, nick: str, avatarUrl: str, gameId: str, isConnected: bool, connectedAt) Class for GameAccount objects, related to one player Supported games: ["Counter-Strike", "Rocket League", "Chess"] :param id: The gameaccount id :param nick: The gameaccount nickname :param avatarUrl: The gameaccount avatar url :param gameId: The game id :param isConnected: Whether or not the gameaccount is connected :param connectedAt: When the gameaccount was connected :ivar id: The gameaccount id :ivar nick: The gameaccount nickname :ivar avatar_url: The gameaccount avatar url :ivar gameId: The game id :ivar isConnected: Whether or not the gameaccount is connected :ivar connectedAt: When the gameaccount was connected .. py:class:: Player(id: str, nickName: str, avatarUrl: str, registered: str, isProfileComplete: bool, gameAccounts: list[masterblaster.gameaccount.GameAccount]) Class for Player objects, related to zero or more gameaccounts :param id: The masterblaster id of the player :param nickName: The internal nickname of the player :param avatarUrl: The avatar url of the player :param registered: When the player was registered :param isProfileComplete: Whether or not the player has completed their profile :param gameAccounts: List of gameaccounts related to the player