getLinkedProfiles static method

Future<DestinyLinkedProfilesResponseResponse> getLinkedProfiles(
  1. HttpClient client,
  2. bool getAllMemberships,
  3. String membershipId,
  4. BungieMembershipType membershipType,
)

Returns a summary information about all profiles linked to the requesting membership type/membership ID that have valid Destiny information. The passed-in Membership Type/Membership ID may be a Bungie.Net membership or a Destiny membership. It only returns the minimal amount of data to begin making more substantive requests, but will hopefully serve as a useful alternative to UserServices for people who just care about Destiny data. Note that it will only return linked accounts whose linkages you are allowed to view.

Implementation

static Future<DestinyLinkedProfilesResponseResponse> getLinkedProfiles (
    HttpClient client,
    bool getAllMemberships,
    String membershipId,
    BungieMembershipType membershipType,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _membershipId = '$membershipId';
    final String _membershipType = '${membershipType.value}';
    params['getAllMemberships'] = getAllMemberships;
    final HttpClientConfig config = HttpClientConfig('GET', '/Destiny2/$_membershipType/Profile/$_membershipId/LinkedProfiles/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return DestinyLinkedProfilesResponseResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}