示例#1
0
    public async ValueTask <BungieResponse <ForumRecruitmentDetail[]> > GetRecruitmentThreadSummaries(
        long[] request,
        CancellationToken cancellationToken = default)
    {
        await using var stream = new MemoryStream();
        await _serializer.SerializeAsync(stream, request);

        return(await _dotNetBungieApiHttpClient
               .PostToBungieNetPlatform <ForumRecruitmentDetail[]>("/Forum/Recruit/Summaries/", cancellationToken,
                                                                   stream)
               .ConfigureAwait(false));
    }
示例#2
0
    public async ValueTask <BungieResponse <UserInfoCard[]> > SearchDestinyPlayerByBungieName(
        BungieMembershipType membershipType,
        ExactSearchRequest request,
        CancellationToken cancellationToken = default)
    {
        var url = StringBuilderPool
                  .GetBuilder(cancellationToken)
                  .Append("/Destiny2/SearchDestinyPlayerByBungieName/")
                  .AddUrlParam(((int)membershipType).ToString())
                  .Build();

        var stream = new MemoryStream();

        await _serializer.SerializeAsync(stream, request).ConfigureAwait(false);

        stream.Position = 0;
        return(await _dotNetBungieApiHttpClient
               .PostToBungieNetPlatform <UserInfoCard[]>(url, cancellationToken, stream)
               .ConfigureAwait(false));
    }
    public async ValueTask <BungieResponse <UserSearchResponse> > SearchByGlobalNamePost(
        UserSearchPrefixRequest request,
        int page = 0,
        CancellationToken cancellationToken = default)
    {
        var url = StringBuilderPool
                  .GetBuilder(cancellationToken)
                  .Append("/User/Search/GlobalName/")
                  .AddUrlParam(page.ToString())
                  .Build();

        using var memoryStream = new MemoryStream();
        await _bungieNetJsonSerializer.SerializeAsync(memoryStream, request).ConfigureAwait(false);

        return(await _dotNetBungieApiHttpClient
               .PostToBungieNetPlatform <UserSearchResponse>(url, cancellationToken, memoryStream).ConfigureAwait(false));
    }
示例#4
0
    public async ValueTask <BungieResponse <GroupSearchResponse> > GroupSearch(
        GroupQuery query,
        CancellationToken cancellationToken = default)
    {
        var stream = new MemoryStream();
        await _serializer.SerializeAsync(stream, query);

        return(await _dotNetBungieApiHttpClient
               .PostToBungieNetPlatform <GroupSearchResponse>("/GroupV2/Search/", cancellationToken, stream)
               .ConfigureAwait(false));
    }