getProfile static method

Future<DestinyProfileResponseResponse> getProfile(
  1. HttpClient client,
  2. List<DestinyComponentType> components,
  3. String destinyMembershipId,
  4. BungieMembershipType membershipType,
)

Returns Destiny Profile information for the supplied membership.

Implementation

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