getMembershipFromHardLinkedCredential static method

Future<HardLinkedUserMembershipResponse> getMembershipFromHardLinkedCredential(
  1. HttpClient client,
  2. String credential,
  3. BungieCredentialType crType
)

Gets any hard linked membership given a credential. Only works for credentials that are public (just SteamID64 right now). Cross Save aware.

Implementation

static Future<HardLinkedUserMembershipResponse> getMembershipFromHardLinkedCredential (
    HttpClient client,
    String credential,
    BungieCredentialType crType,
) async {
    final Map<String, dynamic> params = Map<String, dynamic>();
    final String _credential = '$credential';
    final String _crType = '${crType.value}';
    final HttpClientConfig config = HttpClientConfig('GET', '/User/GetMembershipFromHardLinkedCredential/$_crType/$_credential/', params);
    config.bodyContentType = null;
    final HttpResponse response = await client.request(config);
    if(response.statusCode == 200) {
        return HardLinkedUserMembershipResponse.asyncFromJson(response.mappedBody);
    }
    throw Exception(response.mappedBody);
}