Exemplo n.º 1
0
        public async ValueTask <BungieResponse <PostSearchResponse> > GetTopicsPaged(
            ForumPostCategoryEnums categoryFilter,
            ForumTopicsQuickDateEnum quickDate,
            ForumTopicsSortEnum sort, long group,
            int pageSize            = 0,
            int page                = 0,
            string tagstring        = null,
            BungieLocales[] locales = null,
            CancellationToken token = default)
        {
            var url = StringBuilderPool
                      .GetBuilder(token)
                      .Append("/Forum/GetTopicsPaged/")
                      .AddUrlParam(page.ToString())
                      .AddUrlParam(pageSize.ToString())
                      .AddUrlParam(group.ToString())
                      .AddUrlParam(((byte)sort).ToString())
                      .AddUrlParam(((int)quickDate).ToString())
                      .AddUrlParam(((int)categoryFilter).ToString())
                      .AddQueryParam("tagstring", tagstring, () => string.IsNullOrWhiteSpace(tagstring))
                      .AddQueryParam("locales", string.Join(",", locales.Select(x => x.LocaleToString())))
                      .Build();

            return(await _httpClient.GetFromBungieNetPlatform <PostSearchResponse>(url, token));
        }
Exemplo n.º 2
0
        public async ValueTask <BungieResponse <ContentTypeDescription> > GetContentType(
            string type,
            CancellationToken token = default)
        {
            var url = StringBuilderPool
                      .GetBuilder(token)
                      .Append("/Content/GetContentType/")
                      .AddUrlParam(type)
                      .Build();

            return(await _httpClient.GetFromBungieNetPlatform <ContentTypeDescription>(url, token));
        }
Exemplo n.º 3
0
        public async ValueTask <BungieResponse <int> > GetActivePrivateClanFireteamCount(
            AuthorizationTokenData authData,
            long groupId,
            CancellationToken token = default)
        {
            if (!_configuration.Settings.IdentificationSettings.ApplicationScopes.HasFlag(ApplicationScopes.ReadGroups))
            {
                throw new InsufficientScopeException(ApplicationScopes.ReadGroups);
            }

            var url = StringBuilderPool
                      .GetBuilder(token)
                      .Append("/Fireteam/Clan/")
                      .AddUrlParam(groupId.ToString())
                      .Append("ActiveCount/")
                      .Build();

            return(await _httpClient.GetFromBungieNetPlatform <int>(url, token, authData.AccessToken));
        }
Exemplo n.º 4
0
        public async ValueTask <BungieResponse <GeneralUser> > GetBungieNetUserById(
            long id,
            CancellationToken token = default)
        {
            var url = StringBuilderPool
                      .GetBuilder(token)
                      .Append("/User/GetBungieNetUserById/")
                      .AddUrlParam(id.ToString())
                      .Build();

            return(await _httpClient.GetFromBungieNetPlatform <GeneralUser>(url, token));
        }
Exemplo n.º 5
0
        public async ValueTask <BungieResponse <PostSearchResponse> > GetCommunityContent(
            ForumTopicsSortEnum sort,
            ForumMediaType mediaFilter,
            int page = 0,
            CancellationToken token = default)
        {
            var url = StringBuilderPool
                      .GetBuilder(token)
                      .Append("/CommunityContent/Get/")
                      .AddUrlParam(((byte)sort).ToString())
                      .AddUrlParam(((int)mediaFilter).ToString())
                      .AddUrlParam(page.ToString())
                      .Build();

            return(await _httpClient.GetFromBungieNetPlatform <PostSearchResponse>(url, token));
        }
Exemplo n.º 6
0
        public async ValueTask <BungieResponse <PartnerOfferSkuHistoryResponse[]> > GetPartnerOfferSkuHistory(
            AuthorizationTokenData authData,
            int partnerApplicationId,
            long targetBnetMembershipId,
            CancellationToken token = default)
        {
            if (!_configuration.Settings.IdentificationSettings.ApplicationScopes.HasFlag(ApplicationScopes
                                                                                          .PartnerOfferGrant))
            {
                throw new InsufficientScopeException(ApplicationScopes.PartnerOfferGrant);
            }

            var url = StringBuilderPool
                      .GetBuilder(token)
                      .Append("/Tokens/Partner/History/")
                      .AddUrlParam(partnerApplicationId.ToString())
                      .AddUrlParam(targetBnetMembershipId.ToString())
                      .Build();

            return(await _httpClient.GetFromBungieNetPlatform <PartnerOfferSkuHistoryResponse[]>(url, token,
                                                                                                 authData.AccessToken));
        }
Exemplo n.º 7
0
 public async ValueTask <BungieResponse <DestinyManifest> > GetDestinyManifest(
     CancellationToken token = default)
 {
     return(await _httpClient.GetFromBungieNetPlatform <DestinyManifest>("/Destiny2/Manifest/", token));
 }
Exemplo n.º 8
0
 public async ValueTask <BungieResponse <TrendingCategories> > GetTrendingCategories(
     CancellationToken token = default)
 {
     return(await _httpClient.GetFromBungieNetPlatform <TrendingCategories>("/Trending/Categories/", token));
 }
Exemplo n.º 9
0
 public async ValueTask <BungieResponse <Dictionary <string, string> > > GetAvailableLocales(
     CancellationToken token = default)
 {
     return(await _httpClient.GetFromBungieNetPlatform <Dictionary <string, string> >("/GetAvailableLocales/",
                                                                                      token));
 }
Exemplo n.º 10
0
 public async ValueTask <BungieResponse <Application[]> > GetBungieApplications(
     CancellationToken token = default)
 {
     return(await _httpClient.GetFromBungieNetPlatform <Application[]>("/App/FirstParty/", token));
 }