Skip to content

Commit

Permalink
gen for API v2.18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Cytraen committed Oct 13, 2023
1 parent 7b5123c commit d1ab4d9
Show file tree
Hide file tree
Showing 22 changed files with 459 additions and 1,648 deletions.
9 changes: 6 additions & 3 deletions BungieSharper.Entities/Content/Entities.Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ public class CommentSummary

public class NewsArticleRssResponse
{
[JsonPropertyName("NewsArticles")]
public IEnumerable<Content.NewsArticleRssItem> NewsArticles { get; set; }

[JsonPropertyName("CurrentPaginationToken")]
public int CurrentPaginationToken { get; set; }

Expand All @@ -93,8 +90,14 @@ public class NewsArticleRssResponse
[JsonPropertyName("ResultCountThisPage")]
public int ResultCountThisPage { get; set; }

[JsonPropertyName("NewsArticles")]
public IEnumerable<Content.NewsArticleRssItem> NewsArticles { get; set; }

[JsonPropertyName("CategoryFilter")]
public string CategoryFilter { get; set; }

[JsonPropertyName("PagerAction")]
public string PagerAction { get; set; }
}

public class NewsArticleRssItem
Expand Down
3 changes: 3 additions & 0 deletions BungieSharper.Entities/Destiny/Entities.Destiny.Artifacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,7 @@ public class DestinyArtifactTierItem

[JsonPropertyName("isActive")]
public bool IsActive { get; set; }

[JsonPropertyName("isVisible")]
public bool IsVisible { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ public class DestinySocialCommendationsComponent
[JsonPropertyName("totalScore")]
public int TotalScore { get; set; }

/// <summary>The percentage for each commendation type out of total received</summary>
[JsonPropertyName("commendationNodePercentagesByHash")]
public Dictionary<uint, uint> CommendationNodePercentagesByHash { get; set; }

[JsonPropertyName("scoreDetailValues")]
public IEnumerable<int> ScoreDetailValues { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Text.Json.Serialization;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace BungieSharper.Entities.Destiny.Definitions.GuardianRanks;

Expand Down Expand Up @@ -46,6 +47,9 @@ public class DestinyGuardianRankConstantsDefinition
[JsonPropertyName("rankCount")]
public int RankCount { get; set; }

[JsonPropertyName("guardianRankHashes")]
public IEnumerable<uint> GuardianRankHashes { get; set; }

[JsonPropertyName("rootNodeHash")]
public uint RootNodeHash { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public class DestinyRecordDefinition
[JsonPropertyName("rewardItems")]
public IEnumerable<Destiny.DestinyItemQuantity> RewardItems { get; set; }

/// <summary>A display name for the type of record this is (Triumphs, Lore, Medals, Seasonal Challenge, etc.).</summary>
[JsonPropertyName("recordTypeName")]
public string RecordTypeName { get; set; }

[JsonPropertyName("presentationNodeType")]
public Destiny.DestinyPresentationNodeType PresentationNodeType { get; set; }

Expand Down Expand Up @@ -125,8 +129,13 @@ public class SchemaRecordStateBlock
[JsonPropertyName("featuredPriority")]
public int FeaturedPriority { get; set; }

[JsonPropertyName("obscuredString")]
public string ObscuredString { get; set; }
/// <summary>A display name override to show when this record is 'obscured' instead of the default obscured display name.</summary>
[JsonPropertyName("obscuredName")]
public string ObscuredName { get; set; }

/// <summary>A display description override to show when this record is 'obscured' instead of the default obscured display description.</summary>
[JsonPropertyName("obscuredDescription")]
public string ObscuredDescription { get; set; }
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public class DestinySocialCommendationNodeDefinition
[JsonPropertyName("color")]
public Destiny.Misc.DestinyColor Color { get; set; }

/// <summary>A version of the displayProperties icon tinted with the color of this node.</summary>
[JsonPropertyName("tintedIcon")]
public string TintedIcon { get; set; }

[JsonPropertyName("parentCommendationNodeHash")]
public uint ParentCommendationNodeHash { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion BungieSharper.Entities/Destiny/Entities.Destiny.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ public enum DestinyRecordState : int
/// <summary>If this is set, the objective for this Record has not yet been completed.</summary>
ObjectiveNotCompleted = 4,

/// <summary>If this is set, the game recommends that you replace the display text of this Record with DestinyRecordDefinition.stateInfo.obscuredString.</summary>
/// <summary>If this is set, the game recommends that you replace the display text of this Record with DestinyRecordDefinition.stateInfo.obscuredDescription.</summary>
Obscured = 8,

/// <summary>If this is set, the game recommends that you not show this record. Do what you will with this recommendation.</summary>
Expand Down
1 change: 1 addition & 0 deletions BungieSharper.Entities/Exceptions/Entities.Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ public enum PlatformErrorCodes : int
MessagingSenderIsBanned = 311,
MessagingGroupOptionalChatExceededMaximum = 312,
PrivateMessagingRequiresDestinyMembership = 313,
MessagingSendDailyThrottle = 314,
AddSurveyAnswersUnknownSqlException = 400,
ForumBodyCannotBeEmpty = 500,
ForumSubjectCannotBeEmptyOnTopicPost = 501,
Expand Down
8 changes: 8 additions & 0 deletions BungieSharper.Entities/GroupsV2/Entities.GroupsV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ public class GroupV2
[JsonPropertyName("features")]
public GroupsV2.GroupFeatures Features { get; set; }

[JsonPropertyName("remoteGroupId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public long? RemoteGroupId { get; set; }

[JsonPropertyName("clanInfo")]
public GroupsV2.GroupV2ClanInfoAndInvestment ClanInfo { get; set; }
}
Expand Down Expand Up @@ -474,6 +478,10 @@ public class GroupV2Card
[JsonPropertyName("capabilities")]
public GroupsV2.Capabilities Capabilities { get; set; }

[JsonPropertyName("remoteGroupId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public long? RemoteGroupId { get; set; }

[JsonPropertyName("clanInfo")]
public GroupsV2.GroupV2ClanInfo ClanInfo { get; set; }

Expand Down
115 changes: 115 additions & 0 deletions BungieSharper/Client/JsonContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
using BungieSharper.Entities;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace BungieSharper.Endpoints;

[JsonSerializable(typeof(ApiResponse<Entities.Applications.ApiUsage>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.Applications.Application>>))]
[JsonSerializable(typeof(ApiResponse<Entities.User.GeneralUser>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<byte, string>>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.User.Models.GetCredentialTypesForAccountResponse>>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.Config.UserTheme>>))]
[JsonSerializable(typeof(ApiResponse<Entities.User.UserMembershipData>))]
[JsonSerializable(typeof(ApiResponse<Entities.User.HardLinkedUserMembership>))]
[JsonSerializable(typeof(ApiResponse<Entities.User.UserSearchResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Content.Models.ContentTypeDescription>))]
[JsonSerializable(typeof(ApiResponse<Entities.Content.ContentItemPublicContract>))]
[JsonSerializable(typeof(ApiResponse<Entities.SearchResultOfContentItemPublicContract>))]
[JsonSerializable(typeof(ApiResponse<object>))]
[JsonSerializable(typeof(ApiResponse<Entities.Content.NewsArticleRssResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Forum.PostSearchResponse>))]
[JsonSerializable(typeof(ApiResponse<long>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.Tags.Models.Contracts.TagResponse>>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.Forum.ForumRecruitmentDetail>>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<int, string>>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.Config.GroupTheme>>))]
[JsonSerializable(typeof(ApiResponse<bool>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.GroupsV2.GroupV2Card>>))]
[JsonSerializable(typeof(ApiResponse<Entities.GroupsV2.GroupSearchResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.GroupsV2.GroupResponse>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.GroupsV2.GroupOptionalConversation>>))]
[JsonSerializable(typeof(ApiResponse<int>))]
[JsonSerializable(typeof(ApiResponse<Entities.SearchResultOfGroupMember>))]
[JsonSerializable(typeof(ApiResponse<Entities.GroupsV2.GroupMemberLeaveResult>))]
[JsonSerializable(typeof(ApiResponse<Entities.SearchResultOfGroupBan>))]
[JsonSerializable(typeof(ApiResponse<Entities.SearchResultOfGroupMemberApplication>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.Entities.EntityActionResult>>))]
[JsonSerializable(typeof(ApiResponse<Entities.GroupsV2.GetGroupsForMemberResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.GroupsV2.GroupMembershipSearchResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.GroupsV2.GroupPotentialMembershipSearchResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.GroupsV2.GroupApplicationResponse>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.Tokens.PartnerOfferSkuHistoryResponse>>))]
[JsonSerializable(typeof(ApiResponse<Entities.Tokens.PartnerRewardHistoryResponse>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<string, Entities.Tokens.BungieRewardDisplay>>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Config.DestinyManifest>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Definitions.DestinyDefinition>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.User.UserInfoCard>>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyLinkedProfilesResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyProfileResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyCharacterResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Milestones.DestinyMilestone>))]
[JsonSerializable(typeof(ApiResponse<Entities.Config.ClanBanner.ClanBannerSource>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyItemResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyVendorsResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyVendorResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyPublicVendorsResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyCollectibleNodeDetailResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.DestinyEquipItemResults>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Responses.DestinyItemChangeResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.HistoricalStats.DestinyPostGameCarnageReportData>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<string, Entities.Destiny.HistoricalStats.Definitions.DestinyHistoricalStatsDefinition>>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<string, Dictionary<string, Entities.Destiny.HistoricalStats.DestinyLeaderboard>>>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.Destiny.HistoricalStats.DestinyClanAggregateStat>>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Definitions.DestinyEntitySearchResult>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<string, Entities.Destiny.HistoricalStats.DestinyHistoricalStatsByPeriod>>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.HistoricalStats.DestinyHistoricalStatsAccountResult>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.HistoricalStats.DestinyActivityHistoryResults>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.HistoricalStats.DestinyHistoricalWeaponStatsData>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.HistoricalStats.DestinyAggregateActivityResults>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Milestones.DestinyMilestoneContent>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<uint, Entities.Destiny.Milestones.DestinyPublicMilestone>>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Advanced.AwaInitializeResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Destiny.Advanced.AwaAuthorizationResult>))]
[JsonSerializable(typeof(ApiResponse<Entities.Trending.TrendingCategories>))]
[JsonSerializable(typeof(ApiResponse<Entities.SearchResultOfTrendingEntry>))]
[JsonSerializable(typeof(ApiResponse<Entities.Trending.TrendingDetail>))]
[JsonSerializable(typeof(ApiResponse<Entities.SearchResultOfFireteamSummary>))]
[JsonSerializable(typeof(ApiResponse<Entities.SearchResultOfFireteamResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Fireteam.FireteamResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Social.Friends.BungieFriendListResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Social.Friends.BungieFriendRequestListResponse>))]
[JsonSerializable(typeof(ApiResponse<Entities.Social.Friends.PlatformFriendResponse>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<string, string>>))]
[JsonSerializable(typeof(ApiResponse<Entities.Common.Models.CoreSettingsConfiguration>))]
[JsonSerializable(typeof(ApiResponse<Dictionary<string, Entities.Common.Models.CoreSystem>>))]
[JsonSerializable(typeof(ApiResponse<IEnumerable<Entities.GlobalAlert>>))]
[JsonSerializable(typeof(Entities.User.UserSearchPrefixRequest))]
[JsonSerializable(typeof(IEnumerable<long>))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupQuery))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupNameSearchRequest))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupEditAction))]
[JsonSerializable(typeof(Entities.GroupsV2.ClanBanner))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupOptionsEditAction))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupOptionalConversationAddRequest))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupOptionalConversationEditRequest))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupBanRequest))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupApplicationRequest))]
[JsonSerializable(typeof(Entities.GroupsV2.GroupApplicationListRequest))]
[JsonSerializable(typeof(Entities.Tokens.PartnerOfferClaimRequest))]
[JsonSerializable(typeof(Entities.User.ExactSearchRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.DestinyItemTransferRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.Actions.DestinyPostmasterTransferRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.Actions.DestinyItemActionRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.Actions.DestinyItemSetActionRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.Actions.DestinyLoadoutActionRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.Actions.DestinyLoadoutUpdateActionRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.Actions.DestinyItemStateRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.Actions.DestinyInsertPlugsActionRequest))]
[JsonSerializable(typeof(Entities.Destiny.Requests.Actions.DestinyInsertPlugsFreeActionRequest))]
[JsonSerializable(typeof(Entities.Destiny.Reporting.Requests.DestinyReportOffensePgcrRequest))]
[JsonSerializable(typeof(Entities.Destiny.Advanced.AwaPermissionRequested))]
[JsonSerializable(typeof(Entities.Destiny.Advanced.AwaUserResponse))]
[JsonSerializable(typeof(ApiResponse))]
[JsonSerializable(typeof(TokenResponse))]
internal partial class BungieSharperDeserializeJsonContext : JsonSerializerContext { }
28 changes: 4 additions & 24 deletions BungieSharper/Endpoints/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,8 @@ public partial class Endpoints
/// <param name="cancelToken">The <see cref="CancellationToken" /> to observe.</param>
public Task<Entities.Applications.ApiUsage> App_GetApplicationApiUsage(int applicationId, DateTime? end = null, DateTime? start = null, string? authToken = null, CancellationToken cancelToken = default)
{
return _apiAccessor.ApiRequestAsync<Entities.Applications.ApiUsage>(
new Uri($"App/ApiUsage/{applicationId}/" + HttpRequestGenerator.MakeQuerystring(end != null ? $"end={end}" : null, start != null ? $"start={start}" : null), UriKind.Relative),
null, HttpMethod.Get, authToken, cancelToken
);
}

/// <inheritdoc cref="App_GetApplicationApiUsage(int, DateTime?, DateTime?, string?, CancellationToken)" />
/// <typeparam name="T">The custom type to deserialize to.</typeparam>
public Task<T> App_GetApplicationApiUsage<T>(int applicationId, DateTime? end = null, DateTime? start = null, string? authToken = null, CancellationToken cancelToken = default)
{
return _apiAccessor.ApiRequestAsync<T>(
new Uri($"App/ApiUsage/{applicationId}/" + HttpRequestGenerator.MakeQuerystring(end != null ? $"end={end}" : null, start != null ? $"start={start}" : null), UriKind.Relative),
return _apiAccessor.ApiRequestAsync(
new Uri($"App/ApiUsage/{applicationId}/" + HttpRequestGenerator.MakeQuerystring(end != null ? $"end={end}" : null, start != null ? $"start={start}" : null), UriKind.Relative), _apiAccessor.JsonContext.ApiResponseApiUsage,
null, HttpMethod.Get, authToken, cancelToken
);
}
Expand All @@ -43,18 +33,8 @@ public Task<T> App_GetApplicationApiUsage<T>(int applicationId, DateTime? end =
/// <param name="cancelToken">The <see cref="CancellationToken" /> to observe.</param>
public Task<IEnumerable<Entities.Applications.Application>> App_GetBungieApplications(string? authToken = null, CancellationToken cancelToken = default)
{
return _apiAccessor.ApiRequestAsync<IEnumerable<Entities.Applications.Application>>(
new Uri($"App/FirstParty/", UriKind.Relative),
null, HttpMethod.Get, authToken, cancelToken
);
}

/// <inheritdoc cref="App_GetBungieApplications(string?, CancellationToken)" />
/// <typeparam name="T">The custom type to deserialize to.</typeparam>
public Task<T> App_GetBungieApplications<T>(string? authToken = null, CancellationToken cancelToken = default)
{
return _apiAccessor.ApiRequestAsync<T>(
new Uri($"App/FirstParty/", UriKind.Relative),
return _apiAccessor.ApiRequestAsync(
new Uri("App/FirstParty/", UriKind.Relative), _apiAccessor.JsonContext.ApiResponseIEnumerableApplication,
null, HttpMethod.Get, authToken, cancelToken
);
}
Expand Down
14 changes: 2 additions & 12 deletions BungieSharper/Endpoints/CommunityContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,8 @@ public partial class Endpoints
/// <param name="cancelToken">The <see cref="CancellationToken" /> to observe.</param>
public Task<Entities.Forum.PostSearchResponse> CommunityContent_GetCommunityContent(Entities.Forum.ForumTopicsCategoryFiltersEnum mediaFilter, int page, Entities.Forum.CommunityContentSortMode sort, string? authToken = null, CancellationToken cancelToken = default)
{
return _apiAccessor.ApiRequestAsync<Entities.Forum.PostSearchResponse>(
new Uri($"CommunityContent/Get/{sort}/{mediaFilter}/{page}/", UriKind.Relative),
null, HttpMethod.Get, authToken, cancelToken
);
}

/// <inheritdoc cref="CommunityContent_GetCommunityContent(Entities.Forum.ForumTopicsCategoryFiltersEnum, int, Entities.Forum.CommunityContentSortMode, string?, CancellationToken)" />
/// <typeparam name="T">The custom type to deserialize to.</typeparam>
public Task<T> CommunityContent_GetCommunityContent<T>(Entities.Forum.ForumTopicsCategoryFiltersEnum mediaFilter, int page, Entities.Forum.CommunityContentSortMode sort, string? authToken = null, CancellationToken cancelToken = default)
{
return _apiAccessor.ApiRequestAsync<T>(
new Uri($"CommunityContent/Get/{sort}/{mediaFilter}/{page}/", UriKind.Relative),
return _apiAccessor.ApiRequestAsync(
new Uri($"CommunityContent/Get/{sort}/{mediaFilter}/{page}/", UriKind.Relative), _apiAccessor.JsonContext.ApiResponsePostSearchResponse,
null, HttpMethod.Get, authToken, cancelToken
);
}
Expand Down
Loading

0 comments on commit d1ab4d9

Please sign in to comment.