getVendor static method
Future<DestinyVendorResponseResponse>
getVendor(
- HttpClient client,
- String characterId,
- List<
DestinyComponentType> components, - String destinyMembershipId,
- BungieMembershipType membershipType,
- int vendorHash,
Get the details of a specific Vendor.
Implementation
static Future<DestinyVendorResponseResponse> getVendor (
HttpClient client,
String characterId,
List<DestinyComponentType> components,
String destinyMembershipId,
BungieMembershipType membershipType,
int vendorHash,
) async {
final Map<String, dynamic> params = Map<String, dynamic>();
final String _characterId = '$characterId';
final String _destinyMembershipId = '$destinyMembershipId';
final String _membershipType = '${membershipType.value}';
final String _vendorHash = '$vendorHash';
params['components'] = components.map((DestinyComponentType components)=>components.value).toList();
final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/$_membershipType/Profile/$_destinyMembershipId/Character/$_characterId/Vendors/$_vendorHash/', params);
config.bodyContentType = null;
final HttpResponse response = await client.request(config);
if(response.statusCode == 200) {
return DestinyVendorResponseResponse.asyncFromJson(response.mappedBody);
}
throw Exception(response.mappedBody);
}