getPublicVendors static method

Get items available from vendors where the vendors have items for sale that are common for everyone. If any portion of the Vendor's available inventory is character or account specific, we will be unable to return their data from this endpoint due to the way that available inventory is computed. As I am often guilty of saying: 'It's a long story...'

Implementation

static Future<DestinyPublicVendorsResponseResponse> getPublicVendors (
    HttpClient client,
    List<DestinyComponentType> components,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    params['components'] = components.map((DestinyComponentType components)=>components.value).toList();
    final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/Vendors/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return DestinyPublicVendorsResponseResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}