searchDestinyPlayerByBungieName static method

Future<IEnumerableOfUserInfoCardResponse> searchDestinyPlayerByBungieName(
  1. HttpClient client,
  2. BungieMembershipType membershipType,
  3. ExactSearchRequest body
)

Returns a list of Destiny memberships given a global Bungie Display Name. This method will hide overridden memberships due to cross save.

Implementation

static Future<IEnumerableOfUserInfoCardResponse> searchDestinyPlayerByBungieName (
    HttpClient client,
    BungieMembershipType membershipType,
    ExactSearchRequest body
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _membershipType = '${membershipType.value}';
    final HttpClientConfig config = HttpClientConfig('POST', '/Destiny2/SearchDestinyPlayerByBungieName/$_membershipType/', params);
    config.body = await body.asyncToJson();
    config.bodyContentType = 'application/json';
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return IEnumerableOfUserInfoCardResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}