public async ValueTask <BungieResponse <GroupV2Card[]> > GetRecommendedGroups(
     GroupType groupType,
     GroupDateRange createDateRange,
     CancellationToken token = default)
 {
     return(await _apiAccess.GetRecommendedGroups(_token, groupType, createDateRange, token));
 }
Example #2
0
        public async ValueTask <BungieResponse <GroupV2Card[]> > GetRecommendedGroups(
            AuthorizationTokenData authData,
            GroupType groupType,
            GroupDateRange createDateRange,
            CancellationToken token = default)
        {
            if (!_configuration.Settings.IdentificationSettings.ApplicationScopes.HasFlag(
                    ApplicationScopes.ReadGroups))
            {
                throw new InsufficientScopeException(ApplicationScopes.ReadGroups);
            }

            var url = StringBuilderPool
                      .GetBuilder(token)
                      .Append("/GroupV2/Recommended/")
                      .AddUrlParam(((int)groupType).ToString())
                      .AddUrlParam(((int)createDateRange).ToString())
                      .Build();

            return(await _httpClient.PostToBungieNetPlatform <GroupV2Card[]>(url, token,
                                                                             authToken : authData.AccessToken));
        }