Esempio n. 1
0
        public async ValueTask <BungieResponse <DestinyItemChangeResponse> > InsertSocketPlug(
            DestinyInsertPlugsActionRequest request,
            AuthorizationTokenData authData,
            CancellationToken token = default)
        {
            if (!_configuration.Settings.IdentificationSettings.ApplicationScopes
                .HasFlag(ApplicationScopes.AdvancedWriteActions))
            {
                throw new InsufficientScopeException(ApplicationScopes.AdvancedWriteActions);
            }

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

            return(await _httpClient.PostToBungieNetPlatform <DestinyItemChangeResponse>(
                       "/Destiny2/Actions/Items/InsertSocketPlug/", token, stream, authData.AccessToken));
        }
Esempio n. 2
0
    public async ValueTask <BungieResponse <DestinyItemChangeResponse> > InsertSocketPlug(
        DestinyInsertPlugsActionRequest request,
        AuthorizationTokenData authorizationToken,
        CancellationToken cancellationToken = default)
    {
        if (!_configuration.HasSufficientRights(ApplicationScopes.AdvancedWriteActions))
        {
            throw new InsufficientScopeException(ApplicationScopes.AdvancedWriteActions);
        }

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

        return(await _dotNetBungieApiHttpClient
               .PostToBungieNetPlatform <DestinyItemChangeResponse>("/Destiny2/Actions/Items/InsertSocketPlug/",
                                                                    cancellationToken, stream, authorizationToken.AccessToken)
               .ConfigureAwait(false));
    }
Esempio n. 3
0
 public async ValueTask <BungieResponse <DestinyItemChangeResponse> > InsertSocketPlug(
     DestinyInsertPlugsActionRequest request,
     CancellationToken token = default)
 {
     return(await _apiAccess.InsertSocketPlug(request, _token, token));
 }