diff --git a/bungio/api/bungie/destiny2.py b/bungio/api/bungie/destiny2.py index afaaa1b..eeb7b64 100644 --- a/bungio/api/bungie/destiny2.py +++ b/bungio/api/bungie/destiny2.py @@ -35,6 +35,8 @@ DestinyItemTransferRequest, DestinyLeaderboard, DestinyLinkedProfilesResponse, + DestinyLoadoutActionRequest, + DestinyLoadoutUpdateActionRequest, DestinyManifest, DestinyMilestone, DestinyMilestoneContent, @@ -522,7 +524,7 @@ 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: + async def equip_loadout(self, data: DestinyLoadoutActionRequest, auth: AuthData) -> int: """ Equip a loadout. You must have a valid Destiny Account, and either be in a social space, in orbit, or offline. @@ -540,7 +542,7 @@ async def equip_loadout(self, data: dict, auth: AuthData) -> int: 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: + async def snapshot_loadout(self, data: DestinyLoadoutUpdateActionRequest, auth: AuthData) -> int: """ Snapshot a loadout with the currently equipped items. @@ -558,7 +560,7 @@ async def snapshot_loadout(self, data: dict, auth: AuthData) -> int: 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: + async def update_loadout_identifiers(self, data: DestinyLoadoutUpdateActionRequest, auth: AuthData) -> int: """ Update the color, icon, and name of a loadout. @@ -578,7 +580,7 @@ async def update_loadout_identifiers(self, data: dict, auth: AuthData) -> int: ) return response["Response"] - async def clear_loadout(self, data: dict, auth: AuthData) -> int: + async def clear_loadout(self, data: DestinyLoadoutActionRequest, auth: AuthData) -> int: """ Clear the identifiers and items of a loadout. diff --git a/bungio/models/bungie/__init__.py b/bungio/models/bungie/__init__.py index d8220ea..ad895d1 100644 --- a/bungio/models/bungie/__init__.py +++ b/bungio/models/bungie/__init__.py @@ -584,6 +584,8 @@ DestinyItemActionRequest, DestinyItemSetActionRequest, DestinyItemStateRequest, + DestinyLoadoutActionRequest, + DestinyLoadoutUpdateActionRequest, DestinyPostmasterTransferRequest, DestinySocketArrayType, ) @@ -729,6 +731,7 @@ DictionaryComponentResponseOfint64AndDestinyItemStatsComponent, DictionaryComponentResponseOfint64AndDestinyItemTalentGridComponent, DictionaryComponentResponseOfint64AndDestinyKiosksComponent, + DictionaryComponentResponseOfint64AndDestinyLoadoutsComponent, DictionaryComponentResponseOfint64AndDestinyPlugSetsComponent, DictionaryComponentResponseOfint64AndDestinyPresentationNodesComponent, DictionaryComponentResponseOfint64AndDestinyStringVariablesComponent, @@ -781,6 +784,7 @@ SingleComponentResponseOfDestinyItemStatsComponent, SingleComponentResponseOfDestinyItemTalentGridComponent, SingleComponentResponseOfDestinyKiosksComponent, + SingleComponentResponseOfDestinyLoadoutsComponent, SingleComponentResponseOfDestinyMetricsComponent, SingleComponentResponseOfDestinyPlatformSilverComponent, SingleComponentResponseOfDestinyPlugSetsComponent, @@ -790,6 +794,7 @@ SingleComponentResponseOfDestinyProfileProgressionComponent, SingleComponentResponseOfDestinyProfileRecordsComponent, SingleComponentResponseOfDestinyProfileTransitoryComponent, + SingleComponentResponseOfDestinySocialCommendationsComponent, SingleComponentResponseOfDestinyStringVariablesComponent, SingleComponentResponseOfDestinyVendorCategoriesComponent, SingleComponentResponseOfDestinyVendorComponent, diff --git a/bungio/models/bungie/common/models.py b/bungio/models/bungie/common/models.py index f34dfea..21826cd 100644 --- a/bungio/models/bungie/common/models.py +++ b/bungio/models/bungie/common/models.py @@ -8,6 +8,8 @@ if TYPE_CHECKING: from bungio.models import ( + DestinyGuardianRankConstantsDefinition, + DestinyLoadoutConstantsDefinition, DestinyPresentationNodeDefinition, DestinySeasonDefinition, DestinyVendorDefinition, @@ -208,15 +210,13 @@ 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_rank_constants_hash: Optional["DestinyGuardianRankConstantsDefinition"] = custom_field( + 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_loadout_constants_hash: Optional["DestinyLoadoutConstantsDefinition"] = custom_field(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/components/loadouts.py b/bungio/models/bungie/destiny/components/loadouts.py new file mode 100644 index 0000000..4e766be --- /dev/null +++ b/bungio/models/bungie/destiny/components/loadouts.py @@ -0,0 +1,77 @@ +# DO NOT CHANGE ANY CODE BELOW +# 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 bungio.models.base import BaseModel, custom_define, custom_field + +if TYPE_CHECKING: + from bungio.models import ( + DestinyLoadoutColorDefinition, + DestinyLoadoutIconDefinition, + DestinyLoadoutNameDefinition, + ) + + +@custom_define() +class DestinyLoadoutsComponent(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + loadouts: _No description given by bungie._ + """ + + loadouts: list["DestinyLoadoutComponent"] = custom_field(metadata={"type": """list[DestinyLoadoutComponent]"""}) + + +@custom_define() +class DestinyLoadoutComponent(BaseModel): + """ + _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) + + Attributes: + color_hash: _No description given by bungie._ + icon_hash: _No description given by bungie._ + items: _No description given by bungie._ + name_hash: _No description given by bungie._ + manifest_color_hash: Manifest information for `color_hash` + manifest_icon_hash: Manifest information for `icon_hash` + manifest_name_hash: Manifest information for `name_hash` + """ + + color_hash: int = custom_field() + icon_hash: int = custom_field() + items: list["DestinyLoadoutItemComponent"] = custom_field( + metadata={"type": """list[DestinyLoadoutItemComponent]"""} + ) + name_hash: int = custom_field() + manifest_color_hash: Optional["DestinyLoadoutColorDefinition"] = custom_field(default=None) + manifest_icon_hash: Optional["DestinyLoadoutIconDefinition"] = custom_field(default=None) + manifest_name_hash: Optional["DestinyLoadoutNameDefinition"] = custom_field(default=None) + + +@custom_define() +class DestinyLoadoutItemComponent(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + item_instance_id: _No description given by bungie._ + plug_item_hashes: _No description given by bungie._ + """ + + item_instance_id: int = custom_field(metadata={"int64": True}) + plug_item_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) diff --git a/bungio/models/bungie/destiny/components/social.py b/bungio/models/bungie/destiny/components/social.py new file mode 100644 index 0000000..a98a8e1 --- /dev/null +++ b/bungio/models/bungie/destiny/components/social.py @@ -0,0 +1,25 @@ +# DO NOT CHANGE ANY CODE BELOW +# 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 bungio.models.base import BaseModel, custom_define, custom_field + + +@custom_define() +class DestinySocialCommendationsComponent(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + commendation_node_scores_by_hash: _No description given by bungie._ + commendation_scores_by_hash: _No description given by bungie._ + score_detail_values: _No description given by bungie._ + total_score: _No description given by bungie._ + """ + + commendation_node_scores_by_hash: dict[int, int] = custom_field(metadata={"type": """dict[int, int]"""}) + commendation_scores_by_hash: dict[int, int] = custom_field(metadata={"type": """dict[int, int]"""}) + score_detail_values: list[int] = custom_field(metadata={"type": """list[int]"""}) + total_score: int = custom_field() diff --git a/bungio/models/bungie/destiny/definitions/guardianranks.py b/bungio/models/bungie/destiny/definitions/guardianranks.py new file mode 100644 index 0000000..83f5bcc --- /dev/null +++ b/bungio/models/bungie/destiny/definitions/guardianranks.py @@ -0,0 +1,128 @@ +# DO NOT CHANGE ANY CODE BELOW +# 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 bungio.models.base import ( + BaseModel, + HashObject, + ManifestModel, + custom_define, + custom_field, +) + +if TYPE_CHECKING: + from bungio.models import ( + DestinyDisplayPropertiesDefinition, + DestinyPresentationNodeDefinition, + ) + + +@custom_define() +class DestinyGuardianRankDefinition(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) + + Attributes: + display_properties: _No description given by bungie._ + foreground_image_path: _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. + overlay_image_path: _No description given by bungie._ + overlay_mask_image_path: _No description given by bungie._ + presentation_node_hash: _No description given by bungie._ + rank_number: _No description given by bungie._ + 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! + manifest_presentation_node_hash: Manifest information for `presentation_node_hash` + """ + + display_properties: "DestinyDisplayPropertiesDefinition" = custom_field() + foreground_image_path: str = custom_field() + index: int = custom_field() + overlay_image_path: str = custom_field() + overlay_mask_image_path: str = custom_field() + presentation_node_hash: int = custom_field() + rank_number: int = custom_field() + redacted: bool = custom_field() + manifest_presentation_node_hash: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) + + +@custom_define() +class DestinyGuardianRankConstantsDefinition(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) + + Attributes: + 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. + icon_backgrounds: _No description given by bungie._ + index: The index of the entity as it was found in the investment tables. + rank_count: _No description given by bungie._ + 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! + root_node_hash: _No description given by bungie._ + manifest_root_node_hash: Manifest information for `root_node_hash` + """ + + display_properties: "DestinyDisplayPropertiesDefinition" = custom_field() + icon_backgrounds: "DestinyGuardianRankIconBackgroundsDefinition" = custom_field() + index: int = custom_field() + rank_count: int = custom_field() + redacted: bool = custom_field() + root_node_hash: int = custom_field() + manifest_root_node_hash: Optional["DestinyPresentationNodeDefinition"] = custom_field(default=None) + + +@custom_define() +class DestinyGuardianRankIconBackgroundsDefinition(BaseModel): + """ + _No description given by bungie._ + + None + Attributes: + background_empty_blue_gradient_bordered_image_path: _No description given by bungie._ + background_empty_bordered_image_path: _No description given by bungie._ + background_filled_blue_bordered_image_path: _No description given by bungie._ + background_filled_blue_gradient_bordered_image_path: _No description given by bungie._ + background_filled_blue_low_alpha_image_path: _No description given by bungie._ + background_filled_blue_medium_alpha_image_path: _No description given by bungie._ + background_filled_gray_heavy_alpha_bordered_image_path: _No description given by bungie._ + background_filled_gray_medium_alpha_bordered_image_path: _No description given by bungie._ + background_filled_white_image_path: _No description given by bungie._ + background_filled_white_medium_alpha_image_path: _No description given by bungie._ + background_plate_black_alpha_image_path: _No description given by bungie._ + background_plate_black_image_path: _No description given by bungie._ + background_plate_white_image_path: _No description given by bungie._ + """ + + background_empty_blue_gradient_bordered_image_path: str = custom_field() + background_empty_bordered_image_path: str = custom_field() + background_filled_blue_bordered_image_path: str = custom_field() + background_filled_blue_gradient_bordered_image_path: str = custom_field() + background_filled_blue_low_alpha_image_path: str = custom_field() + background_filled_blue_medium_alpha_image_path: str = custom_field() + background_filled_gray_heavy_alpha_bordered_image_path: str = custom_field() + background_filled_gray_medium_alpha_bordered_image_path: str = custom_field() + background_filled_white_image_path: str = custom_field() + background_filled_white_medium_alpha_image_path: str = custom_field() + background_plate_black_alpha_image_path: str = custom_field() + background_plate_black_image_path: str = custom_field() + background_plate_white_image_path: str = custom_field() diff --git a/bungio/models/bungie/destiny/definitions/loadouts.py b/bungio/models/bungie/destiny/definitions/loadouts.py new file mode 100644 index 0000000..251e23b --- /dev/null +++ b/bungio/models/bungie/destiny/definitions/loadouts.py @@ -0,0 +1,98 @@ +# DO NOT CHANGE ANY CODE BELOW +# 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 + +from bungio.models.base import HashObject, ManifestModel, custom_define, custom_field + +if TYPE_CHECKING: + from bungio.models import DestinyDisplayPropertiesDefinition + + +@custom_define() +class DestinyLoadoutColorDefinition(ManifestModel, HashObject): + """ + _No description given by bungie._ + + None + Attributes: + color_image_path: _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! + """ + + color_image_path: str = custom_field() + index: int = custom_field() + redacted: bool = custom_field() + + +@custom_define() +class DestinyLoadoutIconDefinition(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. + icon_image_path: _No description given by bungie._ + 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! + """ + + icon_image_path: str = custom_field() + index: int = custom_field() + redacted: bool = custom_field() + + +@custom_define() +class DestinyLoadoutNameDefinition(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. + name: _No description given by bungie._ + 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! + """ + + index: int = custom_field() + name: str = custom_field() + redacted: bool = custom_field() + + +@custom_define() +class DestinyLoadoutConstantsDefinition(ManifestModel, HashObject): + """ + _No description given by bungie._ + + None + Attributes: + black_icon_image_path: This is a color-inverted version of the whiteIconImagePath. + 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. + loadout_color_hashes: A list of the loadout color hashes in index order, for convenience. + loadout_count_per_character: The maximum number of loadouts available to each character. The loadouts component API response can return fewer loadouts than this, as more loadouts are unlocked by reaching higher Guardian Ranks. + loadout_icon_hashes: A list of the loadout icon hashes in index order, for convenience. + loadout_name_hashes: A list of the loadout name hashes in index order, for convenience. + loadout_preview_filter_out_socket_category_hashes: A list of the socket category hashes to be filtered out of loadout item preview displays. + loadout_preview_filter_out_socket_type_hashes: A list of the socket type hashes to be filtered out of loadout item preview displays. + 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! + white_icon_image_path: This is the same icon as the one in the display properties, offered here as well with a more descriptive name. + """ + + black_icon_image_path: str = custom_field() + display_properties: "DestinyDisplayPropertiesDefinition" = custom_field() + index: int = custom_field() + loadout_color_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) + loadout_count_per_character: int = custom_field() + loadout_icon_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) + loadout_name_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) + loadout_preview_filter_out_socket_category_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) + loadout_preview_filter_out_socket_type_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) + redacted: bool = custom_field() + white_icon_image_path: str = custom_field() diff --git a/bungio/models/bungie/destiny/definitions/social.py b/bungio/models/bungie/destiny/definitions/social.py new file mode 100644 index 0000000..dca5c76 --- /dev/null +++ b/bungio/models/bungie/destiny/definitions/social.py @@ -0,0 +1,92 @@ +# DO NOT CHANGE ANY CODE BELOW +# 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 bungio.models.base import HashObject, ManifestModel, custom_define, custom_field + +if TYPE_CHECKING: + from bungio.models import DestinyColor, DestinyDisplayPropertiesDefinition + + +@custom_define() +class DestinySocialCommendationNodeDefinition(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) + + Attributes: + child_commendation_hashes: A list of hashes that map to child commendations. + child_commendation_node_hashes: A list of hashes that map to child commendation nodes. Only the root commendations node is expected to have child nodes. + color: The color associated with this group of commendations. + 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. + parent_commendation_node_hash: _No description given by bungie._ + 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! + manifest_parent_commendation_node_hash: Manifest information for `parent_commendation_node_hash` + """ + + child_commendation_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) + child_commendation_node_hashes: list[int] = custom_field(metadata={"type": """list[int]"""}) + color: "DestinyColor" = custom_field() + display_properties: "DestinyDisplayPropertiesDefinition" = custom_field() + index: int = custom_field() + parent_commendation_node_hash: int = custom_field() + redacted: bool = custom_field() + manifest_parent_commendation_node_hash: Optional["DestinySocialCommendationNodeDefinition"] = custom_field( + default=None + ) + + +@custom_define() +class DestinySocialCommendationDefinition(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) + + Attributes: + activity_giving_limit: _No description given by bungie._ + card_image_path: _No description given by bungie._ + color: _No description given by bungie._ + display_activities: The display properties for the the activities that this commendation is available in. + display_priority: _No description given by bungie._ + 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. + parent_commendation_node_hash: _No description given by bungie._ + 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! + manifest_parent_commendation_node_hash: Manifest information for `parent_commendation_node_hash` + """ + + activity_giving_limit: int = custom_field() + card_image_path: str = custom_field() + color: "DestinyColor" = custom_field() + display_activities: list["DestinyDisplayPropertiesDefinition"] = custom_field( + metadata={"type": """list[DestinyDisplayPropertiesDefinition]"""} + ) + display_priority: int = custom_field() + display_properties: "DestinyDisplayPropertiesDefinition" = custom_field() + index: int = custom_field() + parent_commendation_node_hash: int = custom_field() + redacted: bool = custom_field() + manifest_parent_commendation_node_hash: Optional["DestinySocialCommendationNodeDefinition"] = custom_field( + default=None + ) diff --git a/bungio/models/bungie/destiny/entities/profiles.py b/bungio/models/bungie/destiny/entities/profiles.py index 4180ded..ff52ca3 100644 --- a/bungio/models/bungie/destiny/entities/profiles.py +++ b/bungio/models/bungie/destiny/entities/profiles.py @@ -12,6 +12,7 @@ from bungio.models import ( DestinyEventCardDefinition, DestinyGameVersions, + DestinyGuardianRankDefinition, DestinySeasonDefinition, DestinyVendorReceipt, UserInfoCard, @@ -75,8 +76,6 @@ class DestinyProfileComponent(BaseModel): 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_guardian_rank: Optional["DestinyGuardianRankDefinition"] = custom_field(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 - ) + manifest_lifetime_highest_guardian_rank: Optional["DestinyGuardianRankDefinition"] = custom_field(default=None) diff --git a/bungio/models/bungie/destiny/responses.py b/bungio/models/bungie/destiny/responses.py index 249eec8..64e0a4f 100644 --- a/bungio/models/bungie/destiny/responses.py +++ b/bungio/models/bungie/destiny/responses.py @@ -31,6 +31,7 @@ DictionaryComponentResponseOfint64AndDestinyCurrenciesComponent, DictionaryComponentResponseOfint64AndDestinyInventoryComponent, DictionaryComponentResponseOfint64AndDestinyKiosksComponent, + DictionaryComponentResponseOfint64AndDestinyLoadoutsComponent, DictionaryComponentResponseOfint64AndDestinyPlugSetsComponent, DictionaryComponentResponseOfint64AndDestinyPresentationNodesComponent, DictionaryComponentResponseOfint64AndDestinyStringVariablesComponent, @@ -59,6 +60,7 @@ SingleComponentResponseOfDestinyItemStatsComponent, SingleComponentResponseOfDestinyItemTalentGridComponent, SingleComponentResponseOfDestinyKiosksComponent, + SingleComponentResponseOfDestinyLoadoutsComponent, SingleComponentResponseOfDestinyMetricsComponent, SingleComponentResponseOfDestinyPlatformSilverComponent, SingleComponentResponseOfDestinyPlugSetsComponent, @@ -68,6 +70,7 @@ SingleComponentResponseOfDestinyProfileProgressionComponent, SingleComponentResponseOfDestinyProfileRecordsComponent, SingleComponentResponseOfDestinyProfileTransitoryComponent, + SingleComponentResponseOfDestinySocialCommendationsComponent, SingleComponentResponseOfDestinyStringVariablesComponent, SingleComponentResponseOfDestinyVendorCategoriesComponent, SingleComponentResponseOfDestinyVendorComponent, @@ -206,7 +209,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_loadouts: "DictionaryComponentResponseOfint64AndDestinyLoadoutsComponent" = custom_field() character_plug_sets: "DictionaryComponentResponseOfint64AndDestinyPlugSetsComponent" = custom_field() character_presentation_nodes: "DictionaryComponentResponseOfint64AndDestinyPresentationNodesComponent" = ( custom_field() @@ -224,7 +227,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_commendations: "SingleComponentResponseOfDestinySocialCommendationsComponent" = custom_field() profile_currencies: "SingleComponentResponseOfDestinyInventoryComponent" = custom_field() profile_inventory: "SingleComponentResponseOfDestinyInventoryComponent" = custom_field() profile_kiosks: "SingleComponentResponseOfDestinyKiosksComponent" = custom_field() @@ -271,7 +274,7 @@ class DestinyCharacterResponse(BaseModel): inventory: "SingleComponentResponseOfDestinyInventoryComponent" = custom_field() item_components: "DestinyItemComponentSetOfint64" = custom_field() kiosks: "SingleComponentResponseOfDestinyKiosksComponent" = custom_field() - loadouts: dict = custom_field(metadata={"type": """dict"""}) + loadouts: "SingleComponentResponseOfDestinyLoadoutsComponent" = custom_field() 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 4d51718..bbe28a7 100644 --- a/bungio/models/bungie/fireteam.py +++ b/bungio/models/bungie/fireteam.py @@ -10,7 +10,11 @@ from bungio.utils import enum_converter if TYPE_CHECKING: - from bungio.models import BungieMembershipType, UserInfoCard + from bungio.models import ( + BungieMembershipType, + DestinyGuardianRankDefinition, + UserInfoCard, + ) class FireteamDateRange(BaseEnum): @@ -140,11 +144,11 @@ class FireteamSummary(BaseModel, DestinyClanMixin): 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_current_guardian_rank_snapshot: Optional["DestinyGuardianRankDefinition"] = custom_field( + default=None ) - manifest_owner_highest_lifetime_guardian_rank_snapshot: Optional[dict] = custom_field( - metadata={"type": """Optional[dict]"""}, default=None + manifest_owner_highest_lifetime_guardian_rank_snapshot: Optional["DestinyGuardianRankDefinition"] = custom_field( + default=None ) diff --git a/bungio/models/bungie/misc.py b/bungio/models/bungie/misc.py index 5753c67..5d1da14 100644 --- a/bungio/models/bungie/misc.py +++ b/bungio/models/bungie/misc.py @@ -34,6 +34,7 @@ DestinyItemStatsComponent, DestinyItemTalentGridComponent, DestinyKiosksComponent, + DestinyLoadoutsComponent, DestinyMetricsComponent, DestinyPlatformSilverComponent, DestinyPlugSetsComponent, @@ -45,6 +46,7 @@ DestinyProfileTransitoryComponent, DestinyPublicVendorComponent, DestinyPublicVendorSaleItemComponent, + DestinySocialCommendationsComponent, DestinyStringVariablesComponent, DestinyVendorCategoriesComponent, DestinyVendorComponent, @@ -546,7 +548,7 @@ class SingleComponentResponseOfDestinySocialCommendationsComponent(BaseModel): privacy: _No description given by bungie._ """ - data: dict = custom_field(metadata={"type": """dict"""}) + data: "DestinySocialCommendationsComponent" = custom_field() disabled: bool = custom_field() privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) @@ -601,7 +603,9 @@ class DictionaryComponentResponseOfint64AndDestinyLoadoutsComponent(BaseModel): privacy: _No description given by bungie._ """ - data: dict[int, dict] = custom_field(metadata={"type": """dict[int, dict]"""}) + data: dict[int, "DestinyLoadoutsComponent"] = custom_field( + metadata={"type": """dict[int, DestinyLoadoutsComponent]"""} + ) disabled: bool = custom_field() privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) @@ -1182,7 +1186,7 @@ class SingleComponentResponseOfDestinyLoadoutsComponent(BaseModel): privacy: _No description given by bungie._ """ - data: dict = custom_field(metadata={"type": """dict"""}) + data: "DestinyLoadoutsComponent" = custom_field() disabled: bool = custom_field() privacy: Union["ComponentPrivacySetting", int] = custom_field(converter=enum_converter("ComponentPrivacySetting")) diff --git a/docs/src/API Reference/Models/Bungie API Models/destiny/components/loadouts.md b/docs/src/API Reference/Models/Bungie API Models/destiny/components/loadouts.md new file mode 100644 index 0000000..9c57ba6 --- /dev/null +++ b/docs/src/API Reference/Models/Bungie API Models/destiny/components/loadouts.md @@ -0,0 +1,4 @@ +# Loadouts API Models + + +::: bungio.models.bungie.destiny.components.loadouts diff --git a/docs/src/API Reference/Models/Bungie API Models/destiny/components/social.md b/docs/src/API Reference/Models/Bungie API Models/destiny/components/social.md new file mode 100644 index 0000000..52e1a8d --- /dev/null +++ b/docs/src/API Reference/Models/Bungie API Models/destiny/components/social.md @@ -0,0 +1,4 @@ +# Social API Models + + +::: bungio.models.bungie.destiny.components.social diff --git a/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/guardianranks.md b/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/guardianranks.md new file mode 100644 index 0000000..6df533f --- /dev/null +++ b/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/guardianranks.md @@ -0,0 +1,4 @@ +# Guardianranks API Models + + +::: bungio.models.bungie.destiny.definitions.guardianranks diff --git a/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/loadouts.md b/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/loadouts.md new file mode 100644 index 0000000..1bba987 --- /dev/null +++ b/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/loadouts.md @@ -0,0 +1,4 @@ +# Loadouts API Models + + +::: bungio.models.bungie.destiny.definitions.loadouts diff --git a/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/social.md b/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/social.md new file mode 100644 index 0000000..9235f62 --- /dev/null +++ b/docs/src/API Reference/Models/Bungie API Models/destiny/definitions/social.md @@ -0,0 +1,4 @@ +# Social API Models + + +::: bungio.models.bungie.destiny.definitions.social diff --git a/pyproject.toml b/pyproject.toml index ed72ed5..5876f7a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "bungio" -version = "0.8.1" +version = "0.8.2" description = "A destiny 2 / bungie api wrapper" keywords = ["asyncio", "destiny", "destiny 2", "bungie", "api"] readme = "README.md" diff --git a/todo.md b/todo.md new file mode 100644 index 0000000..84af1ed --- /dev/null +++ b/todo.md @@ -0,0 +1,58 @@ +# todo + +- client attrs: + - user https://bungie-net.github.io/multi/operation_get_Destiny2-GetProfile.html#operation_get_Destiny2-GetProfile + - character https://bungie-net.github.io/multi/operation_get_Destiny2-GetCharacter.html#operation_get_Destiny2-GetCharacter + - 👍 activities https://bungie-net.github.io/multi/operation_get_Destiny2-GetActivityHistory.html#operation_get_Destiny2-GetActivityHistory + - 👍 pgcr https://bungie-net.github.io/multi/operation_get_Destiny2-GetPostGameCarnageReport.html#operation_get_Destiny2-GetPostGameCarnageReport + - aggregate activity stats https://bungie-net.github.io/multi/operation_get_Destiny2-GetDestinyAggregateActivityStats.html#operation_get_Destiny2-GetDestinyAggregateActivityStats + - whatever this is https://bungie-net.github.io/multi/operation_get_Destiny2-GetCollectibleNodeDetails.html#operation_get_Destiny2-GetCollectibleNodeDetails + - move / lock items, etc... + - leaderboards https://bungie-net.github.io/multi/operation_get_Destiny2-GetLeaderboardsForCharacter.html#operation_get_Destiny2-GetLeaderboardsForCharacter + - stats https://bungie-net.github.io/multi/operation_get_Destiny2-GetHistoricalStats.html#operation_get_Destiny2-GetHistoricalStats + - unique weapons https://bungie-net.github.io/multi/operation_get_Destiny2-GetUniqueWeaponHistory.html#operation_get_Destiny2-GetUniqueWeaponHistory + - 👍 clan + - item instance +info + - vendors + - leaderboards https://bungie-net.github.io/multi/operation_get_Destiny2-GetLeaderboards.html#operation_get_Destiny2-GetLeaderboards + - stats https://bungie-net.github.io/multi/operation_get_Destiny2-GetHistoricalStatsForAccount.html#operation_get_Destiny2-GetHistoricalStatsForAccount + - clan + - leaderboards https://bungie-net.github.io/multi/operation_get_Destiny2-GetClanLeaderboards.html#operation_get_Destiny2-GetClanLeaderboards + - aggregate stats https://bungie-net.github.io/multi/operation_get_Destiny2-GetClanAggregateStats.html#operation_get_Destiny2-GetClanAggregateStats + + +# idea: +- bungio + - client + -> convenience methods + - http //done + -> raw http which return json + - bungie + -> convenience methods which return python classes + - models + - bungie //done + -> all automatically generated + - overwrites + -> convenience methods which I wrote which overwrite the automatic ones + -> like that a clan obj has helper methods to get members + -> imports are from the overwrites folder, if that exists- + + + + + +# build steps: +- python -m build --sdist --wheel +- twine upload dist/* -u __token__ + + + + +# what do those mean +- x-dictionary-key +- x-destiny-component-type-dependency + + +# put all manifest models into a specific doc page +# docs for all events +# maybe @listen for events