Source code for bungieapi.generated.components.schemas.destiny.definitions.records

# generated by update to not change manually
import dataclasses as dt
import typing as t

from bungieapi.json import to_json


[docs]@dt.dataclass(frozen=True) class DestinyRecordDefinition: completion_info: t.Optional["DestinyRecordCompletionBlock"] = None display_properties: t.Optional["DestinyDisplayPropertiesDefinition"] = None expiration_info: t.Optional["DestinyRecordExpirationBlock"] = None for_title_gilding: t.Optional[bool] = None hash: t.Optional[ int ] = None # 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: t.Optional[ int ] = None # The index of the entity as it was found in the investment tables. interval_info: t.Optional[ "DestinyRecordIntervalBlock" ] = None # Some records have multiple 'interval' objectives, and the record may be claimed at each completed interval lore_hash: t.Optional[int] = None objective_hashes: t.Optional[t.Sequence[int]] = None parent_node_hashes: t.Optional[ t.Sequence[int] ] = None # A quick reference to presentation nodes that have this node as a child. Presentation nodes can be parented under multiple parents. presentation_info: t.Optional["DestinyPresentationChildBlock"] = None presentation_node_type: t.Optional["DestinyPresentationNodeType"] = None record_value_style: t.Optional["DestinyRecordValueStyle"] = None redacted: t.Optional[ bool ] = None # If this is true, then there is an entity with this identifier/type combination, but BNet is not yet allowed to show it. Sorry! requirements: t.Optional["DestinyPresentationNodeRequirementsBlock"] = None reward_items: t.Optional[ t.Sequence["DestinyItemQuantity"] ] = None # If there is any publicly available information about rewards earned for achieving this record, this is the list of those items. However, note that some records intentionally have "hidden" rewards. These will not be returned in this list. scope: t.Optional[ "DestinyScope" ] = None # Indicates whether this Record's state is determined on a per-character or on an account-wide basis. state_info: t.Optional["SchemaRecordStateBlock"] = None title_info: t.Optional["DestinyRecordTitleBlock"] = None trait_hashes: t.Optional[t.Sequence[int]] = None trait_ids: t.Optional[t.Sequence[str]] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]: return { "displayProperties": to_json(self.display_properties), "scope": to_json(self.scope), "presentationInfo": to_json(self.presentation_info), "loreHash": to_json(self.lore_hash), "objectiveHashes": to_json(self.objective_hashes), "recordValueStyle": to_json(self.record_value_style), "forTitleGilding": to_json(self.for_title_gilding), "titleInfo": to_json(self.title_info), "completionInfo": to_json(self.completion_info), "stateInfo": to_json(self.state_info), "requirements": to_json(self.requirements), "expirationInfo": to_json(self.expiration_info), "intervalInfo": to_json(self.interval_info), "rewardItems": to_json(self.reward_items), "presentationNodeType": to_json(self.presentation_node_type), "traitIds": to_json(self.trait_ids), "traitHashes": to_json(self.trait_hashes), "parentNodeHashes": to_json(self.parent_node_hashes), "hash": to_json(self.hash), "index": to_json(self.index), "redacted": to_json(self.redacted), }
[docs]@dt.dataclass(frozen=True) class DestinyRecordTitleBlock: gilding_tracking_record_hash: t.Optional[int] = None has_title: t.Optional[bool] = None titles_by_gender: t.Optional[t.Mapping[str, str]] = None titles_by_gender_hash: t.Optional[ t.Mapping[str, str] ] = None # For those who prefer to use the definitions.
[docs] def to_json(self) -> t.Mapping[str, t.Any]: return { "hasTitle": to_json(self.has_title), "titlesByGender": to_json(self.titles_by_gender), "titlesByGenderHash": to_json(self.titles_by_gender_hash), "gildingTrackingRecordHash": to_json(self.gilding_tracking_record_hash), }
[docs]@dt.dataclass(frozen=True) class DestinyRecordCompletionBlock: score_value: t.Optional[int] = None partial_completion_objective_count_threshold: t.Optional[ int ] = None # The number of objectives that must be completed before the objective is considered "complete" should_fire_toast: t.Optional[bool] = None toast_style: t.Optional["DestinyRecordToastStyle"] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]: return { "partialCompletionObjectiveCountThreshold": to_json( self.partial_completion_objective_count_threshold ), "ScoreValue": to_json(self.score_value), "shouldFireToast": to_json(self.should_fire_toast), "toastStyle": to_json(self.toast_style), }
[docs]@dt.dataclass(frozen=True) class SchemaRecordStateBlock: featured_priority: t.Optional[int] = None obscured_string: t.Optional[str] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]: return { "featuredPriority": to_json(self.featured_priority), "obscuredString": to_json(self.obscured_string), }
[docs]@dt.dataclass(frozen=True) class DestinyRecordExpirationBlock: """If this record has an expiration after which it cannot be earned, this is some information about that expiration.""" description: t.Optional[str] = None has_expiration: t.Optional[bool] = None icon: t.Optional[str] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]: return { "hasExpiration": to_json(self.has_expiration), "description": to_json(self.description), "icon": to_json(self.icon), }
[docs]@dt.dataclass(frozen=True) class DestinyRecordIntervalBlock: interval_objectives: t.Optional[t.Sequence["DestinyRecordIntervalObjective"]] = None interval_rewards: t.Optional[t.Sequence["DestinyRecordIntervalRewards"]] = None original_objective_array_insertion_index: t.Optional[int] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]: return { "intervalObjectives": to_json(self.interval_objectives), "intervalRewards": to_json(self.interval_rewards), "originalObjectiveArrayInsertionIndex": to_json( self.original_objective_array_insertion_index ), }
[docs]@dt.dataclass(frozen=True) class DestinyRecordIntervalObjective: interval_objective_hash: t.Optional[int] = None interval_score_value: t.Optional[int] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]: return { "intervalObjectiveHash": to_json(self.interval_objective_hash), "intervalScoreValue": to_json(self.interval_score_value), }
[docs]@dt.dataclass(frozen=True) class DestinyRecordIntervalRewards: interval_reward_items: t.Optional[t.Sequence["DestinyItemQuantity"]] = None
[docs] def to_json(self) -> t.Mapping[str, t.Any]: return { "intervalRewardItems": to_json(self.interval_reward_items), }
from bungieapi.generated.components.schemas.destiny import ( DestinyItemQuantity, ) # noqa: E402 from bungieapi.generated.components.schemas.destiny import ( DestinyPresentationNodeType, ) # noqa: E402 from bungieapi.generated.components.schemas.destiny import ( DestinyRecordToastStyle, ) # noqa: E402 from bungieapi.generated.components.schemas.destiny import ( DestinyRecordValueStyle, ) # noqa: E402 from bungieapi.generated.components.schemas.destiny import DestinyScope # noqa: E402 # imported at the end to do not case circular imports for type annotations from bungieapi.generated.components.schemas.destiny.definitions.common import ( DestinyDisplayPropertiesDefinition, ) # noqa: E402 from bungieapi.generated.components.schemas.destiny.definitions.presentation import ( DestinyPresentationChildBlock, ) # noqa: E402 from bungieapi.generated.components.schemas.destiny.definitions.presentation import ( DestinyPresentationNodeRequirementsBlock, ) # noqa: E402