Quests API Models
DestinyObjectiveProgress
Bases: BaseModel
Returns data about a character's status with a given Objective. Combine with DestinyObjectiveDefinition static data for display purposes.
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:
Attributes:
| Name | Type | Description |
|---|---|---|
activity_hash |
int
|
If the Objective has an Activity associated with it, this is the unique identifier of the Activity being referred to. Use to look up the DestinyActivityDefinition in static data. This will give localized data about what you should be playing for the objective to be achieved. |
complete |
bool
|
Whether or not the Objective is completed. |
completion_value |
int
|
As of Forsaken, objectives' completion value is determined dynamically at runtime. This value represents the threshold of progress you need to surpass in order for this objective to be considered "complete". If you were using objective data, switch from using the DestinyObjectiveDefinition's "completionValue" to this value. |
destination_hash |
int
|
If the Objective has a Destination associated with it, this is the unique identifier of the Destination being referred to. Use to look up the DestinyDestinationDefinition in static data. This will give localized data about where in the universe the objective should be achieved. |
objective_hash |
int
|
The unique identifier of the Objective being referred to. Use to look up the DestinyObjectiveDefinition in static data. |
progress |
int
|
If progress has been made, and the progress can be measured numerically, this will be the value of that progress. You can compare it to the DestinyObjectiveDefinition.completionValue property for current vs. upper bounds, and use DestinyObjectiveDefinition.inProgressValueStyle or completedValueStyle to determine how this should be rendered. Note that progress, in Destiny 2, need not be a literal numeric progression. It could be one of a number of possible values, even a Timestamp. Always examine DestinyObjectiveDefinition.inProgressValueStyle or completedValueStyle before rendering progress. |
visible |
bool
|
If this is true, the objective is visible in-game. Otherwise, it's not yet visible to the player. Up to you if you want to honor this property. |
manifest_activity_hash |
Optional[DestinyActivityDefinition]
|
Manifest information for |
manifest_destination_hash |
Optional[DestinyDestinationDefinition]
|
Manifest information for |
manifest_objective_hash |
Optional[DestinyObjectiveDefinition]
|
Manifest information for |
Source code in src/bungio/models/bungie/destiny/quests.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
_convert_to_bungie_case(string)
cached
staticmethod
Convert a string to how it is represented by bungie: my_name_string -> myNameString
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
string
|
str
|
The og string |
required |
Returns:
| Type | Description |
|---|---|
str
|
The bungie string |
Source code in src/bungio/models/base.py
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | |
fetch_manifest_information(include=None, exclude=None, _cache=None)
async
Fill the model in-place with information from the manifest.
Example
Fill every attribute
1 2 3 4 | |
Fill only some attribute
1 2 3 4 | |
1 2 3 4 | |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include
|
Optional[list[str]]
|
A list of attributes you want to include. Excludes everything not mentioned |
None
|
exclude
|
Optional[list[str]]
|
A list of attributes you want to exclude. Includes everything not mentioned |
None
|
Source code in src/bungio/models/base.py
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | |
from_dict(data, client, recursive=False, *args, **kwargs)
async
classmethod
Convert json data to this model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
The json representation of the model, usually received by bungie |
required |
client
|
'Client'
|
The client obj |
required |
recursive
|
bool
|
If this was called recursively |
False
|
Returns:
| Type | Description |
|---|---|
BaseModel
|
The model |
Source code in src/bungio/models/base.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
process_dict(data, client, *args, **kwargs)
staticmethod
Model specific cleanup
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
The json representation of the model, usually received by bungie |
required |
client
|
'Client'
|
The client obj |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Clean json |
Source code in src/bungio/models/base.py
260 261 262 263 264 265 266 267 268 269 270 271 272 | |
to_dict(_return_to_bungie_case=True)
Convert the model into a dict representation bungie accepts
Returns:
| Type | Description |
|---|---|
dict
|
A dict which can be sent to bungie |
Source code in src/bungio/models/base.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |
DestinyQuestStatus
Bases: BaseModel
Data regarding the progress of a Quest for a specific character. Quests are composed of multiple steps, each with potentially multiple objectives: this QuestStatus will return Objective data for the currently active step in this quest.
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:
Attributes:
| Name | Type | Description |
|---|---|---|
completed |
bool
|
Whether or not the whole quest has been completed, regardless of whether or not you have redeemed the rewards for the quest. |
item_instance_id |
int
|
The current Quest Step will be an instanced item in the player's inventory. If you care about that, this is the instance ID of that item. |
quest_hash |
int
|
The hash identifier for the Quest Item. (Note: Quests are defined as Items, and thus you would use this to look up the quest's DestinyInventoryItemDefinition). For information on all steps in the quest, you can then examine its DestinyInventoryItemDefinition.setData property for Quest Steps (which are also items). You can use the Item Definition to display human readable data about the overall quest. |
redeemed |
bool
|
Whether or not you have redeemed rewards for this quest. |
started |
bool
|
Whether or not you have started this quest. |
step_hash |
int
|
The hash identifier of the current Quest Step, which is also a DestinyInventoryItemDefinition. You can use this to get human readable data about the current step and what to do in that step. |
step_objectives |
list[DestinyObjectiveProgress]
|
A step can have multiple objectives. This will give you the progress for each objective in the current step, in the order in which they are rendered in-game. |
tracked |
bool
|
Whether or not the quest is tracked |
vendor_hash |
int
|
If the quest has a related Vendor that you should talk to in order to initiate the quest/earn rewards/continue the quest, this will be the hash identifier of that Vendor. Look it up its DestinyVendorDefinition. |
manifest_quest_hash |
Optional[DestinyInventoryItemDefinition]
|
Manifest information for |
manifest_step_hash |
Optional[DestinyInventoryItemDefinition]
|
Manifest information for |
Source code in src/bungio/models/bungie/destiny/quests.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
_convert_to_bungie_case(string)
cached
staticmethod
Convert a string to how it is represented by bungie: my_name_string -> myNameString
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
string
|
str
|
The og string |
required |
Returns:
| Type | Description |
|---|---|
str
|
The bungie string |
Source code in src/bungio/models/base.py
462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 | |
fetch_manifest_information(include=None, exclude=None, _cache=None)
async
Fill the model in-place with information from the manifest.
Example
Fill every attribute
1 2 3 4 | |
Fill only some attribute
1 2 3 4 | |
1 2 3 4 | |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include
|
Optional[list[str]]
|
A list of attributes you want to include. Excludes everything not mentioned |
None
|
exclude
|
Optional[list[str]]
|
A list of attributes you want to exclude. Includes everything not mentioned |
None
|
Source code in src/bungio/models/base.py
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 | |
from_dict(data, client, recursive=False, *args, **kwargs)
async
classmethod
Convert json data to this model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
The json representation of the model, usually received by bungie |
required |
client
|
'Client'
|
The client obj |
required |
recursive
|
bool
|
If this was called recursively |
False
|
Returns:
| Type | Description |
|---|---|
BaseModel
|
The model |
Source code in src/bungio/models/base.py
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | |
process_dict(data, client, *args, **kwargs)
staticmethod
Model specific cleanup
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
The json representation of the model, usually received by bungie |
required |
client
|
'Client'
|
The client obj |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Clean json |
Source code in src/bungio/models/base.py
260 261 262 263 264 265 266 267 268 269 270 271 272 | |
to_dict(_return_to_bungie_case=True)
Convert the model into a dict representation bungie accepts
Returns:
| Type | Description |
|---|---|
dict
|
A dict which can be sent to bungie |
Source code in src/bungio/models/base.py
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 | |