Bungie API Dart support

This project implements Dart definitions and API helpers for the Bungie.net API. It's based on bungie-api-ts that is meant for use in Destiny Item Manager, but should be general enough to use in any project. The code is completely generated from Bungie's documentation - I considered using something like Swagger Codegen, but instead opted for a custom generator so we could make the result as nice as possible.

Install

add this to your dependencies block in pubspec.yaml

dependencies:
  bungie_api: ^2.3.5+3

Interfaces and Enums

There are definitions for every type defined in the Bungie.net services. See their documentation for a list - the interface names are the last part of the full name (for example, Destiny.Definitions.DestinyVendorActionDefinition becomes DestinyVendorActionDefinition). There are a few exceptions, like SingleComponentResponseOfDestinyInventoryComponent, which have been mapped into nicer forms like SingleComponentResponse<DestinyInventoryComponent>, and the server responses, which are now ServerResponse<T> instead of something like DestinyCharacterResponse.

API Helpers

In addition to the types, there are also simple helper functions for each API endpoint. They define the inputs and outputs to that endpoint, and will call a user-provided function with HTTP request info that you can then use to make an HTTP request. This pattern was used so the API helpers could provide full type information. These helpers are not a full API client - they assist in building one. An example:

import 'dart:async';
import 'package:http/http.dart' as http;
import 'package:bungie_api_dart/destiny2.dart';

class BungieApiService{
  Future<ServerResponse<DestinyManifest>> getManifest(){
    return getDestinyManifest(new Client());
  }
}
class Client implements HttpClient{
  static const API_KEY = "your_key";
  @override
    Future<Object> request(HttpClientConfig config) {
      if(config.method == 'GET'){
        return http.get(config.url, headers: {'X-API-Key': API_KEY});
      }
      return http.post(config.url, headers: {'X-API-Key': API_KEY});
    }
}

Build

./install.sh && ./build.sh

Libraries

activity_graph_node_highlight_type_enum
api_usage
api_usage_response
app
application
application_developer
application_scopes_enum
application_status_enum
awa_authorization_result
awa_authorization_result_response
awa_initialize_response
awa_initialize_response_response
awa_permission_requested
awa_response_reason_enum
awa_type_enum
awa_user_response
awa_user_selection_enum
boolean_response
bucket_category_enum
bucket_scope_enum
bungie_membership_type_enum
bungie_net_token
capabilities_enum
cedictionary_ofstring_andstring_response
celist_of_forum_recruitment_detail_response
celist_of_global_alert_response
celist_of_group_optional_conversation_response
celist_of_public_partnership_detail_response
chat_security_setting_enum
clan_banner
comment_summary
community_content
community_content_sort_mode_enum
community_live_status
community_live_status_response
community_status_sort_enum
component_privacy_setting_enum
component_response
content
content_item_public_contract
content_item_public_contract_response
content_preview
content_property_data_type_enum_enum
content_representation
content_type_default_value
content_type_description
content_type_description_response
content_type_property
content_type_property_section
core
core_setting
core_settings_configuration
core_settings_configuration_response
core_system
damage_type_enum
datapoint
date_range
destiny2
destiny2_core_settings
destiny_action_request
destiny_activity
destiny_activity_challenge_definition
destiny_activity_definition
destiny_activity_difficulty_tier_enum
destiny_activity_graph_art_element_definition
destiny_activity_graph_connection_definition
destiny_activity_graph_definition
destiny_activity_graph_display_objective_definition
destiny_activity_graph_display_progression_definition
destiny_activity_graph_list_entry_definition
destiny_activity_graph_node_activity_definition
destiny_activity_graph_node_definition
destiny_activity_graph_node_featuring_state_definition
destiny_activity_graph_node_state_entry
destiny_activity_guided_block_definition
destiny_activity_history_results
destiny_activity_history_results_response
destiny_activity_insertion_point_definition
destiny_activity_loadout_requirement
destiny_activity_loadout_requirement_set
destiny_activity_matchmaking_block_definition
destiny_activity_mode_category_enum
destiny_activity_mode_definition
destiny_activity_mode_type_enum
destiny_activity_modifier_definition
destiny_activity_modifier_reference_definition
destiny_activity_nav_point_type_enum
destiny_activity_playlist_item_definition
destiny_activity_reward_definition
destiny_activity_type_definition
destiny_activity_unlock_string_definition
destiny_aggregate_activity_results
destiny_aggregate_activity_results_response
destiny_aggregate_activity_stats
destiny_ammunition_type_enum
destiny_animation_reference
destiny_art_dye_reference
destiny_base_item_component_set_ofint32
destiny_base_item_component_set_ofint64
destiny_base_item_component_set_ofuint32
destiny_bubble_definition
destiny_challenge_status
destiny_character_action_request
destiny_character_activities_component
destiny_character_component
destiny_character_customization
destiny_character_peer_view
destiny_character_progression_component
destiny_character_records_component
destiny_character_render_component
destiny_character_response
destiny_character_response_response
destiny_checklist_definition
destiny_checklist_entry_definition
destiny_clan_aggregate_stat
destiny_class_definition
destiny_class_enum
destiny_collectible_acquisition_block
destiny_collectible_component
destiny_collectible_definition
destiny_collectible_node_detail_response
destiny_collectible_node_detail_response_response
destiny_collectible_state_block
destiny_collectible_state_enum
destiny_collectibles_component
destiny_color
destiny_component_type_enum
destiny_currencies_component
destiny_damage_type_definition
destiny_definition
destiny_definition_response
destiny_derived_item_category_definition
destiny_derived_item_definition
destiny_destination_bubble_setting_definition
destiny_destination_definition
destiny_display_category_definition
destiny_display_properties_definition
destiny_entity_search_result
destiny_entity_search_result_item
destiny_entity_search_result_response
destiny_environment_location_mapping
destiny_equip_item_result
destiny_equip_item_results
destiny_equip_item_results_response
destiny_equipment_slot_definition
destiny_equipping_block_definition
destiny_error_profile
destiny_faction_definition
destiny_faction_progression
destiny_faction_vendor_definition
destiny_game_versions_enum
destiny_gating_scope_enum
destiny_gear_art_arrangement_reference
destiny_gender_definition
destiny_gender_enum
destiny_graph_node_state_enum
destiny_historical_stats_account_result
destiny_historical_stats_account_result_response
destiny_historical_stats_activity
destiny_historical_stats_by_period
destiny_historical_stats_definition
destiny_historical_stats_per_character
destiny_historical_stats_period_group
destiny_historical_stats_results
destiny_historical_stats_results_response
destiny_historical_stats_value
destiny_historical_stats_value_pair
destiny_historical_stats_with_merged
destiny_historical_weapon_stats
destiny_historical_weapon_stats_data
destiny_historical_weapon_stats_data_response
destiny_insert_plug_action_definition
destiny_insert_plugs_action_request
destiny_insert_plugs_request_entry
destiny_inventory_bucket_definition
destiny_inventory_component
destiny_inventory_item_definition
destiny_inventory_item_stat_definition
destiny_item_action_block_definition
destiny_item_action_request
destiny_item_action_required_item_definition
destiny_item_category_definition
destiny_item_change_response
destiny_item_change_response_response
destiny_item_component
destiny_item_component_set_ofint32
destiny_item_component_set_ofint64
destiny_item_component_set_ofuint32
destiny_item_creation_entry_level_definition
destiny_item_gearset_block_definition
destiny_item_instance_component
destiny_item_intrinsic_socket_entry_definition
destiny_item_inventory_block_definition
destiny_item_investment_stat_definition
destiny_item_objective_block_definition
destiny_item_objectives_component
destiny_item_peer_view
destiny_item_perk_entry_definition
destiny_item_perks_component
destiny_item_plug
destiny_item_plug_component
destiny_item_plug_definition
destiny_item_preview_block_definition
destiny_item_quality_block_definition
destiny_item_quantity
destiny_item_render_component
destiny_item_response
destiny_item_response_response
destiny_item_sack_block_definition
destiny_item_set_action_request
destiny_item_set_block_definition
destiny_item_set_block_entry_definition
destiny_item_socket_block_definition
destiny_item_socket_category_definition
destiny_item_socket_entry_definition
destiny_item_socket_entry_plug_item_definition
destiny_item_socket_entry_plug_item_randomized_definition
destiny_item_socket_state
destiny_item_sockets_component
destiny_item_sort_type_enum
destiny_item_source_block_definition
destiny_item_source_definition
destiny_item_stat_block_definition
destiny_item_state_request
destiny_item_stats_component
destiny_item_sub_type_enum
destiny_item_summary_block_definition
destiny_item_talent_grid_block_definition
destiny_item_talent_grid_component
destiny_item_tier_type_definition
destiny_item_tier_type_infusion_block
destiny_item_transfer_request
destiny_item_translation_block_definition
destiny_item_type_enum
destiny_item_value_block_definition
destiny_item_vendor_source_reference
destiny_kiosk_item
destiny_kiosks_component
destiny_leaderboard
destiny_leaderboard_entry
destiny_leaderboard_results
destiny_leaderboard_results_response
destiny_linked_graph_definition
destiny_linked_graph_entry_definition
destiny_linked_profiles_response
destiny_linked_profiles_response_response
destiny_location_definition
destiny_location_release_definition
destiny_lore_definition
destiny_manifest
destiny_manifest_response
destiny_material_requirement
destiny_material_requirement_set_definition
destiny_milestone
destiny_milestone_activity
destiny_milestone_activity_completion_status
destiny_milestone_activity_definition
destiny_milestone_activity_phase
destiny_milestone_activity_variant
destiny_milestone_activity_variant_definition
destiny_milestone_challenge_activity
destiny_milestone_challenge_activity_definition
destiny_milestone_challenge_activity_graph_node_entry
destiny_milestone_challenge_activity_phase
destiny_milestone_challenge_definition
destiny_milestone_content
destiny_milestone_content_item_category
destiny_milestone_content_response
destiny_milestone_definition
destiny_milestone_quest
destiny_milestone_quest_definition
destiny_milestone_quest_reward_item
destiny_milestone_quest_rewards_definition
destiny_milestone_response
destiny_milestone_reward_category
destiny_milestone_reward_category_definition
destiny_milestone_reward_entry
destiny_milestone_reward_entry_definition
destiny_milestone_type_enum
destiny_milestone_value_definition
destiny_milestone_vendor
destiny_milestone_vendor_definition
destiny_node_activation_requirement
destiny_node_socket_replace_response
destiny_node_step_definition
destiny_objective_definition
destiny_objective_display_properties
destiny_objective_grant_style_enum
destiny_objective_perk_entry_definition
destiny_objective_progress
destiny_objective_stat_entry_definition
destiny_parent_item_override
destiny_perk_reference
destiny_place_definition
destiny_player
destiny_plug_rule_definition
destiny_plug_set_definition
destiny_plug_sets_component
destiny_plug_whitelist_entry_definition
destiny_position_definition
destiny_post_game_carnage_report_data
destiny_post_game_carnage_report_data_response
destiny_post_game_carnage_report_entry
destiny_post_game_carnage_report_extended_data
destiny_post_game_carnage_report_team_entry
destiny_postmaster_transfer_request
destiny_presentation_child_block
destiny_presentation_display_style_enum
destiny_presentation_node_child_entry
destiny_presentation_node_children_block
destiny_presentation_node_collectible_child_entry
destiny_presentation_node_component
destiny_presentation_node_definition
destiny_presentation_node_record_child_entry
destiny_presentation_node_requirements_block
destiny_presentation_node_state_enum
destiny_presentation_node_type_enum
destiny_presentation_nodes_component
destiny_presentation_screen_style_enum
destiny_profile_collectibles_component
destiny_profile_component
destiny_profile_progression_component
destiny_profile_records_component
destiny_profile_response
destiny_profile_response_response
destiny_profile_user_info_card
destiny_progression
destiny_progression_definition
destiny_progression_display_properties_definition
destiny_progression_level_requirement_definition
destiny_progression_mapping_definition
destiny_progression_reward_definition
destiny_progression_scope_enum
destiny_progression_step_definition
destiny_progression_step_display_effect_enum
destiny_public_activity_status
destiny_public_milestone
destiny_public_milestone_activity
destiny_public_milestone_activity_variant
destiny_public_milestone_challenge
destiny_public_milestone_challenge_activity
destiny_public_milestone_quest
destiny_public_milestone_vendor
destiny_public_vendor_component
destiny_public_vendor_sale_item_component
destiny_public_vendors_response
destiny_public_vendors_response_response
destiny_quest_status
destiny_race_definition
destiny_race_enum
destiny_record_completion_block
destiny_record_component
destiny_record_definition
destiny_record_expiration_block
destiny_record_state_enum
destiny_record_title_block
destiny_record_toast_style_enum
destiny_record_value_style_enum
destiny_records_component
destiny_report_offense_pgcr_request
destiny_report_reason_category_definition
destiny_report_reason_definition
destiny_reward_source_category_enum
destiny_reward_source_definition
destiny_sandbox_perk_definition
destiny_scope_enum
destiny_socket_array_type_enum
destiny_socket_category_definition
destiny_socket_category_style_enum
destiny_socket_type_definition
destiny_socket_type_scalar_material_requirement_entry
destiny_socket_visibility_enum
destiny_stat
destiny_stat_aggregation_type_enum
destiny_stat_category_enum
destiny_stat_definition
destiny_stat_display_definition
destiny_stat_group_definition
destiny_stat_override_definition
destiny_stats_category_type_enum
destiny_stats_group_type_enum
destiny_stats_merge_method_enum
destiny_talent_exclusive_group
destiny_talent_grid_definition
destiny_talent_node
destiny_talent_node_category
destiny_talent_node_definition
destiny_talent_node_exclusive_set_definition
destiny_talent_node_stat_block
destiny_talent_node_state_enum
destiny_talent_node_step_damage_types_enum
destiny_talent_node_step_groups
destiny_talent_node_step_guardian_attributes_enum
destiny_talent_node_step_impact_effects_enum
destiny_talent_node_step_light_abilities_enum
destiny_talent_node_step_weapon_performances_enum
destiny_unlock_definition
destiny_unlock_expression_definition
destiny_unlock_status
destiny_unlock_value_definition
destiny_unlock_value_uistyle_enum
destiny_vendor_accepted_item_definition
destiny_vendor_action_definition
destiny_vendor_base_component
destiny_vendor_categories_component
destiny_vendor_category
destiny_vendor_category_entry_definition
destiny_vendor_category_overlay_definition
destiny_vendor_component
destiny_vendor_definition
destiny_vendor_display_properties_definition
destiny_vendor_group
destiny_vendor_group_component
destiny_vendor_group_definition
destiny_vendor_group_reference
destiny_vendor_interaction_definition
destiny_vendor_interaction_reply_definition
destiny_vendor_interaction_reward_selection_enum
destiny_vendor_interaction_sack_entry_definition
destiny_vendor_inventory_flyout_bucket_definition
destiny_vendor_inventory_flyout_definition
destiny_vendor_item_definition
destiny_vendor_item_quantity
destiny_vendor_item_refund_policy_enum
destiny_vendor_item_socket_override
destiny_vendor_item_state_enum
destiny_vendor_location_definition
destiny_vendor_receipt
destiny_vendor_receipts_component
destiny_vendor_reply_type_enum
destiny_vendor_requirement_display_entry_definition
destiny_vendor_response
destiny_vendor_response_response
destiny_vendor_sale_item_action_block_definition
destiny_vendor_sale_item_base_component
destiny_vendor_sale_item_component
destiny_vendor_sale_item_set_component_of_destiny_public_vendor_sale_item_component
destiny_vendor_sale_item_set_component_of_destiny_vendor_sale_item_component
destiny_vendor_service_definition
destiny_vendors_response
destiny_vendors_response_response
developer_role_enum
dictionary_component_response_ofint32_and_destiny_item_instance_component
dictionary_component_response_ofint32_and_destiny_item_objectives_component
dictionary_component_response_ofint32_and_destiny_item_perks_component
dictionary_component_response_ofint32_and_destiny_item_render_component
dictionary_component_response_ofint32_and_destiny_item_sockets_component
dictionary_component_response_ofint32_and_destiny_item_stats_component
dictionary_component_response_ofint32_and_destiny_item_talent_grid_component
dictionary_component_response_ofint32_and_destiny_vendor_sale_item_component
dictionary_component_response_ofint64_and_destiny_character_activities_component
dictionary_component_response_ofint64_and_destiny_character_component
dictionary_component_response_ofint64_and_destiny_character_progression_component
dictionary_component_response_ofint64_and_destiny_character_records_component
dictionary_component_response_ofint64_and_destiny_character_render_component
dictionary_component_response_ofint64_and_destiny_collectibles_component
dictionary_component_response_ofint64_and_destiny_currencies_component
dictionary_component_response_ofint64_and_destiny_inventory_component
dictionary_component_response_ofint64_and_destiny_item_instance_component
dictionary_component_response_ofint64_and_destiny_item_objectives_component
dictionary_component_response_ofint64_and_destiny_item_perks_component
dictionary_component_response_ofint64_and_destiny_item_render_component
dictionary_component_response_ofint64_and_destiny_item_sockets_component
dictionary_component_response_ofint64_and_destiny_item_stats_component
dictionary_component_response_ofint64_and_destiny_item_talent_grid_component
dictionary_component_response_ofint64_and_destiny_kiosks_component
dictionary_component_response_ofint64_and_destiny_plug_sets_component
dictionary_component_response_ofint64_and_destiny_presentation_nodes_component
dictionary_component_response_ofuint32_and_destiny_item_instance_component
dictionary_component_response_ofuint32_and_destiny_item_objectives_component
dictionary_component_response_ofuint32_and_destiny_item_perks_component
dictionary_component_response_ofuint32_and_destiny_item_plug_component
dictionary_component_response_ofuint32_and_destiny_item_render_component
dictionary_component_response_ofuint32_and_destiny_item_sockets_component
dictionary_component_response_ofuint32_and_destiny_item_stats_component
dictionary_component_response_ofuint32_and_destiny_item_talent_grid_component
dictionary_component_response_ofuint32_and_destiny_public_vendor_component
dictionary_component_response_ofuint32_and_destiny_vendor_categories_component
dictionary_component_response_ofuint32_and_destiny_vendor_component
dictionary_component_response_ofuint32_and_personal_destiny_vendor_sale_item_set_component
dictionary_component_response_ofuint32_and_public_destiny_vendor_sale_item_set_component
dictionary_ofint32_andstring_response
dictionary_ofuint32_and_destiny_public_milestone_response
dye_reference
entity_action_result
equip_failure_reason_enum
equipping_item_block_attributes_enum
fireteam
fireteam_activity_type_enum
fireteam_date_range_enum
fireteam_member
fireteam_platform_enum
fireteam_platform_invite_result_enum
fireteam_public_search_option_enum
fireteam_response
fireteam_response_response
fireteam_slot_search_enum
fireteam_summary
forum
forum_flags_enum_enum
forum_media_type_enum
forum_post_category_enums_enum
forum_post_popularity_enum
forum_post_sort_enum_enum
forum_recruitment_detail
forum_recruitment_intensity_label_enum
forum_recruitment_tone_label_enum
forum_topics_category_filters_enum_enum
forum_topics_quick_date_enum_enum
forum_topics_sort_enum_enum
gear_asset_data_base_definition
general_user
general_user_response
global_alert
global_alert_level_enum
global_alert_type_enum
group_alliance_status_enum
group_application_list_request
group_application_request
group_application_resolve_state_enum
group_application_response
group_application_response_response
group_ban
group_ban_request
group_date_range_enum
group_edit_action
group_features
group_homepage_enum
group_member
group_member_application
group_member_count_filter_enum
group_member_leave_result
group_member_leave_result_response
group_membership
group_membership_base
group_membership_search_response
group_membership_search_response_response
group_name_search_request
group_optional_conversation
group_optional_conversation_add_request
group_optional_conversation_edit_request
group_options_edit_action
group_post_publicity_enum
group_potential_member
group_potential_member_status_enum
group_potential_membership
group_potential_membership_search_response
group_potential_membership_search_response_response
group_query
group_response
group_response_response
group_search_response
group_search_response_response
group_sort_by_enum
group_theme
group_type_enum
group_user_base
group_v2
group_v2
group_v2_card
group_v2_clan_info
group_v2_clan_info_and_investment
groups_for_member_filter_enum
host_guided_games_permission_level_enum
http
ienumerable_of_application_response
ienumerable_of_user_info_card_response
ignore_length_enum
ignore_response
ignore_status_enum
image_pyramid_entry
int32_response
int64_response
interpolation_point
interpolation_point_float
inventory_changed_response
item_bind_status_enum
item_location_enum
item_perk_visibility_enum
item_state_enum
list_of_destiny_clan_aggregate_stat_response
list_of_entity_action_result_response
list_of_general_user_response
list_of_group_theme_response
list_of_group_v2_card_response
list_of_tag_response_response
list_of_user_theme_response
membership_option_enum
oauth
oauth_application_type_enum
paged_query
partnership_type_enum
period_type_enum
personal_destiny_vendor_sale_item_set_component
platform_error_codes_enum
plug_availability_mode_enum
plug_ui_styles_enum
poll_response
poll_result
post_response
post_search_response
post_search_response_response
public_destiny_vendor_sale_item_set_component
public_partnership_detail
read_only_dictionary_ofstring_and_destiny_historical_stats_definition_response
runtime_group_member_type_enum
schema_record_state_block
search_result
search_result_of_community_live_status
search_result_of_community_live_status_response
search_result_of_content_item_public_contract
search_result_of_content_item_public_contract_response
search_result_of_destiny_entity_search_result_item
search_result_of_fireteam_response
search_result_of_fireteam_response_response
search_result_of_fireteam_summary
search_result_of_fireteam_summary_response
search_result_of_group_ban
search_result_of_group_ban_response
search_result_of_group_member
search_result_of_group_member_application
search_result_of_group_member_application_response
search_result_of_group_member_response
search_result_of_group_membership
search_result_of_group_potential_membership
search_result_of_group_v2_card
search_result_of_post_response
search_result_of_trending_entry
search_result_of_trending_entry_response
series
single_component_response_of_destiny_character_activities_component
single_component_response_of_destiny_character_component
single_component_response_of_destiny_character_progression_component
single_component_response_of_destiny_character_records_component
single_component_response_of_destiny_character_render_component
single_component_response_of_destiny_collectibles_component
single_component_response_of_destiny_currencies_component
single_component_response_of_destiny_inventory_component
single_component_response_of_destiny_item_component
single_component_response_of_destiny_item_instance_component
single_component_response_of_destiny_item_objectives_component
single_component_response_of_destiny_item_perks_component
single_component_response_of_destiny_item_render_component
single_component_response_of_destiny_item_sockets_component
single_component_response_of_destiny_item_stats_component
single_component_response_of_destiny_item_talent_grid_component
single_component_response_of_destiny_kiosks_component
single_component_response_of_destiny_plug_sets_component
single_component_response_of_destiny_presentation_nodes_component
single_component_response_of_destiny_profile_collectibles_component
single_component_response_of_destiny_profile_component
single_component_response_of_destiny_profile_progression_component
single_component_response_of_destiny_profile_records_component
single_component_response_of_destiny_vendor_categories_component
single_component_response_of_destiny_vendor_component
single_component_response_of_destiny_vendor_group_component
single_component_response_of_destiny_vendor_receipts_component
socket_plug_sources_enum
socket_type_action_type_enum
special_item_type_enum
stream_info
tag_metadata_definition
tag_metadata_item
tag_response
tier_type_enum
transfer_statuses_enum
trending_entry
trending_entry_community_creation
trending_entry_community_stream
trending_entry_destiny_activity
trending_entry_destiny_item
trending_entry_destiny_ritual
trending_entry_news
trending_entry_support_article
trending_entry_type_enum
unit_type_enum
user
user_info_card
user_membership
user_membership_data
user_membership_data_response
user_theme
user_to_user_context
vendor_display_category_sort_order_enum
vendor_interaction_type_enum
vendor_item_status_enum