Skip to content

Commit

Permalink
fix: add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Kigstn committed Mar 12, 2023
1 parent 341cbe0 commit d3d421a
Show file tree
Hide file tree
Showing 19 changed files with 540 additions and 25 deletions.
10 changes: 6 additions & 4 deletions bungio/api/bungie/destiny2.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
DestinyItemTransferRequest,
DestinyLeaderboard,
DestinyLinkedProfilesResponse,
DestinyLoadoutActionRequest,
DestinyLoadoutUpdateActionRequest,
DestinyManifest,
DestinyMilestone,
DestinyMilestoneContent,
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions bungio/models/bungie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@
DestinyItemActionRequest,
DestinyItemSetActionRequest,
DestinyItemStateRequest,
DestinyLoadoutActionRequest,
DestinyLoadoutUpdateActionRequest,
DestinyPostmasterTransferRequest,
DestinySocketArrayType,
)
Expand Down Expand Up @@ -729,6 +731,7 @@
DictionaryComponentResponseOfint64AndDestinyItemStatsComponent,
DictionaryComponentResponseOfint64AndDestinyItemTalentGridComponent,
DictionaryComponentResponseOfint64AndDestinyKiosksComponent,
DictionaryComponentResponseOfint64AndDestinyLoadoutsComponent,
DictionaryComponentResponseOfint64AndDestinyPlugSetsComponent,
DictionaryComponentResponseOfint64AndDestinyPresentationNodesComponent,
DictionaryComponentResponseOfint64AndDestinyStringVariablesComponent,
Expand Down Expand Up @@ -781,6 +784,7 @@
SingleComponentResponseOfDestinyItemStatsComponent,
SingleComponentResponseOfDestinyItemTalentGridComponent,
SingleComponentResponseOfDestinyKiosksComponent,
SingleComponentResponseOfDestinyLoadoutsComponent,
SingleComponentResponseOfDestinyMetricsComponent,
SingleComponentResponseOfDestinyPlatformSilverComponent,
SingleComponentResponseOfDestinyPlugSetsComponent,
Expand All @@ -790,6 +794,7 @@
SingleComponentResponseOfDestinyProfileProgressionComponent,
SingleComponentResponseOfDestinyProfileRecordsComponent,
SingleComponentResponseOfDestinyProfileTransitoryComponent,
SingleComponentResponseOfDestinySocialCommendationsComponent,
SingleComponentResponseOfDestinyStringVariablesComponent,
SingleComponentResponseOfDestinyVendorCategoriesComponent,
SingleComponentResponseOfDestinyVendorComponent,
Expand Down
10 changes: 5 additions & 5 deletions bungio/models/bungie/common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

if TYPE_CHECKING:
from bungio.models import (
DestinyGuardianRankConstantsDefinition,
DestinyLoadoutConstantsDefinition,
DestinyPresentationNodeDefinition,
DestinySeasonDefinition,
DestinyVendorDefinition,
Expand Down Expand Up @@ -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)
Expand Down
77 changes: 77 additions & 0 deletions bungio/models/bungie/destiny/components/loadouts.py
Original file line number Diff line number Diff line change
@@ -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]"""})
25 changes: 25 additions & 0 deletions bungio/models/bungie/destiny/components/social.py
Original file line number Diff line number Diff line change
@@ -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()
128 changes: 128 additions & 0 deletions bungio/models/bungie/destiny/definitions/guardianranks.py
Original file line number Diff line number Diff line change
@@ -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()
Loading

0 comments on commit d3d421a

Please sign in to comment.