:py:mod:`masterblaster` ======================= .. py:module:: masterblaster Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 gameaccount/index.rst headers/index.rst image/index.rst masterblaster/index.rst match/index.rst member/index.rst organisation/index.rst player/index.rst schedule/index.rst team/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: masterblaster.Header masterblaster.MasterBlaster masterblaster.Member masterblaster.Image masterblaster.GameAccount masterblaster.Player masterblaster.Player masterblaster.Schedule masterblaster.Team masterblaster.Schedule masterblaster.Organisation Attributes ~~~~~~~~~~ .. autoapisummary:: masterblaster.BASE .. 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]) MasterBlaster is the main class for interacting with the MasterBlaster API :param access_token: The access token for the organization :ivar access_token: The access token for 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) -> 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:: set_access_token(access_token: str) -> None :async: Set the access token for the organization Will update the session :param access_token: The access token for the organization :type access_token: str :rtype: None .. py:method:: get_org(org_id: str) -> masterblaster.organisation.Organisation :async: Returns the organization for the given organization id :param org_id (str): :type org_id (str): The organization id :rtype: Organisation .. py:method:: get_org_by_name(org_name: str) -> masterblaster.organisation.Organisation :async: Returns the organization for the given organization name Users can be associated with multiple organizations with the same name, so this function will return the first one :param org_name (str): :type org_name (str): The organization name :rtype: Organisation .. py:method:: get_all_orgs() -> list[masterblaster.organisation.Organisation] :async: Get all organizations for the current access token :param None: :returns: **organisations** :rtype: List[Organisation] .. py:class:: Member(player: dict, email: str, name: str, playerId: str, role: int, addedAt: str, invitedAt: Optional[datetime.datetime]) 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: Optional[datetime.datetime]) 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 .. 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 .. py:class:: Schedule(matches: list[dict]) Class holding all information about scheduled competitions for a team :param matches: List of matches :ivar matches: List of matches .. py:method:: get_next_match() .. py:data:: BASE :value: 'https://app.masterblaster.gg/api' .. py:class:: Team(session: aiohttp.ClientSession = None, id: Optional[str] = None, ownerPlayerId: str = None, organizationOwnerId: str = None, name: Optional[str] = None, tag: Optional[str] = None, flag: Optional[str] = None, shortHandle: Optional[str] = None, avatarImageId: str = None, bannerImageId: Optional[str] = None, socialLinks: list = None, gameId: str = None, players: list[dict] = None, createdAt: Optional[datetime.datetime] = None) .. py:method:: get_schedule() -> masterblaster.schedule.Schedule :async: Returns the schedule for the team :param None: :rtype: Schedule .. py:class:: Schedule(matches: list[dict]) Class holding all information about scheduled competitions for a team :param matches: List of matches :ivar matches: List of matches .. py:method:: get_next_match() .. py:class:: Organisation(session: aiohttp.ClientSession = None, id: str = None, name: str = None, members: list[dict] = None, images: list[dict] = None) .. py:method:: get_members() :async: Returns members of the organization :param None: :returns: **members** -- A list of all members in the organization :rtype: list[Member] .. py:method:: get_teams() -> list[masterblaster.team.Team] :async: Returns teams of the organization :param None: :returns: **teams** -- A list of all teams in the organization :rtype: list[Team] .. 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]