diff --git a/bungio/api/bungie/destiny2.py b/bungio/api/bungie/destiny2.py index 780fbd5..afaaa1b 100644 --- a/bungio/api/bungie/destiny2.py +++ b/bungio/api/bungie/destiny2.py @@ -522,6 +522,80 @@ async def equip_items(self, data: DestinyItemSetActionRequest, auth: AuthData) - response = await self._client.http.equip_items(auth=auth, **data.to_dict(_return_to_bungie_case=False)) return await DestinyEquipItemResults.from_dict(data=response, client=self._client, auth=auth) + async def equip_loadout(self, data: dict, auth: AuthData) -> int: + """ + Equip a loadout. You must have a valid Destiny Account, and either be in a social space, in orbit, or offline. + + Warning: Requires Authentication. + Required oauth2 scopes: MoveEquipDestinyItems + + Args: + data: The required data for this request. + auth: Authentication information. + + Returns: + The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html) + """ + + response = await self._client.http.equip_loadout(auth=auth, **data.to_dict(_return_to_bungie_case=False)) + return response["Response"] + + async def snapshot_loadout(self, data: dict, auth: AuthData) -> int: + """ + Snapshot a loadout with the currently equipped items. + + Warning: Requires Authentication. + Required oauth2 scopes: MoveEquipDestinyItems + + Args: + data: The required data for this request. + auth: Authentication information. + + Returns: + The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html) + """ + + response = await self._client.http.snapshot_loadout(auth=auth, **data.to_dict(_return_to_bungie_case=False)) + return response["Response"] + + async def update_loadout_identifiers(self, data: dict, auth: AuthData) -> int: + """ + Update the color, icon, and name of a loadout. + + Warning: Requires Authentication. + Required oauth2 scopes: MoveEquipDestinyItems + + Args: + data: The required data for this request. + auth: Authentication information. + + Returns: + The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html) + """ + + response = await self._client.http.update_loadout_identifiers( + auth=auth, **data.to_dict(_return_to_bungie_case=False) + ) + return response["Response"] + + async def clear_loadout(self, data: dict, auth: AuthData) -> int: + """ + Clear the identifiers and items of a loadout. + + Warning: Requires Authentication. + Required oauth2 scopes: MoveEquipDestinyItems + + Args: + data: The required data for this request. + auth: Authentication information. + + Returns: + The model which is returned by bungie. [General endpoint information.](https://bungie-net.github.io/multi/index.html) + """ + + response = await self._client.http.clear_loadout(auth=auth, **data.to_dict(_return_to_bungie_case=False)) + return response["Response"] + async def set_item_lock_state(self, data: DestinyItemStateRequest, auth: AuthData) -> int: """ Set the Lock State for an instanced item. You must have a valid Destiny Account. diff --git a/bungio/api/bungie/fireteam.py b/bungio/api/bungie/fireteam.py index 2da57c1..ee3b073 100644 --- a/bungio/api/bungie/fireteam.py +++ b/bungio/api/bungie/fireteam.py @@ -47,6 +47,7 @@ async def get_available_clan_fireteams( public_only: Union[FireteamPublicSearchOption, int], slot_filter: Union[FireteamSlotSearch, int], auth: AuthData, + exclude_immediate: Optional[bool] = None, lang_filter: Optional[str] = None, ) -> SearchResultOfFireteamSummary: """ @@ -64,6 +65,7 @@ async def get_available_clan_fireteams( public_only: Determines public/private filtering. slot_filter: Filters based on available slots auth: Authentication information. + exclude_immediate: If you wish the result to exclude immediate fireteams, set this to true. Immediate-only can be forced using the dateRange enum. lang_filter: An optional language filter. Returns: @@ -79,6 +81,7 @@ async def get_available_clan_fireteams( public_only=getattr(public_only, "value", public_only), slot_filter=getattr(slot_filter, "value", slot_filter), auth=auth, + exclude_immediate=exclude_immediate if exclude_immediate is not None else None, lang_filter=lang_filter if lang_filter is not None else None, ) return await SearchResultOfFireteamSummary.from_dict( @@ -92,6 +95,7 @@ async def get_available_clan_fireteams( public_only=public_only, slot_filter=slot_filter, auth=auth, + exclude_immediate=exclude_immediate, lang_filter=lang_filter, ) @@ -103,6 +107,7 @@ async def search_public_available_clan_fireteams( platform: Union[FireteamPlatform, int], slot_filter: Union[FireteamSlotSearch, int], auth: AuthData, + exclude_immediate: Optional[bool] = None, lang_filter: Optional[str] = None, ) -> SearchResultOfFireteamSummary: """ @@ -118,6 +123,7 @@ async def search_public_available_clan_fireteams( platform: The platform filter. slot_filter: Filters based on available slots auth: Authentication information. + exclude_immediate: If you wish the result to exclude immediate fireteams, set this to true. Immediate-only can be forced using the dateRange enum. lang_filter: An optional language filter. Returns: @@ -131,6 +137,7 @@ async def search_public_available_clan_fireteams( platform=getattr(platform, "value", platform), slot_filter=getattr(slot_filter, "value", slot_filter), auth=auth, + exclude_immediate=exclude_immediate if exclude_immediate is not None else None, lang_filter=lang_filter if lang_filter is not None else None, ) return await SearchResultOfFireteamSummary.from_dict( @@ -142,6 +149,7 @@ async def search_public_available_clan_fireteams( platform=platform, slot_filter=slot_filter, auth=auth, + exclude_immediate=exclude_immediate, lang_filter=lang_filter, ) diff --git a/bungio/http/routes/destiny2.py b/bungio/http/routes/destiny2.py index 6d5a4ce..55d4fef 100644 --- a/bungio/http/routes/destiny2.py +++ b/bungio/http/routes/destiny2.py @@ -651,6 +651,188 @@ async def equip_items( Route(path=f"/Destiny2/Actions/Items/EquipItems/", method="POST", data=data, auth=auth) ) + async def equip_loadout( + self, loadout_index: int, character_id: int, membership_type: Union[Any, int], auth: AuthData, *args, **kwargs + ) -> dict: + """ + Equip a loadout. You must have a valid Destiny Account, and either be in a social space, in orbit, or offline. + + Warning: Requires Authentication. + Required oauth2 scopes: MoveEquipDestinyItems + + Args: + loadout_index: The index of the loadout for this action request. + character_id: _No description given by bungie._ + membership_type: _No description given by bungie._ + auth: Authentication information. + + Raises: + NotFound: 404 request + BadRequest: 400 request + InvalidAuthentication: If authentication is invalid + TimeoutException: If no connection could be made + BungieDead: Servers are down + AuthenticationTooSlow: The authentication key has expired + BungieException: Relaying the bungie error + + Returns: + The json response + """ + + data = { + "loadoutIndex": loadout_index, + "characterId": character_id, + "membershipType": membership_type, + } + + return await self.request( + Route(path=f"/Destiny2/Actions/Loadouts/EquipLoadout/", method="POST", data=data, auth=auth) + ) + + async def snapshot_loadout( + self, + color_hash: int, + icon_hash: int, + name_hash: int, + loadout_index: int, + character_id: int, + membership_type: Union[Any, int], + auth: AuthData, + *args, + **kwargs, + ) -> dict: + """ + Snapshot a loadout with the currently equipped items. + + Warning: Requires Authentication. + Required oauth2 scopes: MoveEquipDestinyItems + + Args: + color_hash: _No description given by bungie._ + icon_hash: _No description given by bungie._ + name_hash: _No description given by bungie._ + loadout_index: The index of the loadout for this action request. + character_id: _No description given by bungie._ + membership_type: _No description given by bungie._ + auth: Authentication information. + + Raises: + NotFound: 404 request + BadRequest: 400 request + InvalidAuthentication: If authentication is invalid + TimeoutException: If no connection could be made + BungieDead: Servers are down + AuthenticationTooSlow: The authentication key has expired + BungieException: Relaying the bungie error + + Returns: + The json response + """ + + data = { + "colorHash": color_hash, + "iconHash": icon_hash, + "nameHash": name_hash, + "loadoutIndex": loadout_index, + "characterId": character_id, + "membershipType": membership_type, + } + + return await self.request( + Route(path=f"/Destiny2/Actions/Loadouts/SnapshotLoadout/", method="POST", data=data, auth=auth) + ) + + async def update_loadout_identifiers( + self, + color_hash: int, + icon_hash: int, + name_hash: int, + loadout_index: int, + character_id: int, + membership_type: Union[Any, int], + auth: AuthData, + *args, + **kwargs, + ) -> dict: + """ + Update the color, icon, and name of a loadout. + + Warning: Requires Authentication. + Required oauth2 scopes: MoveEquipDestinyItems + + Args: + color_hash: _No description given by bungie._ + icon_hash: _No description given by bungie._ + name_hash: _No description given by bungie._ + loadout_index: The index of the loadout for this action request. + character_id: _No description given by bungie._ + membership_type: _No description given by bungie._ + auth: Authentication information. + + Raises: + NotFound: 404 request + BadRequest: 400 request + InvalidAuthentication: If authentication is invalid + TimeoutException: If no connection could be made + BungieDead: Servers are down + AuthenticationTooSlow: The authentication key has expired + BungieException: Relaying the bungie error + + Returns: + The json response + """ + + data = { + "colorHash": color_hash, + "iconHash": icon_hash, + "nameHash": name_hash, + "loadoutIndex": loadout_index, + "characterId": character_id, + "membershipType": membership_type, + } + + return await self.request( + Route(path=f"/Destiny2/Actions/Loadouts/UpdateLoadoutIdentifiers/", method="POST", data=data, auth=auth) + ) + + async def clear_loadout( + self, loadout_index: int, character_id: int, membership_type: Union[Any, int], auth: AuthData, *args, **kwargs + ) -> dict: + """ + Clear the identifiers and items of a loadout. + + Warning: Requires Authentication. + Required oauth2 scopes: MoveEquipDestinyItems + + Args: + loadout_index: The index of the loadout for this action request. + character_id: _No description given by bungie._ + membership_type: _No description given by bungie._ + auth: Authentication information. + + Raises: + NotFound: 404 request + BadRequest: 400 request + InvalidAuthentication: If authentication is invalid + TimeoutException: If no connection could be made + BungieDead: Servers are down + AuthenticationTooSlow: The authentication key has expired + BungieException: Relaying the bungie error + + Returns: + The json response + """ + + data = { + "loadoutIndex": loadout_index, + "characterId": character_id, + "membershipType": membership_type, + } + + return await self.request( + Route(path=f"/Destiny2/Actions/Loadouts/ClearLoadout/", method="POST", data=data, auth=auth) + ) + async def set_item_lock_state( self, state: bool, diff --git a/bungio/http/routes/fireteam.py b/bungio/http/routes/fireteam.py index caf3f23..4c3f8e1 100644 --- a/bungio/http/routes/fireteam.py +++ b/bungio/http/routes/fireteam.py @@ -43,6 +43,7 @@ async def get_available_clan_fireteams( public_only: int, slot_filter: int, auth: AuthData, + exclude_immediate: Optional[bool] = None, lang_filter: Optional[str] = None, *args, **kwargs, @@ -62,6 +63,7 @@ async def get_available_clan_fireteams( public_only: Determines public/private filtering. slot_filter: Filters based on available slots auth: Authentication information. + exclude_immediate: If you wish the result to exclude immediate fireteams, set this to true. Immediate-only can be forced using the dateRange enum. lang_filter: An optional language filter. Raises: @@ -82,6 +84,7 @@ async def get_available_clan_fireteams( path=f"/Fireteam/Clan/{group_id}/Available/{platform}/{activity_type}/{date_range}/{slot_filter}/{public_only}/{page}/", method="GET", auth=auth, + exclude_immediate=exclude_immediate, lang_filter=lang_filter, ) ) @@ -94,6 +97,7 @@ async def search_public_available_clan_fireteams( platform: int, slot_filter: int, auth: AuthData, + exclude_immediate: Optional[bool] = None, lang_filter: Optional[str] = None, *args, **kwargs, @@ -111,6 +115,7 @@ async def search_public_available_clan_fireteams( platform: The platform filter. slot_filter: Filters based on available slots auth: Authentication information. + exclude_immediate: If you wish the result to exclude immediate fireteams, set this to true. Immediate-only can be forced using the dateRange enum. lang_filter: An optional language filter. Raises: @@ -131,6 +136,7 @@ async def search_public_available_clan_fireteams( path=f"/Fireteam/Search/Available/{platform}/{activity_type}/{date_range}/{slot_filter}/{page}/", method="GET", auth=auth, + exclude_immediate=exclude_immediate, lang_filter=lang_filter, ) ) diff --git a/bungio/models/bungie/__init__.py b/bungio/models/bungie/__init__.py index b0fcfe7..d8220ea 100644 --- a/bungio/models/bungie/__init__.py +++ b/bungio/models/bungie/__init__.py @@ -160,6 +160,11 @@ DestinyKioskItem, DestinyKiosksComponent, ) +from bungio.models.bungie.destiny.components.loadouts import ( + DestinyLoadoutComponent, + DestinyLoadoutItemComponent, + DestinyLoadoutsComponent, +) from bungio.models.bungie.destiny.components.metrics import ( DestinyMetricComponent, DestinyMetricsComponent, @@ -183,6 +188,9 @@ DestinyRecordComponent, DestinyRecordsComponent, ) +from bungio.models.bungie.destiny.components.social import ( + DestinySocialCommendationsComponent, +) from bungio.models.bungie.destiny.components.stringvariables import ( DestinyStringVariablesComponent, ) @@ -375,6 +383,11 @@ from bungio.models.bungie.destiny.definitions.energytypes import ( DestinyEnergyTypeDefinition, ) +from bungio.models.bungie.destiny.definitions.guardianranks import ( + DestinyGuardianRankConstantsDefinition, + DestinyGuardianRankDefinition, + DestinyGuardianRankIconBackgroundsDefinition, +) from bungio.models.bungie.destiny.definitions.items import ( DestinyDerivedItemCategoryDefinition, DestinyDerivedItemDefinition, @@ -386,6 +399,12 @@ DestinyParentItemOverride, DestinyPlugRuleDefinition, ) +from bungio.models.bungie.destiny.definitions.loadouts import ( + DestinyLoadoutColorDefinition, + DestinyLoadoutConstantsDefinition, + DestinyLoadoutIconDefinition, + DestinyLoadoutNameDefinition, +) from bungio.models.bungie.destiny.definitions.lore import DestinyLoreDefinition from bungio.models.bungie.destiny.definitions.metrics import DestinyMetricDefinition from bungio.models.bungie.destiny.definitions.milestones import ( @@ -446,6 +465,10 @@ DestinySeasonPreviewDefinition, DestinySeasonPreviewImageDefinition, ) +from bungio.models.bungie.destiny.definitions.social import ( + DestinySocialCommendationDefinition, + DestinySocialCommendationNodeDefinition, +) from bungio.models.bungie.destiny.definitions.sockets import ( DestinyInsertPlugActionDefinition, DestinyPlugSetDefinition, @@ -455,10 +478,7 @@ DestinySocketTypeScalarMaterialRequirementEntry, ) from bungio.models.bungie.destiny.definitions.sources import DestinyItemSourceDefinition -from bungio.models.bungie.destiny.definitions.traits import ( - DestinyTraitCategoryDefinition, - DestinyTraitDefinition, -) +from bungio.models.bungie.destiny.definitions.traits import DestinyTraitDefinition from bungio.models.bungie.destiny.definitions.vendors import ( DestinyVendorLocationDefinition, ) diff --git a/bungio/models/bungie/common/models.py b/bungio/models/bungie/common/models.py index ea7bbb6..f34dfea 100644 --- a/bungio/models/bungie/common/models.py +++ b/bungio/models/bungie/common/models.py @@ -136,10 +136,13 @@ class Destiny2CoreSettings(BaseModel): current_seasonal_artifact_hash: _No description given by bungie._ exotic_catalysts_root_node_hash: _No description given by bungie._ future_season_hashes: _No description given by bungie._ + guardian_rank_constants_hash: _No description given by bungie._ + guardian_ranks_root_node_hash: _No description given by bungie._ insert_plug_free_blocked_socket_type_hashes: _No description given by bungie._ insert_plug_free_protected_plug_item_hashes: _No description given by bungie._ legacy_seals_root_node_hash: _No description given by bungie._ legacy_triumphs_root_node_hash: _No description given by bungie._ + loadout_constants_hash: _No description given by bungie._ lore_root_node_hash: _No description given by bungie._ medals_root_node: _No description given by bungie._ medals_root_node_hash: _No description given by bungie._ @@ -156,8 +159,11 @@ class Destiny2CoreSettings(BaseModel): manifest_current_season_hash: Manifest information for `current_season_hash` manifest_current_seasonal_artifact_hash: Manifest information for `current_seasonal_artifact_hash` manifest_exotic_catalysts_root_node_hash: Manifest information for `exotic_catalysts_root_node_hash` + manifest_guardian_rank_constants_hash: Manifest information for `guardian_rank_constants_hash` + manifest_guardian_ranks_root_node_hash: Manifest information for `guardian_ranks_root_node_hash` manifest_legacy_seals_root_node_hash: Manifest information for `legacy_seals_root_node_hash` manifest_legacy_triumphs_root_node_hash: Manifest information for `legacy_triumphs_root_node_hash` + manifest_loadout_constants_hash: Manifest information for `loadout_constants_hash` manifest_lore_root_node_hash: Manifest information for `lore_root_node_hash` manifest_medals_root_node: Manifest information for `medals_root_node` manifest_medals_root_node_hash: Manifest information for `medals_root_node_hash` @@ -179,10 +185,13 @@ class Destiny2CoreSettings(BaseModel): current_seasonal_artifact_hash: int = custom_field() exotic_catalysts_root_node_hash: int = custom_field() future_season_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) + guardian_rank_constants_hash: int = custom_field() + guardian_ranks_root_node_hash: int = custom_field() insert_plug_free_blocked_socket_type_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) insert_plug_free_protected_plug_item_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) legacy_seals_root_node_hash: int = custom_field() legacy_triumphs_root_node_hash: int = custom_field() + loadout_constants_hash: int = custom_field() lore_root_node_hash: int = custom_field() medals_root_node: int = custom_field() medals_root_node_hash: int = custom_field() @@ -199,8 +208,15 @@ class Destiny2CoreSettings(BaseModel): manifest_current_season_hash: Optional["DestinySeasonDefinition"] = custom_field(default=None) manifest_current_seasonal_artifact_hash: Optional["DestinyVendorDefinition"] = custom_field(default=None) manifest_exotic_catalysts_root_node_hash: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) + manifest_guardian_rank_constants_hash: Optional[dict] = custom_field( + metadata={"type": """Optional[dict]"""}, default=None + ) + manifest_guardian_ranks_root_node_hash: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) manifest_legacy_seals_root_node_hash: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) manifest_legacy_triumphs_root_node_hash: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) + manifest_loadout_constants_hash: Optional[dict] = custom_field( + metadata={"type": """Optional[dict]"""}, default=None + ) manifest_lore_root_node_hash: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) manifest_medals_root_node: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) manifest_medals_root_node_hash: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) diff --git a/bungio/models/bungie/destiny/__init__.py b/bungio/models/bungie/destiny/__init__.py index 0869e17..fab5ad5 100644 --- a/bungio/models/bungie/destiny/__init__.py +++ b/bungio/models/bungie/destiny/__init__.py @@ -612,6 +612,8 @@ class DamageType(BaseEnum): """_No description given by bungie._ """ STASIS = 6 """_No description given by bungie._ """ + STRAND = 7 + """_No description given by bungie._ """ class DestinyObjectiveUiStyle(BaseEnum): @@ -822,6 +824,10 @@ class DestinyPresentationDisplayStyle(BaseEnum): """_No description given by bungie._ """ RECORD = 4 """_No description given by bungie._ """ + SEASONAL_TRIUMPH = 5 + """_No description given by bungie._ """ + GUARDIAN_RANK = 6 + """_No description given by bungie._ """ class DestinyRecordValueStyle(BaseEnum): @@ -864,6 +870,8 @@ class DestinyRecordToastStyle(BaseEnum): """_No description given by bungie._ """ CRAFTING_RECIPE_UNLOCKED = 8 """_No description given by bungie._ """ + TOAST_GUARDIAN_RANK_DETAILS = 9 + """_No description given by bungie._ """ class DestinyPresentationScreenStyle(BaseEnum): @@ -1177,6 +1185,8 @@ class DestinyComponentType(BaseEnum): """This will return info about activities that a user can see and gating on it, if you are the currently authenticated user or the user has elected to allow anonymous viewing of its progression info. Note that the data returned by this can be unfortunately problematic and relatively unreliable in some cases. We'll eventually work on making it more consistently reliable. """ CHARACTER_EQUIPMENT = 205 """This will return info about the equipped items on the character(s). Everyone can see this. """ + CHARACTER_LOADOUTS = 206 + """This will return info about the loadouts of the character(s). """ ITEM_INSTANCES = 300 """This will return basic info about instanced items - whether they can be equipped, their tracked status, and some info commonly needed in many places (current damage type, primary stat value, etc) """ ITEM_OBJECTIVES = 301 @@ -1223,6 +1233,8 @@ class DestinyComponentType(BaseEnum): """Returns a mapping of localized string variable hashes to values, on a per-account or per-character basis. """ CRAFTABLES = 1300 """Returns summary status information about all "Craftables" aka crafting recipe items. """ + SOCIAL_COMMENDATIONS = 1400 + """Returns score values for all commendations and commendation nodes. """ class DestinyPresentationNodeState(BaseFlagEnum): diff --git a/bungio/models/bungie/destiny/definitions/__init__.py b/bungio/models/bungie/destiny/definitions/__init__.py index fa83485..818e738 100644 --- a/bungio/models/bungie/destiny/definitions/__init__.py +++ b/bungio/models/bungie/destiny/definitions/__init__.py @@ -2344,6 +2344,7 @@ class DestinyDamageTypeDefinition(ManifestModel, HashObject): None Attributes: + color: A color associated with the damage type. The displayProperties icon is tinted with a color close to this. display_properties: The description of the damage type, icon etc... enum_value: We have an enumeration for damage types for quick reference. This is the current definition's damage type enum value. hash: The unique identifier for this entity. Guaranteed to be unique for the type of entity, but not globally. When entities refer to each other in Destiny content, it is this hash that they are referring to. @@ -2353,6 +2354,7 @@ class DestinyDamageTypeDefinition(ManifestModel, HashObject): transparent_icon_path: A variant of the icon that is transparent and colorless. """ + color: "DestinyColor" = custom_field() display_properties: "DestinyDisplayPropertiesDefinition" = custom_field() enum_value: Union["DamageType", int] = custom_field(converter=enum_converter("DamageType")) index: int = custom_field() diff --git a/bungio/models/bungie/destiny/definitions/traits.py b/bungio/models/bungie/destiny/definitions/traits.py index 7ba27c9..8e03843 100644 --- a/bungio/models/bungie/destiny/definitions/traits.py +++ b/bungio/models/bungie/destiny/definitions/traits.py @@ -2,7 +2,7 @@ # This file is generated automatically by `generate_api_schema.py` and will be overwritten # Instead, change functions / models by subclassing them in the `./overwrites/` folder. They will be used instead. -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING from bungio.models.base import HashObject, ManifestModel, custom_define, custom_field @@ -15,52 +15,16 @@ class DestinyTraitDefinition(ManifestModel, HashObject): """ _No description given by bungie._ - Tip: Manifest Information - This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`). - Without additional work, these attributes will be `None`, since they require additional requests and database lookups. - - To fill the manifest dependent attributes, either: - - - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base) - - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client) - + None Attributes: display_hint: An identifier for how this trait can be displayed. For example: a 'keyword' hint to show an explanation for certain related terms. display_properties: _No description given by bungie._ hash: The unique identifier for this entity. Guaranteed to be unique for the type of entity, but not globally. When entities refer to each other in Destiny content, it is this hash that they are referring to. index: The index of the entity as it was found in the investment tables. redacted: If this is true, then there is an entity with this identifier/type combination, but BNet is not yet allowed to show it. Sorry! - trait_category_hash: _No description given by bungie._ - trait_category_id: _No description given by bungie._ - manifest_trait_category_hash: Manifest information for `trait_category_hash` """ display_hint: str = custom_field() display_properties: "DestinyDisplayPropertiesDefinition" = custom_field() index: int = custom_field() redacted: bool = custom_field() - trait_category_hash: int = custom_field() - trait_category_id: str = custom_field() - manifest_trait_category_hash: Optional["DestinyTraitCategoryDefinition"] = custom_field(default=None) - - -@custom_define() -class DestinyTraitCategoryDefinition(ManifestModel, HashObject): - """ - _No description given by bungie._ - - None - Attributes: - hash: The unique identifier for this entity. Guaranteed to be unique for the type of entity, but not globally. When entities refer to each other in Destiny content, it is this hash that they are referring to. - index: The index of the entity as it was found in the investment tables. - redacted: If this is true, then there is an entity with this identifier/type combination, but BNet is not yet allowed to show it. Sorry! - trait_category_id: _No description given by bungie._ - trait_hashes: _No description given by bungie._ - trait_ids: _No description given by bungie._ - """ - - index: int = custom_field() - redacted: bool = custom_field() - trait_category_id: str = custom_field() - trait_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) - trait_ids: list[str] = custom_field(metadata={"type": """list[str]"""}) diff --git a/bungio/models/bungie/destiny/entities/profiles.py b/bungio/models/bungie/destiny/entities/profiles.py index c91bb72..4180ded 100644 --- a/bungio/models/bungie/destiny/entities/profiles.py +++ b/bungio/models/bungie/destiny/entities/profiles.py @@ -48,25 +48,35 @@ class DestinyProfileComponent(BaseModel): Attributes: active_event_card_hash: If populated, this is a reference to the event card that is currently active. character_ids: A list of the character IDs, for further querying on your part. + current_guardian_rank: The 'current' Guardian Rank value, which starts at rank 1. current_season_hash: If populated, this is a reference to the season that is currently active. current_season_reward_power_cap: If populated, this is the reward power cap for the current season. date_last_played: The last time the user played with any character on this Profile. event_card_hashes_owned: A list of hashes for event cards that a profile owns. Unlike most values in versionsOwned, these stay with the profile across all platforms. + lifetime_highest_guardian_rank: The 'lifetime highest' Guardian Rank value, which starts at rank 1. season_hashes: A list of seasons that this profile owns. Unlike versionsOwned, these stay with the profile across Platforms, and thus will be valid. It turns out that Stadia Pro subscriptions will give access to seasons but only while playing on Stadia and with an active subscription. So some users (users who have Stadia Pro but choose to play on some other platform) won't see these as available: it will be whatever seasons are available for the platform on which they last played. user_info: If you need to render the Profile (their platform name, icon, etc...) somewhere, this property contains that information. versions_owned: If you want to know what expansions they own, this will contain that data. IMPORTANT: This field may not return the data you're interested in for Cross-Saved users. It returns the last ownership data we saw for this account - which is to say, what they've purchased on the platform on which they last played, which now could be a different platform. If you don't care about per-platform ownership and only care about whatever platform it seems they are playing on most recently, then this should be "good enough." Otherwise, this should be considered deprecated. We do not have a good alternative to provide at this time with platform specific ownership data for DLC. manifest_active_event_card_hash: Manifest information for `active_event_card_hash` + manifest_current_guardian_rank: Manifest information for `current_guardian_rank` manifest_current_season_hash: Manifest information for `current_season_hash` + manifest_lifetime_highest_guardian_rank: Manifest information for `lifetime_highest_guardian_rank` """ active_event_card_hash: int = custom_field() character_ids: list[int] = custom_field(metadata={"type": """list[int]"""}) + current_guardian_rank: int = custom_field() current_season_hash: int = custom_field() current_season_reward_power_cap: int = custom_field() date_last_played: datetime = custom_field() event_card_hashes_owned: list[int] = custom_field(metadata={"type": """list[int]"""}) + lifetime_highest_guardian_rank: int = custom_field() season_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) user_info: "UserInfoCard" = custom_field() versions_owned: Union["DestinyGameVersions", int] = custom_field(converter=enum_converter("DestinyGameVersions")) manifest_active_event_card_hash: Optional["DestinyEventCardDefinition"] = custom_field(default=None) + manifest_current_guardian_rank: Optional[dict] = custom_field(metadata={"type": """Optional[dict]"""}, default=None) manifest_current_season_hash: Optional["DestinySeasonDefinition"] = custom_field(default=None) + manifest_lifetime_highest_guardian_rank: Optional[dict] = custom_field( + metadata={"type": """Optional[dict]"""}, default=None + ) diff --git a/bungio/models/bungie/destiny/requests/actions.py b/bungio/models/bungie/destiny/requests/actions.py index 099b630..111774e 100644 --- a/bungio/models/bungie/destiny/requests/actions.py +++ b/bungio/models/bungie/destiny/requests/actions.py @@ -104,6 +104,46 @@ class DestinyItemSetActionRequest(BaseModel): membership_type: Union["BungieMembershipType", int] = custom_field(converter=enum_converter("BungieMembershipType")) +@custom_define() +class DestinyLoadoutActionRequest(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + character_id: _No description given by bungie._ + loadout_index: The index of the loadout for this action request. + membership_type: _No description given by bungie._ + """ + + character_id: int = custom_field(metadata={"int64": True}) + loadout_index: int = custom_field() + membership_type: Union["BungieMembershipType", int] = custom_field(converter=enum_converter("BungieMembershipType")) + + +@custom_define() +class DestinyLoadoutUpdateActionRequest(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + character_id: _No description given by bungie._ + color_hash: _No description given by bungie._ + icon_hash: _No description given by bungie._ + loadout_index: The index of the loadout for this action request. + membership_type: _No description given by bungie._ + name_hash: _No description given by bungie._ + """ + + character_id: int = custom_field(metadata={"int64": True}) + color_hash: int = custom_field() + icon_hash: int = custom_field() + loadout_index: int = custom_field() + membership_type: Union["BungieMembershipType", int] = custom_field(converter=enum_converter("BungieMembershipType")) + name_hash: int = custom_field() + + @custom_define() class DestinyItemStateRequest(BaseModel): """ diff --git a/bungio/models/bungie/destiny/responses.py b/bungio/models/bungie/destiny/responses.py index 10e8272..249eec8 100644 --- a/bungio/models/bungie/destiny/responses.py +++ b/bungio/models/bungie/destiny/responses.py @@ -170,6 +170,7 @@ class DestinyProfileResponse(BaseModel): character_equipment: The character's equipped items, keyed by the Character's Id. COMPONENT TYPE: CharacterEquipment character_inventories: The character-level non-equipped inventory items, keyed by the Character's Id. COMPONENT TYPE: CharacterInventories character_kiosks: Items available from Kiosks that are available to a specific character as opposed to the account as a whole. It must be combined with data from the profileKiosks property to get a full picture of the character's available items to check out of a kiosk. This component returns information about what Kiosk items are available to you on a *Character* level. Usually, kiosk items will be earned for the entire Profile (all characters) at once. To find those, look in the profileKiosks property. COMPONENT TYPE: Kiosks + character_loadouts: The character loadouts, keyed by the Character's Id. COMPONENT TYPE: CharacterLoadouts character_plug_sets: When sockets refer to reusable Plug Sets (see DestinyPlugSetDefinition for more info), this is the set of plugs and their states, per character, that are character-scoped. This comes back with ItemSockets, as it is needed for a complete picture of the sockets on requested items. COMPONENT TYPE: ItemSockets character_presentation_nodes: COMPONENT TYPE: PresentationNodes character_progressions: Character-level progression data, keyed by the Character's Id. COMPONENT TYPE: CharacterProgressions @@ -183,6 +184,7 @@ class DestinyProfileResponse(BaseModel): platform_silver: Silver quantities for any platform on which this Profile plays destiny. COMPONENT TYPE: PlatformSilver profile: The basic information about the Destiny Profile (formerly "Account"). COMPONENT TYPE: Profiles profile_collectibles: COMPONENT TYPE: Collectibles + profile_commendations: COMPONENT TYPE: SocialCommendations profile_currencies: The profile-level currencies owned by the Destiny Profile. COMPONENT TYPE: ProfileCurrencies profile_inventory: The profile-level inventory of the Destiny Profile. COMPONENT TYPE: ProfileInventories profile_kiosks: Items available from Kiosks that are available Profile-wide (i.e. across all characters) This component returns information about what Kiosk items are available to you on a *Profile* level. It is theoretically possible for Kiosks to have items gated by specific Character as well. If you ever have those, you will find them on the characterKiosks property. COMPONENT TYPE: Kiosks @@ -204,6 +206,7 @@ class DestinyProfileResponse(BaseModel): character_equipment: "DictionaryComponentResponseOfint64AndDestinyInventoryComponent" = custom_field() character_inventories: "DictionaryComponentResponseOfint64AndDestinyInventoryComponent" = custom_field() character_kiosks: "DictionaryComponentResponseOfint64AndDestinyKiosksComponent" = custom_field() + character_loadouts: dict = custom_field(metadata={"type": """dict"""}) character_plug_sets: "DictionaryComponentResponseOfint64AndDestinyPlugSetsComponent" = custom_field() character_presentation_nodes: "DictionaryComponentResponseOfint64AndDestinyPresentationNodesComponent" = ( custom_field() @@ -221,6 +224,7 @@ class DestinyProfileResponse(BaseModel): platform_silver: "SingleComponentResponseOfDestinyPlatformSilverComponent" = custom_field() profile: "SingleComponentResponseOfDestinyProfileComponent" = custom_field() profile_collectibles: "SingleComponentResponseOfDestinyProfileCollectiblesComponent" = custom_field() + profile_commendations: dict = custom_field(metadata={"type": """dict"""}) profile_currencies: "SingleComponentResponseOfDestinyInventoryComponent" = custom_field() profile_inventory: "SingleComponentResponseOfDestinyInventoryComponent" = custom_field() profile_kiosks: "SingleComponentResponseOfDestinyKiosksComponent" = custom_field() @@ -250,6 +254,7 @@ class DestinyCharacterResponse(BaseModel): inventory: The character-level non-equipped inventory items. COMPONENT TYPE: CharacterInventories item_components: The set of components belonging to the player's instanced items. COMPONENT TYPE: [See inside the DestinyItemComponentSet contract for component types.] kiosks: Items available from Kiosks that are available to this specific character. COMPONENT TYPE: Kiosks + loadouts: The loadouts available to the character. COMPONENT TYPE: CharacterLoadouts plug_sets: When sockets refer to reusable Plug Sets (see DestinyPlugSetDefinition for more info), this is the set of plugs and their states that are scoped to this character. This comes back with ItemSockets, as it is needed for a complete picture of the sockets on requested items. COMPONENT TYPE: ItemSockets presentation_nodes: COMPONENT TYPE: PresentationNodes progressions: Character progression data, including Milestones. COMPONENT TYPE: CharacterProgressions @@ -266,6 +271,7 @@ class DestinyCharacterResponse(BaseModel): inventory: "SingleComponentResponseOfDestinyInventoryComponent" = custom_field() item_components: "DestinyItemComponentSetOfint64" = custom_field() kiosks: "SingleComponentResponseOfDestinyKiosksComponent" = custom_field() + loadouts: dict = custom_field(metadata={"type": """dict"""}) plug_sets: "SingleComponentResponseOfDestinyPlugSetsComponent" = custom_field() presentation_nodes: "SingleComponentResponseOfDestinyPresentationNodesComponent" = custom_field() progressions: "SingleComponentResponseOfDestinyCharacterProgressionComponent" = custom_field() diff --git a/bungio/models/bungie/fireteam.py b/bungio/models/bungie/fireteam.py index da8e67d..4d51718 100644 --- a/bungio/models/bungie/fireteam.py +++ b/bungio/models/bungie/fireteam.py @@ -3,7 +3,7 @@ # Instead, change functions / models by subclassing them in the `./overwrites/` folder. They will be used instead. from datetime import datetime -from typing import TYPE_CHECKING, Union +from typing import TYPE_CHECKING, Optional, Union from bungio.models.base import BaseEnum, BaseModel, custom_define, custom_field from bungio.models.mixins import DestinyClanMixin, DestinyUserMixin @@ -82,7 +82,15 @@ class FireteamSummary(BaseModel, DestinyClanMixin): """ _No description given by bungie._ - None + Tip: Manifest Information + This model has some attributes which can be filled with additional information found in the manifest (`manifest_...`). + Without additional work, these attributes will be `None`, since they require additional requests and database lookups. + + To fill the manifest dependent attributes, either: + + - Run `await ThisClass.fetch_manifest_information()`, see [here](/API Reference/Models/base) + - Set `Client.always_return_manifest_information` to `True`, see [here](/API Reference/client) + Attributes: activity_type: _No description given by bungie._ alternate_slot_count: _No description given by bungie._ @@ -97,12 +105,17 @@ class FireteamSummary(BaseModel, DestinyClanMixin): is_public: _No description given by bungie._ is_valid: _No description given by bungie._ locale: _No description given by bungie._ + owner_current_guardian_rank_snapshot: _No description given by bungie._ + owner_highest_lifetime_guardian_rank_snapshot: _No description given by bungie._ owner_membership_id: _No description given by bungie._ + owner_total_commendation_score_snapshot: _No description given by bungie._ platform: _No description given by bungie._ player_slot_count: _No description given by bungie._ scheduled_time: _No description given by bungie._ title: _No description given by bungie._ title_before_moderation: _No description given by bungie._ + manifest_owner_current_guardian_rank_snapshot: Manifest information for `owner_current_guardian_rank_snapshot` + manifest_owner_highest_lifetime_guardian_rank_snapshot: Manifest information for `owner_highest_lifetime_guardian_rank_snapshot` """ activity_type: int = custom_field() @@ -118,12 +131,21 @@ class FireteamSummary(BaseModel, DestinyClanMixin): is_public: bool = custom_field() is_valid: bool = custom_field() locale: str = custom_field() + owner_current_guardian_rank_snapshot: int = custom_field() + owner_highest_lifetime_guardian_rank_snapshot: int = custom_field() owner_membership_id: int = custom_field(metadata={"int64": True}) + owner_total_commendation_score_snapshot: int = custom_field() platform: Union["FireteamPlatform", int] = custom_field(converter=enum_converter("FireteamPlatform")) player_slot_count: int = custom_field() scheduled_time: datetime = custom_field() title: str = custom_field() title_before_moderation: str = custom_field() + manifest_owner_current_guardian_rank_snapshot: Optional[dict] = custom_field( + metadata={"type": """Optional[dict]"""}, default=None + ) + manifest_owner_highest_lifetime_guardian_rank_snapshot: Optional[dict] = custom_field( + metadata={"type": """Optional[dict]"""}, default=None + ) @custom_define() diff --git a/bungio/models/bungie/misc.py b/bungio/models/bungie/misc.py index c3a78b3..5753c67 100644 --- a/bungio/models/bungie/misc.py +++ b/bungio/models/bungie/misc.py @@ -534,6 +534,23 @@ class SingleComponentResponseOfDestinyStringVariablesComponent(BaseModel): privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) +@custom_define() +class SingleComponentResponseOfDestinySocialCommendationsComponent(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + data: _No description given by bungie._ + disabled: If true, this component is disabled. + privacy: _No description given by bungie._ + """ + + data: dict = custom_field(metadata={"type": """dict"""}) + disabled: bool = custom_field() + privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) + + @custom_define() class DictionaryComponentResponseOfint64AndDestinyCharacterComponent(BaseModel): """ @@ -572,6 +589,23 @@ class DictionaryComponentResponseOfint64AndDestinyInventoryComponent(BaseModel): privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) +@custom_define() +class DictionaryComponentResponseOfint64AndDestinyLoadoutsComponent(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + data: _No description given by bungie._ + disabled: If true, this component is disabled. + privacy: _No description given by bungie._ + """ + + data: dict[int, dict] = custom_field(metadata={"type": """dict[int, dict]"""}) + disabled: bool = custom_field() + privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) + + @custom_define() class DictionaryComponentResponseOfint64AndDestinyCharacterProgressionComponent(BaseModel): """ @@ -1136,6 +1170,23 @@ class SingleComponentResponseOfDestinyCharacterActivitiesComponent(BaseModel): privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) +@custom_define() +class SingleComponentResponseOfDestinyLoadoutsComponent(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + data: _No description given by bungie._ + disabled: If true, this component is disabled. + privacy: _No description given by bungie._ + """ + + data: dict = custom_field(metadata={"type": """dict"""}) + disabled: bool = custom_field() + privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) + + @custom_define() class SingleComponentResponseOfDestinyCharacterRecordsComponent(BaseModel): """ diff --git a/bungio/models/mixins/clan.py b/bungio/models/mixins/clan.py index fe2bd3c..80f3f4a 100644 --- a/bungio/models/mixins/clan.py +++ b/bungio/models/mixins/clan.py @@ -456,6 +456,7 @@ async def get_available_clan_fireteams( public_only: Union["FireteamPublicSearchOption", int], slot_filter: Union["FireteamSlotSearch", int], auth: "AuthData", + exclude_immediate: bool, lang_filter: str, ) -> "SearchResultOfFireteamSummary": """ @@ -472,6 +473,7 @@ async def get_available_clan_fireteams( public_only: Determines public/private filtering. slot_filter: Filters based on available slots auth: Authentication information. + exclude_immediate: If you wish the result to exclude immediate fireteams, set this to true. Immediate-only can be forced using the dateRange enum. lang_filter: An optional language filter. Returns: @@ -487,6 +489,7 @@ async def get_available_clan_fireteams( public_only=public_only, slot_filter=slot_filter, auth=auth, + exclude_immediate=exclude_immediate, lang_filter=lang_filter, ) diff --git a/pyproject.toml b/pyproject.toml index ebb237a..a1cdd68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bungio" -version = "0.7.3" +version = "0.8.0" description = "A destiny 2 / bungie api wrapper" keywords = ["asyncio", "destiny", "destiny 2", "bungie", "api"] readme = "README.md"