Exemple #1
0
        public async ValueTask <BungieResponse <int> > PullFromPostmaster(
            DestinyPostmasterTransferRequest request,
            AuthorizationTokenData authData,
            CancellationToken token = default)
        {
            if (!_configuration.Settings.IdentificationSettings.ApplicationScopes
                .HasFlag(ApplicationScopes.MoveEquipDestinyItems))
            {
                throw new InsufficientScopeException(ApplicationScopes.MoveEquipDestinyItems);
            }

            var stream = new MemoryStream();
            await _serializationHelper.SerializeAsync(stream, request);

            return(await _httpClient.PostToBungieNetPlatform <int>("/Destiny2/Actions/Items/PullFromPostmaster/", token,
                                                                   stream, authData.AccessToken));
        }
Exemple #2
0
    public async ValueTask <BungieResponse <int> > PullFromPostmaster(
        DestinyPostmasterTransferRequest request,
        AuthorizationTokenData authorizationToken,
        CancellationToken cancellationToken = default)
    {
        if (!_configuration.HasSufficientRights(ApplicationScopes.MoveEquipDestinyItems))
        {
            throw new InsufficientScopeException(ApplicationScopes.MoveEquipDestinyItems);
        }

        var stream = new MemoryStream();
        await _serializer.SerializeAsync(stream, request);

        return(await _dotNetBungieApiHttpClient
               .PostToBungieNetPlatform <int>("/Destiny2/Actions/Items/PullFromPostmaster/", cancellationToken, stream,
                                              authorizationToken.AccessToken)
               .ConfigureAwait(false));
    }
Exemple #3
0
 public async ValueTask <BungieResponse <int> > PullFromPostmaster(
     DestinyPostmasterTransferRequest request,
     CancellationToken token = default)
 {
     return(await _apiAccess.PullFromPostmaster(request, _token, token));
 }