getItem static method
Future<DestinyItemResponseResponse>
getItem(
- HttpClient client,
- List<
DestinyComponentType> components, - String destinyMembershipId,
- String itemInstanceId,
- BungieMembershipType membershipType,
Retrieve the details of an instanced Destiny Item. An instanced Destiny item is one with an ItemInstanceId. Non-instanced items, such as materials, have no useful instance-specific details and thus are not queryable here.
Implementation
static Future<DestinyItemResponseResponse> getItem (
HttpClient client,
List<DestinyComponentType> components,
String destinyMembershipId,
String itemInstanceId,
BungieMembershipType membershipType,
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _destinyMembershipId = '$destinyMembershipId';
final String _itemInstanceId = '$itemInstanceId';
final String _membershipType = '${membershipType.value}';
params['components'] = components.map((DestinyComponentType components)=>components.value).toList();
final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/$_membershipType/Profile/$_destinyMembershipId/Item/$_itemInstanceId/', params);
config.bodyContentType = null;
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return DestinyItemResponseResponse.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}