├── .gitignore ├── CHANGELOG.md ├── Examples └── HaloSharp.Console │ ├── App.config │ ├── Application.cs │ ├── HaloSharp.Console.csproj │ ├── IApplication.cs │ ├── Infrastructure │ ├── ApplicationModule.cs │ └── HaloSharpModule.cs │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── packages.config ├── LICENSE ├── README.md └── Source ├── HaloSharp.Test ├── Cache │ └── CacheTests.cs ├── Config │ ├── Halo5Config.cs │ ├── Halo5ForgeConfig.cs │ └── HaloWars2Config.cs ├── Converter │ ├── GuidConverterTests.cs │ └── TimeSpanConverterTests.cs ├── HaloSharp.Test.csproj ├── JSON │ ├── Common │ │ ├── identity.schema.json │ │ ├── iso-8061.schema.json │ │ ├── link.schema.json │ │ └── location.schema.json │ ├── Halo5 │ │ ├── Common │ │ │ └── variant.schema.json │ │ ├── Metadata │ │ │ ├── Common │ │ │ │ ├── requisition-pack.schema.json │ │ │ │ └── reward.schema.json │ │ │ ├── campaign-missions.json │ │ │ ├── campaign-missions.schema.json │ │ │ ├── commendations.json │ │ │ ├── commendations.schema.json │ │ │ ├── competitive-skill-rank-designations.json │ │ │ ├── competitive-skill-rank-designations.schema.json │ │ │ ├── enemies.json │ │ │ ├── enemies.schema.json │ │ │ ├── flexible-stats.json │ │ │ ├── flexible-stats.schema.json │ │ │ ├── game-base-variants.json │ │ │ ├── game-base-variants.schema.json │ │ │ ├── game-variant.json │ │ │ ├── game-variant.schema.json │ │ │ ├── impulses.json │ │ │ ├── impulses.schema.json │ │ │ ├── map-variant.json │ │ │ ├── map-variant.schema.json │ │ │ ├── maps.json │ │ │ ├── maps.schema.json │ │ │ ├── medals.json │ │ │ ├── medals.schema.json │ │ │ ├── playlists.json │ │ │ ├── playlists.schema.json │ │ │ ├── requisition-pack.json │ │ │ ├── requisition-pack.schema.json │ │ │ ├── requisition.json │ │ │ ├── requisition.schema.json │ │ │ ├── seasons.json │ │ │ ├── seasons.schema.json │ │ │ ├── skulls.json │ │ │ ├── skulls.schema.json │ │ │ ├── spartan-ranks.json │ │ │ ├── spartan-ranks.schema.json │ │ │ ├── team-colors.json │ │ │ ├── team-colors.schema.json │ │ │ ├── vehicles.json │ │ │ ├── vehicles.schema.json │ │ │ ├── weapons.json │ │ │ └── weapons.schema.json │ │ ├── Stats │ │ │ ├── CarnageReport │ │ │ │ ├── Common │ │ │ │ │ ├── boost-info.schema.json │ │ │ │ │ ├── credits-earned.schema.json │ │ │ │ │ ├── meta-commendation-delta.schema.json │ │ │ │ │ ├── oppenent-details.schema.json │ │ │ │ │ ├── progressive-commendation-delta.schema.json │ │ │ │ │ ├── reward-set.schema.json │ │ │ │ │ ├── team-stat.schema.json │ │ │ │ │ └── xp-info.schema.json │ │ │ │ ├── arena-match.json │ │ │ │ ├── arena-match.schema.json │ │ │ │ ├── campaign-match.json │ │ │ │ ├── campaign-match.schema.json │ │ │ │ ├── custom-match.json │ │ │ │ ├── custom-match.schema.json │ │ │ │ ├── match-events.json │ │ │ │ ├── match-events.schema.json │ │ │ │ ├── warzone-match.json │ │ │ │ └── warzone-match.schema.json │ │ │ ├── Common │ │ │ │ ├── base-stat.schema.json │ │ │ │ ├── competitive-skill-ranking.schema.json │ │ │ │ └── flexible-stats.schema.json │ │ │ ├── Lifetime │ │ │ │ ├── Common │ │ │ │ │ ├── game-base-variant-stat.schema.json │ │ │ │ │ └── top-game-base-variant.schema.json │ │ │ │ ├── arena-service-record.json │ │ │ │ ├── arena-service-record.schema.json │ │ │ │ ├── campaign-service-record.json │ │ │ │ ├── campaign-service-record.schema.json │ │ │ │ ├── custom-service-record.json │ │ │ │ ├── custom-service-record.schema.json │ │ │ │ ├── warzone-service-record.json │ │ │ │ └── warzone-service-record.schema.json │ │ │ ├── leaderboard.json │ │ │ ├── leaderboard.schema.json │ │ │ ├── matches.json │ │ │ └── matches.schema.json │ │ └── UserGeneratedContent │ │ │ ├── Common │ │ │ └── stats.schema.json │ │ │ ├── game-variant.json │ │ │ ├── game-variant.schema.json │ │ │ ├── game-variants.json │ │ │ ├── game-variants.schema.json │ │ │ ├── map-variant.json │ │ │ ├── map-variant.schema.json │ │ │ ├── map-variants.json │ │ │ └── map-variants.schema.json │ └── HaloWars2 │ │ ├── Metadata │ │ ├── Common │ │ │ ├── batch-localization.schema.json │ │ │ ├── common.schema.json │ │ │ ├── content-item-type-b.schema.json │ │ │ ├── content-item-type-c.schema.json │ │ │ ├── content-item-type-d.schema.json │ │ │ ├── difficulty.schema.json │ │ │ ├── empty.schema.json │ │ │ ├── image.schema.json │ │ │ ├── link.schema.json │ │ │ ├── localization.schema.json │ │ │ ├── map.schema.json │ │ │ ├── pack.schema.json │ │ │ ├── paging.schema.json │ │ │ └── playlist.schema.json │ │ ├── campaign-levels.json │ │ ├── campaign-levels.schema.json │ │ ├── campaign-logs.json │ │ ├── campaign-logs.schema.json │ │ ├── card-keywords.json │ │ ├── card-keywords.schema.json │ │ ├── cards.json │ │ ├── cards.schema.json │ │ ├── csr-designations.json │ │ ├── csr-designations.schema.json │ │ ├── difficulties.json │ │ ├── difficulties.schema.json │ │ ├── game-object-categories.json │ │ ├── game-object-categories.schema.json │ │ ├── game-objects.json │ │ ├── game-objects.schema.json │ │ ├── leader-powers.json │ │ ├── leader-powers.schema.json │ │ ├── leaders.json │ │ ├── leaders.schema.json │ │ ├── maps.json │ │ ├── maps.schema.json │ │ ├── packs.json │ │ ├── packs.schema.json │ │ ├── playlists.json │ │ ├── playlists.schema.json │ │ ├── seasons.json │ │ ├── seasons.schema.json │ │ ├── spartan-ranks.json │ │ ├── spartan-ranks.schema.json │ │ ├── techs.json │ │ └── techs.schema.json │ │ └── Stats │ │ ├── Common │ │ ├── competitive-skill-rank.schema.json │ │ ├── experience-progress.schema.json │ │ ├── leader-stats.schema.json │ │ ├── matchmaking-rank.schema.json │ │ ├── rating-progress.schema.json │ │ └── stats.schema.json │ │ ├── campaign-progress.json │ │ ├── campaign-progress.schema.json │ │ ├── experience-summary.json │ │ ├── experience-summary.schema.json │ │ ├── match-events.json │ │ ├── match-events.schema.json │ │ ├── match-history.json │ │ ├── match-history.schema.json │ │ ├── match.json │ │ ├── match.schema.json │ │ ├── player-summary.json │ │ ├── player-summary.schema.json │ │ ├── playlist-ratings.json │ │ ├── playlist-ratings.schema.json │ │ ├── season-summary.json │ │ └── season-summary.schema.json ├── Properties │ └── AssemblyInfo.cs ├── Query │ ├── Halo5 │ │ ├── Metadata │ │ │ ├── GetCampaignMissionsTests.cs │ │ │ ├── GetCommendationsTests.cs │ │ │ ├── GetCompetitiveSkillRankDesignationsTests.cs │ │ │ ├── GetEnemiesTests.cs │ │ │ ├── GetFlexibleStatsTests.cs │ │ │ ├── GetGameBaseVariantsTests.cs │ │ │ ├── GetGameVariantTests.cs │ │ │ ├── GetImpulsesTests.cs │ │ │ ├── GetMapVariantTests.cs │ │ │ ├── GetMapsTests.cs │ │ │ ├── GetMedalsTests.cs │ │ │ ├── GetPlaylistsTests.cs │ │ │ ├── GetRequisitionPackTests.cs │ │ │ ├── GetRequisitionTests.cs │ │ │ ├── GetSeasonsTests.cs │ │ │ ├── GetSkullsTests.cs │ │ │ ├── GetSpartanRanksTests.cs │ │ │ ├── GetTeamColorsTests.cs │ │ │ ├── GetVehiclesTests.cs │ │ │ └── GetWeaponsTests.cs │ │ ├── Profile │ │ │ ├── GetEmblemImageTests.cs │ │ │ └── GetSpartanImageTests.cs │ │ ├── Stats │ │ │ ├── CarnageReport │ │ │ │ ├── GetArenaMatchDetailsTests.cs │ │ │ │ ├── GetCampaignMatchDetailsTests.cs │ │ │ │ ├── GetCustomMatchDetailsTests.cs │ │ │ │ ├── GetMatchEventsTests.cs │ │ │ │ └── GetWarzoneMatchDetailsTests.cs │ │ │ ├── GetLeaderboardTests.cs │ │ │ ├── GetMatchesTests.cs │ │ │ └── Lifetime │ │ │ │ ├── GetArenaServiceRecordTests.cs │ │ │ │ ├── GetCampaignServiceRecordTests.cs │ │ │ │ ├── GetCustomServiceRecordTests.cs │ │ │ │ └── GetWarzoneServiceRecordTests.cs │ │ └── UserGeneratedContent │ │ │ ├── GetGameVariantTests.cs │ │ │ ├── GetMapVariantTests.cs │ │ │ ├── ListGameVariantsTests.cs │ │ │ └── ListMapVariantsTests.cs │ ├── Halo5Forge │ │ └── Stats │ │ │ ├── CarnageReport │ │ │ └── GetCustomMatchDetailsTests.cs │ │ │ ├── GetMatchesTests.cs │ │ │ └── Lifetime │ │ │ └── GetCustomServiceRecordTests.cs │ └── HaloWars2 │ │ ├── Metadata │ │ ├── GetCampaignLevelsTests.cs │ │ ├── GetCampaignLogsTests.cs │ │ ├── GetCardKeywordsTests.cs │ │ ├── GetCardsTests.cs │ │ ├── GetCompetitiveSkillRankDesignationsTests.cs │ │ ├── GetDifficultiesTests.cs │ │ ├── GetGameObjectCategoriesTests.cs │ │ ├── GetGameObjectsTests.cs │ │ ├── GetLeaderPowersTests.cs │ │ ├── GetLeadersTests.cs │ │ ├── GetMapsTests.cs │ │ ├── GetPacksTests.cs │ │ ├── GetPlaylistsTests.cs │ │ ├── GetSeasonsTests.cs │ │ ├── GetSpartanRanksTests.cs │ │ └── GetTechsTests.cs │ │ └── Stats │ │ ├── CarnageReport │ │ ├── GetMatchEventsTests.cs │ │ └── GetMatchTests.cs │ │ ├── GetMatchHistoryTests.cs │ │ └── Lifetime │ │ ├── GetCampaignProgressTests.cs │ │ ├── GetExperienceSummaryTests.cs │ │ ├── GetPlayerSummaryTests.cs │ │ ├── GetPlaylistRatingsTests.cs │ │ └── GetSeasonSummaryTests.cs ├── Schema │ ├── Halo5SchemaTests.cs │ └── HaloWars2SchemaTests.cs ├── Serialization │ ├── Halo5SerializationTests.cs │ └── HaloWars2SerializationTests.cs ├── Setup.cs ├── Utility │ ├── SchemaUtility.cs │ └── SerializationUtility.cs ├── app.config └── packages.config ├── HaloSharp.sln └── HaloSharp ├── Cache.cs ├── Converter ├── GuidConverter.cs ├── Halo5MatchEventConverter.cs ├── HaloWars2MatchEventConverter.cs ├── MillisecondConverter.cs └── TimeSpanConverter.cs ├── Exception ├── HaloApiException.cs └── ValidationException.cs ├── Extension ├── HaloSharpSessionExtensions.cs └── StringExtensions.cs ├── HaloClient.cs ├── HaloSession.cs ├── HaloSharp.csproj ├── HaloSharp.nuspec ├── HaloUriBuilder.cs ├── IHaloSession.cs ├── IQuery.cs ├── Model ├── CacheSettings.cs ├── Common │ ├── ISO8601.cs │ ├── Identity.cs │ ├── Link.cs │ ├── Location.cs │ └── MatchSet.cs ├── Enumeration.cs ├── Error │ ├── HaloApiError.cs │ └── ValidationError.cs ├── Halo5 │ ├── Common │ │ └── Variant.cs │ ├── Metadata │ │ ├── CampaignMission.cs │ │ ├── Commendation.cs │ │ ├── Common │ │ │ ├── RequisitionPack.cs │ │ │ └── Reward.cs │ │ ├── CompetitiveSkillRankDesignation.cs │ │ ├── Enemy.cs │ │ ├── FlexibleStat.cs │ │ ├── GameBaseVariant.cs │ │ ├── GameVariant.cs │ │ ├── Impulse.cs │ │ ├── Map.cs │ │ ├── MapVariant.cs │ │ ├── Medal.cs │ │ ├── Playlist.cs │ │ ├── Requisition.cs │ │ ├── Season.cs │ │ ├── Skull.cs │ │ ├── SpartanRank.cs │ │ ├── TeamColor.cs │ │ ├── Vehicle.cs │ │ └── Weapon.cs │ ├── Profile │ │ └── HaloImage.cs │ ├── Stats │ │ ├── CarnageReport │ │ │ ├── ArenaMatch.cs │ │ │ ├── CampaignMatch.cs │ │ │ ├── Common │ │ │ │ ├── BaseMatch.cs │ │ │ │ ├── BasePlayerStat.cs │ │ │ │ ├── BoostInfo.cs │ │ │ │ ├── CreditsEarned.cs │ │ │ │ ├── MetaCommendationDelta.cs │ │ │ │ ├── OpponentDetails.cs │ │ │ │ ├── ProgressiveCommendationDelta.cs │ │ │ │ ├── RewardSet.cs │ │ │ │ ├── TeamStat.cs │ │ │ │ └── XpInfo.cs │ │ │ ├── CustomMatch.cs │ │ │ ├── Events │ │ │ │ ├── Death.cs │ │ │ │ ├── Impulse.cs │ │ │ │ ├── MatchEvent.cs │ │ │ │ ├── Medal.cs │ │ │ │ ├── PlayerSpawn.cs │ │ │ │ ├── RoundEnd.cs │ │ │ │ ├── RoundStart.cs │ │ │ │ ├── WeaponDrop.cs │ │ │ │ ├── WeaponPickup.cs │ │ │ │ └── WeaponPickupPad.cs │ │ │ ├── MatchEventSummary.cs │ │ │ └── WarzoneMatch.cs │ │ ├── Common │ │ │ ├── BaseStat.cs │ │ │ ├── CompetitiveSkillRanking.cs │ │ │ └── FlexibleStats.cs │ │ ├── Leaderboard.cs │ │ ├── Lifetime │ │ │ ├── ArenaServiceRecord.cs │ │ │ ├── CampaignServiceRecord.cs │ │ │ ├── Common │ │ │ │ ├── BaseResult.cs │ │ │ │ ├── BaseServiceRecord.cs │ │ │ │ ├── BaseServiceRecordResult.cs │ │ │ │ ├── GameBaseVariantStat.cs │ │ │ │ └── TopGameBaseVariant.cs │ │ │ ├── CustomServiceRecord.cs │ │ │ └── WarzoneServiceRecord.cs │ │ └── MatchSet.cs │ └── UserGeneratedContent │ │ ├── Common │ │ └── Stats.cs │ │ ├── GameVariant.cs │ │ ├── GameVariantResult.cs │ │ ├── MapVariant.cs │ │ └── MapVariantResult.cs ├── HaloWars2 │ ├── Metadata │ │ ├── CampaignLevel │ │ │ ├── CampaignLevel.cs │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ └── View.cs │ │ ├── CampaignLog │ │ │ ├── CampaignLog.cs │ │ │ └── View.cs │ │ ├── CampaignObjective │ │ │ ├── CampaignObjective.cs │ │ │ └── View.cs │ │ ├── Card │ │ │ ├── Card.cs │ │ │ ├── DisplayInfo │ │ │ │ ├── DisplayInfo.cs │ │ │ │ └── View.cs │ │ │ └── View.cs │ │ ├── CardKeyword │ │ │ ├── CardKeyword.cs │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ └── View.cs │ │ ├── Common.cs │ │ ├── CompetitiveSkillRankDesignation │ │ │ ├── CompetitiveSkillRankDesignation.cs │ │ │ ├── DisplayInfo │ │ │ │ ├── DisplayInfo.cs │ │ │ │ └── View.cs │ │ │ └── View.cs │ │ ├── CompetitiveSkillRankDesignationTier │ │ │ ├── Tier.cs │ │ │ └── View.cs │ │ ├── ContentItemTypeA.cs │ │ ├── ContentItemTypeB.cs │ │ ├── ContentItemTypeC.cs │ │ ├── ContentItemTypeD.cs │ │ ├── Difficulty │ │ │ ├── Difficulty.cs │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ └── View.cs │ │ ├── DisplayInfo │ │ │ ├── BatchLocalization.cs │ │ │ ├── DisplayInfo.cs │ │ │ ├── Localization.cs │ │ │ └── View.cs │ │ ├── GameObject │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ ├── GameObject.cs │ │ │ └── View.cs │ │ ├── GameObjectCategory │ │ │ └── View.cs │ │ ├── Image │ │ │ ├── Image.cs │ │ │ ├── Media.cs │ │ │ └── View.cs │ │ ├── Leader │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ ├── Leader.cs │ │ │ └── View.cs │ │ ├── LeaderPower │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ ├── LeaderPower.cs │ │ │ └── View.cs │ │ ├── Link.cs │ │ ├── Map │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ ├── Map.cs │ │ │ └── View.cs │ │ ├── Pack │ │ │ ├── Displayinfo │ │ │ │ └── View.cs │ │ │ ├── Pack.cs │ │ │ └── View.cs │ │ ├── PagedResponse.cs │ │ ├── Paging.cs │ │ ├── Playlist │ │ │ ├── CardsFixedAtLevel.cs │ │ │ ├── Displayinfo │ │ │ │ └── View.cs │ │ │ ├── Playlist.cs │ │ │ └── View.cs │ │ ├── PlaylistEntry │ │ │ ├── PlaylistEntry.cs │ │ │ └── View.cs │ │ ├── Season │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ ├── Season.cs │ │ │ └── View.cs │ │ ├── Skull │ │ │ ├── Skull.cs │ │ │ └── View.cs │ │ ├── SpartanRank │ │ │ ├── DisplayInfo │ │ │ │ ├── DisplayInfo.cs │ │ │ │ └── View.cs │ │ │ ├── SpartanRank.cs │ │ │ └── View.cs │ │ ├── StartingArmy │ │ │ ├── DisplayInfo │ │ │ │ ├── DisplayInfo.cs │ │ │ │ └── View.cs │ │ │ ├── StartingArmy.cs │ │ │ └── View.cs │ │ ├── Tech │ │ │ ├── DisplayInfo │ │ │ │ └── View.cs │ │ │ ├── Tech.cs │ │ │ └── View.cs │ │ └── View.cs │ └── Stats │ │ ├── CarnageReport │ │ ├── Events │ │ │ ├── BuildingConstructionCompleted.cs │ │ │ ├── BuildingConstructionQueued.cs │ │ │ ├── BuildingRecycled.cs │ │ │ ├── BuildingUpgraded.cs │ │ │ ├── CardCycled.cs │ │ │ ├── CardPlayed.cs │ │ │ ├── Death.cs │ │ │ ├── FirefightWaveCompleted.cs │ │ │ ├── FirefightWaveSpawned.cs │ │ │ ├── FirefightWaveStarted.cs │ │ │ ├── LeaderPowerCast.cs │ │ │ ├── LeaderPowerUnlocked.cs │ │ │ ├── ManaOrbCollected.cs │ │ │ ├── MatchEnd.cs │ │ │ ├── MatchEvent.cs │ │ │ ├── MatchStart.cs │ │ │ ├── PlayerEliminated.cs │ │ │ ├── PlayerJoinedMatch.cs │ │ │ ├── PlayerLeftMatch.cs │ │ │ ├── PointCaptured.cs │ │ │ ├── PointCreated.cs │ │ │ ├── PointStatusChange.cs │ │ │ ├── ResourceHeartbeat.cs │ │ │ ├── ResourceTransferred.cs │ │ │ ├── TechResearched.cs │ │ │ ├── UnitControlTransferred.cs │ │ │ ├── UnitPromoted.cs │ │ │ └── UnitTrained.cs │ │ ├── Match.cs │ │ └── MatchEventSummary.cs │ │ ├── Common │ │ ├── CompetitiveSkillRanking.cs │ │ ├── ExperienceProgress.cs │ │ ├── MatchmakingRanking.cs │ │ ├── RatingProgress.cs │ │ ├── Stats.cs │ │ └── Team.cs │ │ ├── Lifetime │ │ ├── CampaignSummary.cs │ │ ├── ExperienceSummaryResultSet.cs │ │ ├── PlayerSummary.cs │ │ ├── PlaylistSummaryResultSet.cs │ │ └── SeasonSummary.cs │ │ └── PlayerMatch.cs ├── Product.cs └── ValidationResult.cs ├── Properties └── AssemblyInfo.cs ├── Query ├── Halo5 │ ├── Metadata │ │ ├── GetCampaignMissions.cs │ │ ├── GetCommendations.cs │ │ ├── GetCompetitiveSkillRankDesignations.cs │ │ ├── GetEnemies.cs │ │ ├── GetFlexibleStats.cs │ │ ├── GetGameBaseVariants.cs │ │ ├── GetGameVariant.cs │ │ ├── GetImpulses.cs │ │ ├── GetMapVariant.cs │ │ ├── GetMaps.cs │ │ ├── GetMedals.cs │ │ ├── GetPlaylists.cs │ │ ├── GetRequisition.cs │ │ ├── GetRequisitionPack.cs │ │ ├── GetSeasons.cs │ │ ├── GetSkulls.cs │ │ ├── GetSpartanRanks.cs │ │ ├── GetTeamColors.cs │ │ ├── GetVehicles.cs │ │ └── GetWeapons.cs │ ├── Profile │ │ ├── GetEmblemImage.cs │ │ └── GetSpartanImage.cs │ ├── Stats │ │ ├── CarnageReport │ │ │ ├── GetArenaMatchDetails.cs │ │ │ ├── GetCampaignMatchDetails.cs │ │ │ ├── GetCustomMatchDetails.cs │ │ │ ├── GetMatchEvents.cs │ │ │ └── GetWarzoneMatchDetails.cs │ │ ├── GetLeaderboard.cs │ │ ├── GetMatchHistory.cs │ │ └── Lifetime │ │ │ ├── GetArenaServiceRecord.cs │ │ │ ├── GetCampaignServiceRecord.cs │ │ │ ├── GetCustomServiceRecord.cs │ │ │ └── GetWarzoneServiceRecord.cs │ └── UserGeneratedContent │ │ ├── GetGameVariant.cs │ │ ├── GetMapVariant.cs │ │ ├── ListGameVariants.cs │ │ └── ListMapVariants.cs ├── Halo5Forge │ └── Stats │ │ ├── CarnageReport │ │ └── GetCustomMatchDetails.cs │ │ ├── GetMatchHistory.cs │ │ └── Lifetime │ │ └── GetCustomServiceRecord.cs ├── HaloWars2 │ ├── Metadata │ │ ├── GetCampaignLevels.cs │ │ ├── GetCampaignLogs.cs │ │ ├── GetCardKeywords.cs │ │ ├── GetCards.cs │ │ ├── GetCompetitiveSkillRankDesignations.cs │ │ ├── GetDifficulties.cs │ │ ├── GetGameObjectCategories.cs │ │ ├── GetGameObjects.cs │ │ ├── GetLeaderPowers.cs │ │ ├── GetLeaders.cs │ │ ├── GetMaps.cs │ │ ├── GetPacks.cs │ │ ├── GetPlaylists.cs │ │ ├── GetSeasons.cs │ │ ├── GetSpartanRanks.cs │ │ └── GetTechs.cs │ └── Stats │ │ ├── CarnageReport │ │ ├── GetMatchDetails.cs │ │ └── GetMatchEvents.cs │ │ ├── GetMatchHistory.cs │ │ └── Lifetime │ │ ├── GetCampaignSummary.cs │ │ ├── GetExperienceSummary.cs │ │ ├── GetPlaylistRatings.cs │ │ ├── GetSeasonSummary.cs │ │ └── GetSummary.cs ├── ImageQuery.cs └── Query.cs ├── RateGate.cs ├── Validation └── Common │ ├── GamertagValidator.cs │ ├── GuidValidator.cs │ ├── ImageSizeValidator.cs │ ├── StartAtValidator.cs │ └── TakeValidator.cs └── packages.config /Examples/HaloSharp.Console/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/HaloSharp.Console/IApplication.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace HaloSharp.Console 3 | { 4 | internal interface IApplication 5 | { 6 | void Run(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Examples/HaloSharp.Console/Infrastructure/ApplicationModule.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | 3 | namespace HaloSharp.Console.Infrastructure 4 | { 5 | public class ApplicationModule : Module 6 | { 7 | protected override void Load(ContainerBuilder builder) 8 | { 9 | builder.RegisterType() 10 | .As() 11 | .InstancePerDependency(); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Examples/HaloSharp.Console/Infrastructure/HaloSharpModule.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using HaloSharp.Model; 3 | using System; 4 | using System.Configuration; 5 | 6 | namespace HaloSharp.Console.Infrastructure 7 | { 8 | internal class HaloSharpModule : Module 9 | { 10 | protected override void Load(ContainerBuilder builder) 11 | { 12 | var subscriptionKey = ConfigurationManager.AppSettings["SubscriptionKey"]; 13 | 14 | var product = new Product 15 | { 16 | SubscriptionKey = subscriptionKey, 17 | RateLimit = new RateLimit 18 | { 19 | RequestCount = 200, 20 | TimeSpan = new TimeSpan(0, 0, 0, 10), 21 | Timeout = new TimeSpan(0, 0, 0, 10) 22 | } 23 | }; 24 | 25 | var cacheSettings = new CacheSettings 26 | { 27 | CacheDuration = new TimeSpan(0, 1, 0, 0) 28 | }; 29 | 30 | var haloClient = new HaloClient(product, cacheSettings); 31 | var haloSession = haloClient.StartSession(); 32 | 33 | builder.RegisterInstance(haloSession) 34 | .AsImplementedInterfaces() 35 | .SingleInstance(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Examples/HaloSharp.Console/Program.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using HaloSharp.Console.Infrastructure; 3 | 4 | namespace HaloSharp.Console 5 | { 6 | internal static class Program 7 | { 8 | private static void Main() 9 | { 10 | var builder = new ContainerBuilder(); 11 | builder.RegisterModule(new ApplicationModule()); 12 | builder.RegisterModule(new HaloSharpModule()); 13 | var container = builder.Build(); 14 | 15 | using (var scope = container.BeginLifetimeScope()) 16 | { 17 | var app = scope.Resolve(); 18 | 19 | app.Run(); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Examples/HaloSharp.Console/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("HaloSharp.Console")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("HaloSharp.Console")] 12 | [assembly: AssemblyCopyright("Copyright © 2017")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("8bda1311-9d60-461c-a2ef-d8aad6335a8e")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /Examples/HaloSharp.Console/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Damon Pollard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Source/HaloSharp.Test/Cache/CacheTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading; 3 | using NUnit.Framework; 4 | 5 | namespace HaloSharp.Test.Cache 6 | { 7 | [TestFixture] 8 | public class CacheTests 9 | { 10 | private TimeSpan? PreviousCacheDuration { get; set; } 11 | 12 | [SetUp] 13 | public void Setup() 14 | { 15 | PreviousCacheDuration = HaloSharp.Cache.CacheDuration; 16 | } 17 | 18 | [Test] 19 | public void ExpiresFromCacheAfterDuration() 20 | { 21 | var cacheDuration = new TimeSpan(0, 0, 0, 3); 22 | 23 | HaloSharp.Cache.CacheDuration = cacheDuration; 24 | 25 | const string key = "ExpiresFromCacheAfterDuration"; 26 | const string input = "HaloSharp.Cache"; 27 | 28 | HaloSharp.Cache.Add(key, input); 29 | var output = HaloSharp.Cache.Get(key); 30 | Assert.AreEqual(input, output); 31 | 32 | Thread.Sleep(cacheDuration); 33 | 34 | output = HaloSharp.Cache.Get(key); 35 | Assert.IsNull(output); 36 | } 37 | 38 | [TearDown] 39 | public void TearDown() 40 | { 41 | HaloSharp.Cache.CacheDuration = PreviousCacheDuration; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp.Test/Config/Halo5ForgeConfig.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace HaloSharp.Test.Config 3 | { 4 | public static class Halo5ForgeConfig 5 | { 6 | 7 | } 8 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/Converter/TimeSpanConverterTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HaloSharp.Converter; 3 | using Newtonsoft.Json; 4 | using NUnit.Framework; 5 | 6 | namespace HaloSharp.Test.Converter 7 | { 8 | [TestFixture] 9 | public class TimeSpanConverterTests 10 | { 11 | private readonly string _iso8081 = "P1DT2H3M4S"; 12 | private readonly TimeSpan _timespan = new TimeSpan(1, 2, 3, 4); 13 | 14 | private class TestClass 15 | { 16 | [JsonProperty(PropertyName = "FastestCompletionTime")] 17 | [JsonConverter(typeof (TimeSpanConverter))] 18 | public TimeSpan FastestCompletionTime { get; set; } 19 | } 20 | 21 | [Test] 22 | [TestCase("NonSeasonal")] 23 | [TestCase(null)] 24 | [TestCase(12345)] 25 | public void DeserializeObject_ReadJson_IsDefault(object value) 26 | { 27 | var source = $"{{\"FastestCompletionTime\":\"{value}\"}}"; 28 | var target = JsonConvert.DeserializeObject(source); 29 | 30 | Assert.AreEqual(default(TimeSpan), target.FastestCompletionTime); 31 | } 32 | 33 | [Test] 34 | public void DeserializeObject_ReadJson_AreEqual() 35 | { 36 | string source = $"{{\"FastestCompletionTime\":\"{_iso8081}\"}}"; 37 | var target = JsonConvert.DeserializeObject(source); 38 | 39 | Assert.AreEqual(_timespan, target.FastestCompletionTime); 40 | } 41 | 42 | [Test] 43 | public void SerializeObject_WriteJson_AreEqual() 44 | { 45 | var source = new TestClass {FastestCompletionTime = _timespan}; 46 | var target = JsonConvert.SerializeObject(source); 47 | 48 | Assert.AreEqual($"{{\"FastestCompletionTime\":\"{_iso8081}\"}}", target); 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Common/identity.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": [ "object", "null" ], 4 | "additionalProperties": false, 5 | "properties": { 6 | "Gamertag": { 7 | "type": [ "string", "null" ] 8 | }, 9 | "Xuid": { 10 | "type": "null" 11 | } 12 | }, 13 | "required": [ 14 | "Gamertag", 15 | "Xuid" 16 | ] 17 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Common/iso-8061.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "ISO8601Date": { 7 | "type": [ "null", "string" ] 8 | } 9 | }, 10 | "required": [ 11 | "ISO8601Date" 12 | ] 13 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Common/link.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": { 5 | "$schema": "http://json-schema.org/draft-04/schema#", 6 | "type": "object", 7 | "additionalProperties": false, 8 | "properties": { 9 | "AuthorityId": { 10 | "type": "string" 11 | }, 12 | "Path": { 13 | "type": "string" 14 | }, 15 | "QueryString": { 16 | "type": [ "string", "null" ] 17 | }, 18 | "RetryPolicyId": { 19 | "type": "string" 20 | }, 21 | "TopicName": { 22 | "type": "string" 23 | }, 24 | "AcknowledgementTypeId": { 25 | "type": "integer" 26 | }, 27 | "AuthenticationLifetimeExtensionSupported": { 28 | "type": "boolean" 29 | } 30 | }, 31 | "required": [ 32 | "AuthorityId", 33 | "Path", 34 | "QueryString", 35 | "RetryPolicyId", 36 | "TopicName", 37 | "AcknowledgementTypeId", 38 | "AuthenticationLifetimeExtensionSupported" 39 | ] 40 | } 41 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Common/location.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": [ "object", "null" ], 4 | "additionalProperties": false, 5 | "properties": { 6 | "x": { 7 | "type": "number" 8 | }, 9 | "y": { 10 | "type": "number" 11 | }, 12 | "z": { 13 | "type": "number" 14 | } 15 | }, 16 | "required": [ 17 | "x", 18 | "y", 19 | "z" 20 | ] 21 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Common/variant.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": [ "object", "null" ], 4 | "additionalProperties": false, 5 | "properties": { 6 | "ResourceType": { 7 | "type": "integer" 8 | }, 9 | "ResourceId": { 10 | "type": "string" 11 | }, 12 | "OwnerType": { 13 | "type": "integer" 14 | }, 15 | "Owner": { 16 | "type": [ "string", "null" ] 17 | } 18 | }, 19 | "required": [ 20 | "ResourceType", 21 | "ResourceId", 22 | "OwnerType", 23 | "Owner" 24 | ] 25 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/Common/reward.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": [ "object", "null" ], 4 | "additionalProperties": false, 5 | "properties": { 6 | "xp": { 7 | "type": "integer" 8 | }, 9 | "requisitionPacks": { 10 | "type": [ "array", "null" ], 11 | "items": { 12 | "$ref": "requisition-pack.schema.json" 13 | } 14 | }, 15 | "id": { 16 | "type": "string" 17 | }, 18 | "contentId": { 19 | "type": "string" 20 | } 21 | }, 22 | "required": [ 23 | "xp", 24 | "requisitionPacks", 25 | "id", 26 | "contentId" 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/campaign-missions.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitFurious/HaloSharp/3e7fb75edba1bec86809bf7cdd9696802740bc3e/Source/HaloSharp.Test/JSON/Halo5/Metadata/campaign-missions.json -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/campaign-missions.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "CampaignMission": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "missionNumber": { 9 | "type": "integer", 10 | "multipleOf": 1 11 | }, 12 | "name": { 13 | "type": "string" 14 | }, 15 | "description": { 16 | "type": "string" 17 | }, 18 | "imageUrl": { 19 | "type": "string" 20 | }, 21 | "type": { 22 | "type": "string" 23 | }, 24 | "id": { 25 | "type": "string" 26 | }, 27 | "contentId": { 28 | "type": "string" 29 | } 30 | }, 31 | "required": [ 32 | "missionNumber", 33 | "name", 34 | "description", 35 | "imageUrl", 36 | "type", 37 | "id", 38 | "contentId" 39 | ] 40 | } 41 | }, 42 | 43 | "$schema": "http://json-schema.org/draft-04/schema#", 44 | "type": "array", 45 | "items": { 46 | "$ref": "#/definitions/CampaignMission" 47 | } 48 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/commendations.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitFurious/HaloSharp/3e7fb75edba1bec86809bf7cdd9696802740bc3e/Source/HaloSharp.Test/JSON/Halo5/Metadata/commendations.json -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/enemies.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Enemy": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "faction": { 9 | "type": "string" 10 | }, 11 | "name": { 12 | "type": "string" 13 | }, 14 | "description": { 15 | "type": "null" 16 | }, 17 | "largeIconImageUrl": { 18 | "type": "string" 19 | }, 20 | "smallIconImageUrl": { 21 | "type": "string" 22 | }, 23 | "id": { 24 | /* 25 | * HACK: API returns a string but it's really an int. 26 | * HaloSharp's model uses an int, the JSON reponse uses a string. 27 | */ 28 | "type": [ "string", "integer" ] 29 | }, 30 | "contentId": { 31 | "type": "string" 32 | } 33 | }, 34 | "required": [ 35 | "faction", 36 | "name", 37 | "description", 38 | "largeIconImageUrl", 39 | "smallIconImageUrl", 40 | "id", 41 | "contentId" 42 | ] 43 | } 44 | }, 45 | 46 | "$schema": "http://json-schema.org/draft-04/schema#", 47 | "type": "array", 48 | "items": { 49 | "$ref": "#/definitions/Enemy" 50 | } 51 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/flexible-stats.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "FlexibleStat": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "name": { 9 | "type": "string" 10 | }, 11 | "type": { 12 | "type": "string" 13 | }, 14 | "id": { 15 | "type": "string" 16 | }, 17 | "contentId": { 18 | "type": "string" 19 | } 20 | }, 21 | "required": [ 22 | "name", 23 | "type", 24 | "id", 25 | "contentId" 26 | ] 27 | } 28 | }, 29 | 30 | "$schema": "http://json-schema.org/draft-04/schema#", 31 | "type": "array", 32 | "items": { 33 | "$ref": "#/definitions/FlexibleStat" 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/game-base-variants.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "GameBaseVariant": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "name": { 9 | "type": [ "null", "string" ] 10 | }, 11 | "internalName": { 12 | "type": "string" 13 | }, 14 | "iconUrl": { 15 | "type": [ "null", "string" ] 16 | }, 17 | "supportedGameModes": { 18 | "type": [ "null", "array" ], 19 | "additionalItems": false, 20 | "items": { 21 | "type": "string" 22 | } 23 | }, 24 | "id": { 25 | "type": "string" 26 | }, 27 | "contentId": { 28 | "type": "string" 29 | } 30 | }, 31 | "required": [ 32 | "name", 33 | "internalName", 34 | "iconUrl", 35 | "supportedGameModes", 36 | "id", 37 | "contentId" 38 | ] 39 | } 40 | }, 41 | 42 | "$schema": "http://json-schema.org/draft-04/schema#", 43 | "type": "array", 44 | "items": { 45 | "$ref": "#/definitions/GameBaseVariant" 46 | } 47 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/game-variant.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"Warzone", 3 | "description":"Complete Objectives to Earn Points. Destroy the Enemy Core for an Instant Victory.", 4 | "gameBaseVariantId":"f6de5351-3797-41e9-8053-7fb111a3a1a0", 5 | "iconUrl":"https://content.halocdn.com/media/Default/games/halo-5-guardians/game-type-icons/warzone-923f801e29374c6296e46515713da3c3.png", 6 | "id":"fa7808ca-970e-4912-ba4d-92f7ae4499e8", 7 | "contentId":"fa7808ca-970e-4912-ba4d-92f7ae4499e8" 8 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/game-variant.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "name": { 7 | "type": "string" 8 | }, 9 | "description": { 10 | "type": "string" 11 | }, 12 | "gameBaseVariantId": { 13 | "type": "string" 14 | }, 15 | "iconUrl": { 16 | "type": "string" 17 | }, 18 | "id": { 19 | "type": "string" 20 | }, 21 | "contentId": { 22 | "type": "string" 23 | } 24 | }, 25 | "required": [ 26 | "name", 27 | "description", 28 | "gameBaseVariantId", 29 | "iconUrl", 30 | "id", 31 | "contentId" 32 | ] 33 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/impulses.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Impulse": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "internalName": { 9 | "type": "string" 10 | }, 11 | "id": { 12 | /* 13 | * HACK: API returns a string but it's really an int. 14 | * HaloSharp's model uses an int, the JSON reponse uses a string. 15 | */ 16 | "type": [ "string", "integer" ] 17 | }, 18 | "contentId": { 19 | "type": "string" 20 | } 21 | }, 22 | "required": [ 23 | "internalName", 24 | "id", 25 | "contentId" 26 | ] 27 | } 28 | }, 29 | 30 | "$schema": "http://json-schema.org/draft-04/schema#", 31 | "type": "array", 32 | "items": { 33 | "$ref": "#/definitions/Impulse" 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/map-variant.json: -------------------------------------------------------------------------------- 1 | { 2 | "name":"March on Stormbreak", 3 | "description":"The Stormbreak mountain range is the broken spine of Kamchatka, mended a thousand millennia ago by the Forerunners' godlike power.", 4 | "mapImageUrl":"https://content.halocdn.com/media/Default/games/halo-5-guardians/map-images/warzone/stormbreak-cbacd64e24bb432db9cf30ac66602284.jpg", 5 | "mapId":"c854e54f-f206-11e4-bddc-24be05e24f7e", 6 | "id":"d9f9c30d-b1be-4381-a5a4-fe29026cca12", 7 | "contentId":"d9f9c30d-b1be-4381-a5a4-fe29026cca12" 8 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/map-variant.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "name": { 7 | "type": "string" 8 | }, 9 | "description": { 10 | "type": "string" 11 | }, 12 | "mapImageUrl": { 13 | "type": "string" 14 | }, 15 | "mapId": { 16 | "type": "string" 17 | }, 18 | "id": { 19 | "type": "string" 20 | }, 21 | "contentId": { 22 | "type": "string" 23 | } 24 | }, 25 | "required": [ 26 | "name", 27 | "description", 28 | "mapImageUrl", 29 | "mapId", 30 | "id", 31 | "contentId" 32 | ] 33 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/maps.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitFurious/HaloSharp/3e7fb75edba1bec86809bf7cdd9696802740bc3e/Source/HaloSharp.Test/JSON/Halo5/Metadata/maps.json -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/maps.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Map": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "name": { 9 | "type": [ "string", "null" ] 10 | }, 11 | "description": { 12 | "type": [ "string", "null" ] 13 | }, 14 | "supportedGameModes": { 15 | "type": [ "array", "null" ], 16 | "items": { 17 | "type": "string" 18 | } 19 | }, 20 | "imageUrl": { 21 | "type": "string" 22 | }, 23 | "id": { 24 | "type": "string" 25 | }, 26 | "contentId": { 27 | "type": "string" 28 | } 29 | }, 30 | "required": [ 31 | "name", 32 | "description", 33 | "supportedGameModes", 34 | "imageUrl", 35 | "id", 36 | "contentId" 37 | ] 38 | } 39 | }, 40 | 41 | "$schema": "http://json-schema.org/draft-04/schema#", 42 | "type": "array", 43 | "items": { 44 | "$ref": "#/definitions/Map" 45 | } 46 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/playlists.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitFurious/HaloSharp/3e7fb75edba1bec86809bf7cdd9696802740bc3e/Source/HaloSharp.Test/JSON/Halo5/Metadata/playlists.json -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/playlists.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Playlist": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "name": { 9 | "type": "string" 10 | }, 11 | "description": { 12 | "type": "string" 13 | }, 14 | "isRanked": { 15 | "type": "boolean" 16 | }, 17 | "imageUrl": { 18 | "type": [ "string", "null" ] 19 | }, 20 | "gameMode": { 21 | "type": "string" 22 | }, 23 | "isActive": { 24 | "type": "boolean" 25 | }, 26 | "id": { 27 | "type": "string" 28 | }, 29 | "contentId": { 30 | "type": "string" 31 | } 32 | }, 33 | "required": [ 34 | "name", 35 | "description", 36 | "isRanked", 37 | "imageUrl", 38 | "gameMode", 39 | "isActive", 40 | "id", 41 | "contentId" 42 | ] 43 | } 44 | }, 45 | 46 | "$schema": "http://json-schema.org/draft-04/schema#", 47 | "type": "array", 48 | "items": { 49 | "$ref": "#/definitions/Playlist" 50 | } 51 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/requisition-pack.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$ref": "common/requisition-pack.schema.json" 3 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/requisition.json: -------------------------------------------------------------------------------- 1 | { 2 | "supportedGameModes":[ 3 | "Warzone" 4 | ], 5 | "name":"Nornfang", 6 | "description":"A master-crafted instrument of death and destruction. Mythic Sniper Rifle firing high explosive armor piercing (APHE) rounds that increases overall damage. In addition, Linda's modifications ensure the Motion Tracker is visible even when using Zoom.", 7 | "rarityType":"Legendary", 8 | "rarity":"Legendary", 9 | "isMythic":true, 10 | "isCertification":false, 11 | "isWearable":false, 12 | "hideIfNotAcquired":false, 13 | "useType":"Consumable", 14 | "largeImageUrl":"https://image.halocdn.com:443/h5/requisitions/a23a896d-57e6-45c3-970b-27550f0e7184?locale=en&width=200&hash=H%2b0SkJV2oQsDv%2fDiUafVqoTeCmx2gebaSeTsg%2bX0oRk%3d", 15 | "categoryName":"Power and Vehicle", 16 | "internalCategoryName":"PowerAndVehicle", 17 | "subcategoryName":"Power Weapon", 18 | "internalSubcategoryName":"PowerWeapon", 19 | "subcategoryOrder":1, 20 | "sellPrice":200, 21 | "levelRequirement":7, 22 | "certificationRequisitionId":"f1e71491-cd08-4c14-9517-ddd07b67652e", 23 | "id":"a23a896d-57e6-45c3-970b-27550f0e7184", 24 | "contentId":"a23a896d-57e6-45c3-970b-27550f0e7184" 25 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/seasons.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitFurious/HaloSharp/3e7fb75edba1bec86809bf7cdd9696802740bc3e/Source/HaloSharp.Test/JSON/Halo5/Metadata/seasons.json -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/seasons.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Season": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "playlists": { 9 | "$ref": "playlists.schema.json" 10 | }, 11 | "iconUrl": { 12 | "type": [ "string", "null" ] 13 | }, 14 | "name": { 15 | "type": "string" 16 | }, 17 | "startDate": { 18 | "type": [ "string", "null" ] 19 | }, 20 | "endDate": { 21 | "type": [ "string", "null" ] 22 | }, 23 | "isActive": { 24 | "type": "boolean" 25 | }, 26 | "id": { 27 | "type": "string" 28 | }, 29 | "contentId": { 30 | "type": "string" 31 | } 32 | }, 33 | "required": [ 34 | "playlists", 35 | "iconUrl", 36 | "name", 37 | "startDate", 38 | "endDate", 39 | "isActive", 40 | "id", 41 | "contentId" 42 | ] 43 | } 44 | }, 45 | 46 | "$schema": "http://json-schema.org/draft-04/schema#", 47 | "type": "array", 48 | "items": { 49 | "$ref": "#/definitions/Season" 50 | } 51 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/skulls.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Skull": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "name": { 9 | "type": "string" 10 | }, 11 | "description": { 12 | "type": "string" 13 | }, 14 | "imageUrl": { 15 | "type": "string" 16 | }, 17 | "missionId": { 18 | "type": "string" 19 | }, 20 | "id": { 21 | /* 22 | * HACK: API returns a string but it's really an int. 23 | * HaloSharp's model uses an int, the JSON reponse uses a string. 24 | */ 25 | "type": [ "string", "integer" ] 26 | }, 27 | "contentId": { 28 | "type": "string" 29 | } 30 | }, 31 | "required": [ 32 | "name", 33 | "description", 34 | "imageUrl", 35 | "missionId", 36 | "id", 37 | "contentId" 38 | ] 39 | } 40 | }, 41 | 42 | "$schema": "http://json-schema.org/draft-04/schema#", 43 | "type": "array", 44 | "items": { 45 | "$ref": "#/definitions/Skull" 46 | } 47 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/spartan-ranks.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "SpartanRank": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "startXp": { 9 | "type": "integer" 10 | }, 11 | "reward": { 12 | "$ref": "common/reward.schema.json" 13 | }, 14 | "id": { 15 | /* 16 | * HACK: API returns a string but it's really an int. 17 | * HaloSharp's model uses an int, the JSON reponse uses a string. 18 | */ 19 | "type": [ "string", "integer" ] 20 | }, 21 | "contentId": { 22 | "type": "string" 23 | } 24 | }, 25 | "required": [ 26 | "startXp", 27 | "reward", 28 | "id", 29 | "contentId" 30 | ] 31 | } 32 | }, 33 | 34 | "$schema": "http://json-schema.org/draft-04/schema#", 35 | "type": "array", 36 | "items": { 37 | "$ref": "#/definitions/SpartanRank" 38 | } 39 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/team-colors.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "TeamColor": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "name": { 9 | "type": "string" 10 | }, 11 | "description": { 12 | "type": [ "string", "null" ] 13 | }, 14 | "color": { 15 | "type": "string" 16 | }, 17 | "iconUrl": { 18 | "type": "string" 19 | }, 20 | "id": { 21 | /* 22 | * HACK: API returns a string but it's really an int. 23 | * HaloSharp's model uses an int, the JSON reponse uses a string. 24 | */ 25 | "type": [ "string", "integer" ] 26 | }, 27 | "contentId": { 28 | "type": "string" 29 | } 30 | }, 31 | "required": [ 32 | "name", 33 | "description", 34 | "color", 35 | "iconUrl", 36 | "id", 37 | "contentId" 38 | ] 39 | } 40 | }, 41 | 42 | "$schema": "http://json-schema.org/draft-04/schema#", 43 | "type": "array", 44 | "items": { 45 | "$ref": "#/definitions/TeamColor" 46 | } 47 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/vehicles.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Vehicle": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "name": { 9 | "type": "string" 10 | }, 11 | "description": { 12 | "type": [ "string", "null" ] 13 | }, 14 | "largeIconImageUrl": { 15 | "type": "string" 16 | }, 17 | "smallIconImageUrl": { 18 | "type": "string" 19 | }, 20 | "isUsableByPlayer": { 21 | "type": "boolean" 22 | }, 23 | "id": { 24 | /* 25 | * HACK: API returns a string but it's really an int. 26 | * HaloSharp's model uses an int, the JSON reponse uses a string. 27 | */ 28 | "type": [ "string", "integer" ] 29 | }, 30 | "contentId": { 31 | "type": "string" 32 | } 33 | }, 34 | "required": [ 35 | "name", 36 | "description", 37 | "largeIconImageUrl", 38 | "smallIconImageUrl", 39 | "isUsableByPlayer", 40 | "id", 41 | "contentId" 42 | ] 43 | } 44 | }, 45 | 46 | "$schema": "http://json-schema.org/draft-04/schema#", 47 | "type": "array", 48 | "items": { 49 | "$ref": "#/definitions/Vehicle" 50 | } 51 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Metadata/weapons.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Weapon": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "name": { 9 | "type": "string" 10 | }, 11 | "description": { 12 | "type": [ "string", "null" ] 13 | }, 14 | "type": { 15 | "type": "string" 16 | }, 17 | "largeIconImageUrl": { 18 | "type": "string" 19 | }, 20 | "smallIconImageUrl": { 21 | "type": "string" 22 | }, 23 | "isUsableByPlayer": { 24 | "type": "boolean" 25 | }, 26 | "id": { 27 | /* 28 | * HACK: API returns a string but it's really an int. 29 | * HaloSharp's model uses an int, the JSON reponse uses a string. 30 | */ 31 | "type": [ "string", "integer" ] 32 | }, 33 | "contentId": { 34 | "type": "string" 35 | } 36 | }, 37 | "required": [ 38 | "name", 39 | "description", 40 | "type", 41 | "largeIconImageUrl", 42 | "smallIconImageUrl", 43 | "isUsableByPlayer", 44 | "id", 45 | "contentId" 46 | ] 47 | } 48 | }, 49 | 50 | "$schema": "http://json-schema.org/draft-04/schema#", 51 | "type": "array", 52 | "items": { 53 | "$ref": "#/definitions/Weapon" 54 | } 55 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/CarnageReport/Common/boost-info.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": [ "object", "null" ], 4 | "additionalProperties": false, 5 | "properties": { 6 | "CardConsumed": { 7 | "type": "boolean" 8 | }, 9 | "DefinitionId": { 10 | "type": "string" 11 | } 12 | }, 13 | "required": [ 14 | "CardConsumed", 15 | "DefinitionId" 16 | ] 17 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/CarnageReport/Common/credits-earned.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Result": { 7 | "type": "integer" 8 | }, 9 | "TotalCreditsEarned": { 10 | "type": "integer" 11 | }, 12 | "SpartanRankModifier": { 13 | "type": "number" 14 | }, 15 | "PlayerRankAmount": { 16 | "type": "integer" 17 | }, 18 | "TimePlayedAmount": { 19 | "type": "number" 20 | }, 21 | "BoostAmount": { 22 | "type": "integer" 23 | }, 24 | "MatchSpeedWinAmount": { 25 | "type": "integer" 26 | }, 27 | "ObjectivesCompletedAmount": { 28 | "type": "integer" 29 | } 30 | }, 31 | "required": [ 32 | "Result", 33 | "TotalCreditsEarned", 34 | "SpartanRankModifier", 35 | "PlayerRankAmount", 36 | "TimePlayedAmount", 37 | "BoostAmount", 38 | "MatchSpeedWinAmount", 39 | "ObjectivesCompletedAmount" 40 | ] 41 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/CarnageReport/Common/meta-commendation-delta.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Requirement": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Data1": { 9 | "type": "integer" 10 | }, 11 | "Data2": { 12 | "type": "integer" 13 | }, 14 | "Data3": { 15 | "type": "integer" 16 | }, 17 | "Data4": { 18 | "type": "integer" 19 | } 20 | }, 21 | "required": [ 22 | "Data1", 23 | "Data2", 24 | "Data3", 25 | "Data4" 26 | ] 27 | } 28 | }, 29 | 30 | "$schema": "http://json-schema.org/draft-04/schema#", 31 | "type": "object", 32 | "additionalProperties": false, 33 | "properties": { 34 | "Id": { 35 | "type": "string" 36 | }, 37 | "MetRequirements": { 38 | "type": "array", 39 | "items": { 40 | "$ref": "#/definitions/Requirement" 41 | } 42 | }, 43 | "PreviousMetRequirements": { 44 | "type": "array", 45 | "items": { 46 | "$ref": "#/definitions/Requirement" 47 | } 48 | } 49 | }, 50 | "required": [ 51 | "Id", 52 | "MetRequirements", 53 | "PreviousMetRequirements" 54 | ] 55 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/CarnageReport/Common/oppenent-details.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "GamerTag": { 7 | "type": "string" 8 | }, 9 | "TotalKills": { 10 | "type": "integer" 11 | } 12 | }, 13 | "required": [ 14 | "GamerTag", 15 | "TotalKills" 16 | ] 17 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/CarnageReport/Common/progressive-commendation-delta.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Id": { 7 | "type": "string" 8 | }, 9 | "PreviousProgress": { 10 | "type": "integer" 11 | }, 12 | "Progress": { 13 | "type": "integer" 14 | } 15 | }, 16 | "required": [ 17 | "Id", 18 | "PreviousProgress", 19 | "Progress" 20 | ] 21 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/CarnageReport/Common/reward-set.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "RewardSet": { 7 | "type": "string" 8 | }, 9 | "RewardSourceType": { 10 | "type": "integer" 11 | }, 12 | "SpartanRankSource": { 13 | "type": [ "integer", "null" ] 14 | }, 15 | "CommendationLevelId": { 16 | "type": [ "string", "null" ] 17 | }, 18 | "CommendationSource": { 19 | "type": [ "string", "null" ] 20 | } 21 | }, 22 | "required": [ 23 | "RewardSet", 24 | "RewardSourceType", 25 | "SpartanRankSource", 26 | "CommendationLevelId", 27 | "CommendationSource" 28 | ] 29 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/CarnageReport/Common/team-stat.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "RoundStat": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "RoundNumber": { 9 | "type": "integer" 10 | }, 11 | "Rank": { 12 | "type": "integer" 13 | }, 14 | "Score": { 15 | "type": "integer" 16 | } 17 | }, 18 | "required": [ 19 | "RoundNumber", 20 | "Rank", 21 | "Score" 22 | ] 23 | } 24 | }, 25 | 26 | "$schema": "http://json-schema.org/draft-04/schema#", 27 | "type": "object", 28 | "additionalProperties": false, 29 | "properties": { 30 | "TeamId": { 31 | "type": "integer" 32 | }, 33 | "Score": { 34 | "type": "integer" 35 | }, 36 | "Rank": { 37 | "type": "integer" 38 | }, 39 | "RoundStats": { 40 | "type": "array", 41 | "items": { 42 | "$ref": "#/definitions/RoundStat" 43 | } 44 | } 45 | }, 46 | "required": [ 47 | "TeamId", 48 | "Score", 49 | "Rank", 50 | "RoundStats" 51 | ] 52 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/CarnageReport/Common/xp-info.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "PrevSpartanRank": { 7 | "type": "integer" 8 | }, 9 | "SpartanRank": { 10 | "type": "integer" 11 | }, 12 | "PrevTotalXP": { 13 | "type": "integer" 14 | }, 15 | "TotalXP": { 16 | "type": "integer" 17 | }, 18 | "SpartanRankMatchXPScalar": { 19 | "type": "number" 20 | }, 21 | "PlayerTimePerformanceXPAward": { 22 | "type": "integer" 23 | }, 24 | "PerformanceXP": { 25 | "type": [ "null", "integer" ] 26 | }, 27 | "PlayerRankXPAward": { 28 | "type": "integer" 29 | }, 30 | "BoostAmount": { 31 | "type": "integer" 32 | }, 33 | "MatchSpeedWinAmount": { 34 | "type": "integer" 35 | }, 36 | "ObjectivesCompletedAmount": { 37 | "type": "integer" 38 | } 39 | }, 40 | "required": [ 41 | "PrevSpartanRank", 42 | "SpartanRank", 43 | "PrevTotalXP", 44 | "TotalXP", 45 | "SpartanRankMatchXPScalar", 46 | "PlayerTimePerformanceXPAward", 47 | "PerformanceXP", 48 | "PlayerRankXPAward", 49 | "BoostAmount", 50 | "MatchSpeedWinAmount", 51 | "ObjectivesCompletedAmount" 52 | ] 53 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/Common/competitive-skill-ranking.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": ["object", "null"], 4 | "additionalProperties": false, 5 | "properties": { 6 | "Tier": { 7 | "type": "integer" 8 | }, 9 | "DesignationId": { 10 | "type": "integer" 11 | }, 12 | "Csr": { 13 | "type": "integer" 14 | }, 15 | "PercentToNextTier": { 16 | "type": "integer" 17 | }, 18 | "Rank": { 19 | "type": [ "integer", "null" ] 20 | } 21 | }, 22 | "required": [ 23 | "Tier", 24 | "DesignationId", 25 | "Csr", 26 | "PercentToNextTier", 27 | "Rank" 28 | ] 29 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/Common/flexible-stats.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "StatCount": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Id": { 9 | "type": "string" 10 | }, 11 | "Count": { 12 | "type": "integer" 13 | } 14 | }, 15 | "required": [ 16 | "Id", 17 | "Count" 18 | ] 19 | }, 20 | 21 | "Timelapse": { 22 | "$schema": "http://json-schema.org/draft-04/schema#", 23 | "type": "object", 24 | "additionalProperties": false, 25 | "properties": { 26 | "Id": { 27 | "type": "string" 28 | }, 29 | "Timelapse": { 30 | "type": "string" 31 | } 32 | }, 33 | "required": [ 34 | "Id", 35 | "Timelapse" 36 | ] 37 | } 38 | }, 39 | 40 | "$schema": "http://json-schema.org/draft-04/schema#", 41 | "type": "object", 42 | "additionalProperties": false, 43 | "properties": { 44 | "MedalStatCounts": { 45 | "type": "array", 46 | "items": { 47 | "$ref": "#/definitions/StatCount" 48 | } 49 | }, 50 | "ImpulseStatCounts": { 51 | "type": "array", 52 | "items": { 53 | "$ref": "#/definitions/StatCount" 54 | } 55 | }, 56 | "MedalTimelapses": { 57 | "type": "array", 58 | "items": { 59 | "$ref": "#/definitions/Timelapse" 60 | } 61 | }, 62 | "ImpulseTimelapses": { 63 | "type": "array", 64 | "items": { 65 | "$ref": "#/definitions/Timelapse" 66 | } 67 | } 68 | }, 69 | "required": [ 70 | "MedalStatCounts", 71 | "ImpulseStatCounts", 72 | "MedalTimelapses", 73 | "ImpulseTimelapses" 74 | ] 75 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/Lifetime/Common/top-game-base-variant.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "GameBaseVariantRank": { 7 | "type": "integer" 8 | }, 9 | "NumberOfMatchesCompleted": { 10 | "type": "integer" 11 | }, 12 | "GameBaseVariantId": { 13 | "type": "string" 14 | }, 15 | "NumberOfMatchesWon": { 16 | "type": "integer" 17 | } 18 | }, 19 | "required": [ 20 | "GameBaseVariantRank", 21 | "NumberOfMatchesCompleted", 22 | "GameBaseVariantId", 23 | "NumberOfMatchesWon" 24 | ] 25 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/Stats/leaderboard.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Result": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Player": { 9 | "$ref": "../../common/identity.schema.json" 10 | }, 11 | "Rank": { 12 | "type": "integer" 13 | }, 14 | "Score": { 15 | "$ref": "common/competitive-skill-ranking.schema.json" 16 | } 17 | }, 18 | "required": [ 19 | "Player", 20 | "Rank", 21 | "Score" 22 | ] 23 | } 24 | }, 25 | 26 | "$schema": "http://json-schema.org/draft-04/schema#", 27 | "type": "object", 28 | "additionalProperties": false, 29 | "properties": { 30 | "Start": { 31 | "type": "integer" 32 | }, 33 | "Count": { 34 | "type": "integer" 35 | }, 36 | "ResultCount": { 37 | "type": "integer" 38 | }, 39 | "Results": { 40 | "type": "array", 41 | "items": { 42 | "$ref": "#/definitions/Result" 43 | } 44 | }, 45 | "Links": { 46 | "$ref": "../../common/link.schema.json" 47 | } 48 | }, 49 | "required": [ 50 | "Start", 51 | "Count", 52 | "ResultCount", 53 | "Results", 54 | "Links" 55 | ] 56 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/UserGeneratedContent/Common/stats.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "BookmarkCount": { 7 | "type": "integer" 8 | }, 9 | "HasCallerBookmarked": { 10 | "type": "boolean" 11 | } 12 | }, 13 | "required": [ 14 | "BookmarkCount", 15 | "HasCallerBookmarked" 16 | ] 17 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/UserGeneratedContent/game-variant.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseGameEngineType": 1, 3 | "GameType": 1, 4 | "BaseGame": { 5 | "ResourceType": 8, 6 | "ResourceId": "67f7671d-7b81-489a-b9d5-3c652695f2ad", 7 | "OwnerType": 3, 8 | "Owner": null 9 | }, 10 | "ScoreToWin": 0, 11 | "NumberOfLives": 0, 12 | "MatchDurationInSeconds": 0, 13 | "NumberOfRounds": 0, 14 | "Name": "Ducain23's Race Gametype", 15 | "Description": "Scubs", 16 | "AccessControl": 0, 17 | "Links": {}, 18 | "CreationTimeUtc": { 19 | "ISO8601Date": "2016-04-06T00:00:00Z" 20 | }, 21 | "LastModifiedTimeUtc": { 22 | "ISO8601Date": "2016-04-06T00:00:00Z" 23 | }, 24 | "Banned": false, 25 | "Identity": { 26 | "ResourceType": 2, 27 | "ResourceId": "05c399ca-78cd-4dca-a0bd-c143f5ecb308", 28 | "OwnerType": 1, 29 | "Owner": "ducain23" 30 | }, 31 | "Stats": { 32 | "BookmarkCount": 691, 33 | "HasCallerBookmarked": false 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/UserGeneratedContent/game-variant.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "BaseGameEngineType": { 7 | "type": "integer" 8 | }, 9 | "GameType": { 10 | "type": "integer" 11 | }, 12 | "BaseGame": { 13 | "$ref": "../common/variant.schema.json" 14 | }, 15 | "ScoreToWin": { 16 | "type": "integer" 17 | }, 18 | "NumberOfLives": { 19 | "type": "integer" 20 | }, 21 | "MatchDurationInSeconds": { 22 | "type": "integer" 23 | }, 24 | "NumberOfRounds": { 25 | "type": "integer" 26 | }, 27 | "Name": { 28 | "type": "string" 29 | }, 30 | "Description": { 31 | "type": "string" 32 | }, 33 | "AccessControl": { 34 | "type": "integer" 35 | }, 36 | "Links": { 37 | "$ref": "../../common/link.schema.json" 38 | }, 39 | "CreationTimeUtc": { 40 | "$ref": "../../common/iso-8061.schema.json" 41 | }, 42 | "LastModifiedTimeUtc": { 43 | "$ref": "../../common/iso-8061.schema.json" 44 | }, 45 | "Banned": { 46 | "type": "boolean" 47 | }, 48 | "Identity": { 49 | "$ref": "../common/variant.schema.json" 50 | }, 51 | "Stats": { 52 | "$ref": "./common/stats.schema.json" 53 | } 54 | }, 55 | "required": [ 56 | "BaseGameEngineType", 57 | "GameType", 58 | "BaseGame", 59 | "ScoreToWin", 60 | "NumberOfLives", 61 | "MatchDurationInSeconds", 62 | "NumberOfRounds", 63 | "Name", 64 | "Description", 65 | "AccessControl", 66 | "Links", 67 | "CreationTimeUtc", 68 | "LastModifiedTimeUtc", 69 | "Banned", 70 | "Identity", 71 | "Stats" 72 | ] 73 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/UserGeneratedContent/game-variants.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Results": { 7 | "type": "array", 8 | "items": { 9 | "$ref": "game-variant.schema.json" 10 | } 11 | }, 12 | "Start": { 13 | "type": "integer" 14 | }, 15 | "Count": { 16 | "type": "integer" 17 | }, 18 | "ResultCount": { 19 | "type": "integer" 20 | }, 21 | "TotalCount": { 22 | "type": "integer" 23 | }, 24 | "Links": { 25 | "$ref": "../../common/link.schema.json" 26 | } 27 | }, 28 | "required": [ 29 | "Results", 30 | "Start", 31 | "Count", 32 | "ResultCount", 33 | "TotalCount", 34 | "Links" 35 | ] 36 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/UserGeneratedContent/map-variant.json: -------------------------------------------------------------------------------- 1 | { 2 | "BaseMap": { 3 | "ResourceType": 9, 4 | "ResourceId": "23466553-2d1c-4a00-9d55-4444ede629bf", 5 | "OwnerType": 3, 6 | "Owner": null 7 | }, 8 | "Name": "Entombed v2", 9 | "Description": "Entombed v2", 10 | "AccessControl": 0, 11 | "Links": { 12 | 13 | }, 14 | "CreationTimeUtc": { 15 | "ISO8601Date": "2016-08-28T00:00:00Z" 16 | }, 17 | "LastModifiedTimeUtc": { 18 | "ISO8601Date": "2016-09-03T00:00:00Z" 19 | }, 20 | "Banned": false, 21 | "Identity": { 22 | "ResourceType": 3, 23 | "ResourceId": "7f1489ad-77bb-42a5-8ffc-5990a0e83dfa", 24 | "OwnerType": 1, 25 | "Owner": "ducain23" 26 | }, 27 | "Stats": { 28 | "BookmarkCount": 18, 29 | "HasCallerBookmarked": false 30 | } 31 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/UserGeneratedContent/map-variant.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "BaseMap": { 7 | "$ref": "../common/variant.schema.json" 8 | }, 9 | "Name": { 10 | "type": "string" 11 | }, 12 | "Description": { 13 | "type": "string" 14 | }, 15 | "AccessControl": { 16 | "type": "integer" 17 | }, 18 | "Links": { 19 | "$ref": "../../common/link.schema.json" 20 | }, 21 | "CreationTimeUtc": { 22 | "$ref": "../../common/iso-8061.schema.json" 23 | }, 24 | "LastModifiedTimeUtc": { 25 | "$ref": "../../common/iso-8061.schema.json" 26 | }, 27 | "Banned": { 28 | "type": "boolean" 29 | }, 30 | "Identity": { 31 | "$ref": "../common/variant.schema.json" 32 | }, 33 | "Stats": { 34 | "$ref": "./common/stats.schema.json" 35 | } 36 | }, 37 | "required": [ 38 | "BaseMap", 39 | "Name", 40 | "Description", 41 | "AccessControl", 42 | "Links", 43 | "CreationTimeUtc", 44 | "LastModifiedTimeUtc", 45 | "Banned", 46 | "Identity", 47 | "Stats" 48 | ] 49 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/Halo5/UserGeneratedContent/map-variants.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Results": { 7 | "type": "array", 8 | "items": { 9 | "$ref": "map-variant.schema.json" 10 | } 11 | }, 12 | "Start": { 13 | "type": "integer" 14 | }, 15 | "Count": { 16 | "type": "integer" 17 | }, 18 | "ResultCount": { 19 | "type": "integer" 20 | }, 21 | "TotalCount": { 22 | "type": "integer" 23 | }, 24 | "Links": { 25 | "$ref": "../../common/link.schema.json" 26 | } 27 | }, 28 | "required": [ 29 | "Results", 30 | "Start", 31 | "Count", 32 | "ResultCount", 33 | "TotalCount", 34 | "Links" 35 | ] 36 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/batch-localization.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "IsLocked": { 7 | "type": "boolean" 8 | } 9 | }, 10 | "required": [ 11 | "IsLocked" 12 | ] 13 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/common.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Owner": { 7 | "type": "string" 8 | }, 9 | "CreatedUtc": { 10 | "type": "string" 11 | }, 12 | "ModifiedUtc": { 13 | "type": "string" 14 | }, 15 | "PublishedUtc": { 16 | "type": "string" 17 | }, 18 | "Container": { 19 | "type": "integer" 20 | } 21 | }, 22 | "required": [ 23 | "Owner", 24 | "CreatedUtc", 25 | "ModifiedUtc", 26 | "PublishedUtc", 27 | "Container" 28 | ] 29 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/content-item-type-b.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "null": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Id": { 9 | "type": "integer" 10 | }, 11 | "Type": { 12 | "type": "null" 13 | }, 14 | "View": { 15 | "type": "null" 16 | } 17 | }, 18 | "required": [ 19 | "Id", 20 | "Type", 21 | "View" 22 | ] 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/content-item-type-c.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "null": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Id": { 9 | "type": "integer" 10 | }, 11 | "Type": { 12 | "type": "null" 13 | }, 14 | "Identity": { 15 | "type": "string" 16 | } 17 | }, 18 | "required": [ 19 | "Id", 20 | "Type", 21 | "Identity" 22 | ] 23 | }, 24 | 25 | "ContentItemTypeC": { 26 | "$schema": "http://json-schema.org/draft-04/schema#", 27 | "type": "object", 28 | "additionalProperties": false, 29 | "properties": { 30 | "Id": { 31 | "type": "integer" 32 | }, 33 | "Type": { 34 | "type": "string" 35 | }, 36 | "Identity": { 37 | "type": "string" 38 | } 39 | }, 40 | "required": [ 41 | "Id", 42 | "Type", 43 | "Identity" 44 | ] 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/content-item-type-d.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "null": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Id": { 9 | "type": "integer" 10 | }, 11 | "Type": { 12 | "type": "null" 13 | }, 14 | "Identity": { 15 | "type": "string" 16 | }, 17 | "Autoroute": { 18 | "type": "null" 19 | } 20 | }, 21 | "required": [ 22 | "Id", 23 | "Type", 24 | "Identity", 25 | "Autoroute" 26 | ] 27 | }, 28 | 29 | "ContentItemTypeD": { 30 | "$schema": "http://json-schema.org/draft-04/schema#", 31 | "type": "object", 32 | "additionalProperties": false, 33 | "properties": { 34 | "Id": { 35 | "type": "integer" 36 | }, 37 | "Type": { 38 | "type": "string" 39 | }, 40 | "Identity": { 41 | "type": "string" 42 | }, 43 | "Autoroute": { 44 | "type": "string" 45 | } 46 | }, 47 | "required": [ 48 | "Id", 49 | "Type", 50 | "Identity", 51 | "Autoroute" 52 | ] 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/empty.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { } 6 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/link.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Absolute": { 7 | "type": "boolean" 8 | }, 9 | "Relation": { 10 | "type": "string" 11 | }, 12 | "URI": { 13 | "type": "string" 14 | } 15 | }, 16 | "required": [ 17 | "Absolute", 18 | "Relation", 19 | "URI" 20 | ] 21 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/localization.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Culture": { 7 | "type": "string" 8 | }, 9 | "MasterContentItemId": { 10 | "type": "string" 11 | } 12 | }, 13 | "required": [ 14 | "Culture", 15 | "MasterContentItemId" 16 | ] 17 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/Common/paging.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "StartAt": { 7 | "type": "integer" 8 | }, 9 | "InlineCount": { 10 | "type": "integer" 11 | }, 12 | "TotalCount": { 13 | "type": "integer" 14 | } 15 | }, 16 | "required": [ 17 | "StartAt", 18 | "InlineCount", 19 | "TotalCount" 20 | ] 21 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/difficulties.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitFurious/HaloSharp/3e7fb75edba1bec86809bf7cdd9696802740bc3e/Source/HaloSharp.Test/JSON/HaloWars2/Metadata/difficulties.json -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/difficulties.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Paging": { 7 | "$ref": "common/paging.schema.json" 8 | }, 9 | "ContentItems": { 10 | "type": "array", 11 | "items": { 12 | "$ref": "common/difficulty.schema.json#/definitions/HW2DifficultyContentItemTypeA" 13 | } 14 | } 15 | }, 16 | "required": [ 17 | "Paging", 18 | "ContentItems" 19 | ] 20 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/leaders.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitFurious/HaloSharp/3e7fb75edba1bec86809bf7cdd9696802740bc3e/Source/HaloSharp.Test/JSON/HaloWars2/Metadata/leaders.json -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/maps.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Paging": { 7 | "$ref": "common/paging.schema.json" 8 | }, 9 | "ContentItems": { 10 | "type": "array", 11 | "items": { 12 | "$ref": "common/map.schema.json#/definitions/HW2MapContentItemTypeA" 13 | } 14 | } 15 | }, 16 | "required": [ 17 | "Paging", 18 | "ContentItems" 19 | ] 20 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/packs.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Paging": { 7 | "$ref": "common/paging.schema.json" 8 | }, 9 | "ContentItems": { 10 | "type": "array", 11 | "items": { 12 | "$ref": "common/pack.schema.json#/definitions/HW2PackContentItemTypeA" 13 | } 14 | } 15 | }, 16 | "required": [ 17 | "Paging", 18 | "ContentItems" 19 | ] 20 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/playlists.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gitFurious/HaloSharp/3e7fb75edba1bec86809bf7cdd9696802740bc3e/Source/HaloSharp.Test/JSON/HaloWars2/Metadata/playlists.json -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Metadata/playlists.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Paging": { 7 | "$ref": "common/paging.schema.json" 8 | }, 9 | "ContentItems": { 10 | "type": "array", 11 | "items": { 12 | "$ref": "common/playlist.schema.json#/definitions/HW2PlaylistContentItemTypeA" 13 | } 14 | } 15 | }, 16 | "required": [ 17 | "Paging", 18 | "ContentItems" 19 | ] 20 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/Common/competitive-skill-rank.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Tier": { 7 | "type": [ "null", "integer" ] 8 | }, 9 | "Designation": { 10 | "type": [ "null", "integer" ] 11 | }, 12 | "Raw": { 13 | "type": [ "null", "integer" ] 14 | }, 15 | "PercentToNextTier": { 16 | "type": [ "null", "integer" ] 17 | }, 18 | "MeasurementMatchesRemaining": { 19 | "type": "integer" 20 | }, 21 | "Rank": { 22 | "type": [ "null", "integer" ] 23 | } 24 | }, 25 | "required": [ 26 | "Tier", 27 | "Designation", 28 | "Raw", 29 | "PercentToNextTier", 30 | "MeasurementMatchesRemaining", 31 | "Rank" 32 | ] 33 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/Common/experience-progress.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "CompletedSpartanRank": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Id": { 9 | "type": "string" 10 | }, 11 | "PacksAwarded": { 12 | "type": "integer" 13 | } 14 | }, 15 | "required": [ 16 | "Id", 17 | "PacksAwarded" 18 | ] 19 | } 20 | }, 21 | 22 | "$schema": "http://json-schema.org/draft-04/schema#", 23 | "type": [ "object", "null" ], 24 | "additionalProperties": false, 25 | "properties": { 26 | "PreviousTotalXP": { 27 | "type": "integer" 28 | }, 29 | "GameplayXP": { 30 | "type": "integer" 31 | }, 32 | "ChallengesXP": { 33 | "type": "integer" 34 | }, 35 | "UpdatedTotalXP": { 36 | "type": "integer" 37 | }, 38 | "CompletedSpartanRanks": { 39 | "type": "array", 40 | "items": { 41 | "$ref": "#/definitions/CompletedSpartanRank" 42 | } 43 | } 44 | }, 45 | "required": [ 46 | "PreviousTotalXP", 47 | "GameplayXP", 48 | "ChallengesXP", 49 | "UpdatedTotalXP", 50 | "CompletedSpartanRanks" 51 | ] 52 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/Common/leader-stats.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": { 5 | "$schema": "http://json-schema.org/draft-04/schema#", 6 | "type": "object", 7 | "additionalProperties": false, 8 | "properties": { 9 | "TotalTimePlayed": { 10 | "type": "string" 11 | }, 12 | "TotalMatchesStarted": { 13 | "type": "integer" 14 | }, 15 | "TotalMatchesCompleted": { 16 | "type": "integer" 17 | }, 18 | "TotalMatchesWon": { 19 | "type": "integer" 20 | }, 21 | "TotalMatchesLost": { 22 | "type": "integer" 23 | }, 24 | "TotalLeaderPowersCast": { 25 | "type": "integer" 26 | } 27 | }, 28 | "required": [ 29 | "TotalTimePlayed", 30 | "TotalMatchesStarted", 31 | "TotalMatchesCompleted", 32 | "TotalMatchesWon", 33 | "TotalMatchesLost", 34 | "TotalLeaderPowersCast" 35 | ] 36 | } 37 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/Common/matchmaking-rank.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "Rating": { 7 | "type": "number" 8 | }, 9 | "Variance": { 10 | "type": "number" 11 | }, 12 | "LastModifiedDate": { 13 | "$ref": "../../../common/iso-8061.schema.json" 14 | } 15 | }, 16 | "required": [ 17 | "Rating", 18 | "Variance", 19 | "LastModifiedDate" 20 | ] 21 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/Common/rating-progress.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": [ "object", "null" ], 4 | "properties": { 5 | "PreviousCsr": { 6 | "oneOf": [ 7 | { "type": "null" }, 8 | { "$ref": "competitive-skill-rank.schema.json" } 9 | ] 10 | }, 11 | "UpdatedCsr": { 12 | "oneOf": [ 13 | { "type": "null" }, 14 | { "$ref": "competitive-skill-rank.schema.json" } 15 | ] 16 | }, 17 | "PreviousMmr": { 18 | "$ref": "matchmaking-rank.schema.json" 19 | }, 20 | "UpdatedMmr": { 21 | "$ref": "matchmaking-rank.schema.json" 22 | } 23 | }, 24 | "required": [ 25 | "PreviousCsr", 26 | "UpdatedCsr", 27 | "PreviousMmr", 28 | "UpdatedMmr" 29 | ] 30 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/Common/stats.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "PlaylistId": { 7 | "type": [ "null", "string" ] 8 | }, 9 | "PlaylistClassification": { 10 | "type": [ "null", "integer" ] 11 | }, 12 | "HighestCsr": { 13 | "oneOf": [ 14 | { "type": "null" }, 15 | { "$ref": "competitive-skill-rank.schema.json" } 16 | ] 17 | }, 18 | "TotalTimePlayed": { 19 | "type": [ "null", "string" ] 20 | }, 21 | "TotalMatchesStarted": { 22 | "type": "integer" 23 | }, 24 | "TotalMatchesCompleted": { 25 | "type": "integer" 26 | }, 27 | "TotalMatchesWon": { 28 | "type": "integer" 29 | }, 30 | "TotalMatchesLost": { 31 | "type": "integer" 32 | }, 33 | "TotalPointCaptures": { 34 | "type": "integer" 35 | }, 36 | "TotalUnitsBuilt": { 37 | "type": "integer" 38 | }, 39 | "TotalUnitsLost": { 40 | "type": "integer" 41 | }, 42 | "TotalUnitsDestroyed": { 43 | "type": "integer" 44 | }, 45 | "TotalCardPlays": { 46 | "type": "integer" 47 | }, 48 | "HighestWaveCompleted": { 49 | "type": "integer" 50 | }, 51 | "LeaderStats": { 52 | "$ref": "leader-stats.schema.json" 53 | } 54 | }, 55 | "required": [ 56 | "PlaylistId", 57 | "PlaylistClassification", 58 | "HighestCsr", 59 | "TotalTimePlayed", 60 | "TotalMatchesStarted", 61 | "TotalMatchesCompleted", 62 | "TotalMatchesWon", 63 | "TotalMatchesLost", 64 | "TotalPointCaptures", 65 | "TotalUnitsBuilt", 66 | "TotalUnitsLost", 67 | "TotalUnitsDestroyed", 68 | "TotalCardPlays", 69 | "HighestWaveCompleted", 70 | "LeaderStats" 71 | ] 72 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/experience-summary.json: -------------------------------------------------------------------------------- 1 | { 2 | "Results": [ 3 | { 4 | "Id": "Furiousn00b", 5 | "ResultCode": 0, 6 | "Result": { 7 | "MultiplayerXp": 100, 8 | "CampaignXp": 6600, 9 | "TotalXp": 6700, 10 | "LastUpdatedDateUtc": { 11 | "ISO8601Date": "2017-02-23T11:26:16.352Z" 12 | }, 13 | "SpartanRankId": "0a981f10-49f7-4275-bee7-4d8eac882ae4" 14 | } 15 | } 16 | ], 17 | "Links": { 18 | "Self": { 19 | "AuthorityId": "spartanstats", 20 | "Path": "/hw2/xp", 21 | "QueryString": "?players=Furiousn00b", 22 | "RetryPolicyId": "", 23 | "TopicName": "", 24 | "AcknowledgementTypeId": 0, 25 | "AuthenticationLifetimeExtensionSupported": false 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/experience-summary.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Result": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Id": { 9 | "type": "string" 10 | }, 11 | "ResultCode": { 12 | "type": "integer" 13 | }, 14 | "Result": { 15 | "$ref": "#/definitions/Summary" 16 | } 17 | }, 18 | "required": [ 19 | "Id", 20 | "ResultCode", 21 | "Result" 22 | ] 23 | }, 24 | 25 | "Summary": { 26 | "$schema": "http://json-schema.org/draft-04/schema#", 27 | "type": "object", 28 | "additionalProperties": false, 29 | "properties": { 30 | "MultiplayerXp": { 31 | "type": "integer" 32 | }, 33 | "CampaignXp": { 34 | "type": "integer" 35 | }, 36 | "TotalXp": { 37 | "type": "integer" 38 | }, 39 | "LastUpdatedDateUtc": { 40 | "$ref": "../../common/iso-8061.schema.json" 41 | }, 42 | "SpartanRankId": { 43 | "type": "string" 44 | } 45 | }, 46 | "required": [ 47 | "MultiplayerXp", 48 | "CampaignXp", 49 | "TotalXp", 50 | "LastUpdatedDateUtc", 51 | "SpartanRankId" 52 | ] 53 | } 54 | }, 55 | 56 | "$schema": "http://json-schema.org/draft-04/schema#", 57 | "type": "object", 58 | "additionalProperties": false, 59 | "properties": { 60 | "Results": { 61 | "type": "array", 62 | "items": { 63 | "$ref": "#/definitions/Result" 64 | } 65 | }, 66 | "Links": { 67 | "$ref": "../../common/link.schema.json" 68 | } 69 | }, 70 | "required": [ 71 | "Results", 72 | "Links" 73 | ] 74 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/playlist-ratings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Results": [ 3 | { 4 | "Id": "Furiousn00b", 5 | "ResultCode": 0, 6 | "Result": { 7 | "Mmr": { 8 | "Rating": -0.23655137960964817, 9 | "Variance": 0.94140322859668657, 10 | "LastModifiedDate": { 11 | "ISO8601Date": "" 12 | } 13 | }, 14 | "Csr": null 15 | } 16 | } 17 | ], 18 | "Links": { 19 | "Self": { 20 | "AuthorityId": "spartanstats", 21 | "Path": "/hw2/playlist/c80ddcda-219b-42e6-82f4-94fae8516d96/rating", 22 | "QueryString": "?players=Furiousn00b", 23 | "RetryPolicyId": "", 24 | "TopicName": "", 25 | "AcknowledgementTypeId": 0, 26 | "AuthenticationLifetimeExtensionSupported": false 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/playlist-ratings.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "definitions": { 3 | "Result": { 4 | "$schema": "http://json-schema.org/draft-04/schema#", 5 | "type": "object", 6 | "additionalProperties": false, 7 | "properties": { 8 | "Id": { 9 | "type": "string" 10 | }, 11 | "ResultCode": { 12 | "type": "integer" 13 | }, 14 | "Result": { 15 | "$ref": "#/definitions/Ratings" 16 | } 17 | }, 18 | "required": [ 19 | "Id", 20 | "ResultCode", 21 | "Result" 22 | ] 23 | }, 24 | 25 | "Ratings": { 26 | "$schema": "http://json-schema.org/draft-04/schema#", 27 | "type": "object", 28 | "additionalProperties": false, 29 | "properties": { 30 | "Mmr": { 31 | "oneOf": [ 32 | { "type": "null" }, 33 | { "$ref": "common/matchmaking-rank.schema.json" } 34 | ] 35 | }, 36 | "Csr": { 37 | "oneOf": [ 38 | { "type": "null" }, 39 | { "$ref": "common/competitive-skill-rank.schema.json" } 40 | ] 41 | } 42 | }, 43 | "required": [ 44 | "Mmr", 45 | "Csr" 46 | ] 47 | } 48 | }, 49 | 50 | "$schema": "http://json-schema.org/draft-04/schema#", 51 | "type": "object", 52 | "additionalProperties": false, 53 | "properties": { 54 | "Results": { 55 | "type": "array", 56 | "items": { 57 | "$ref": "#/definitions/Result" 58 | } 59 | }, 60 | "Links": { 61 | "$ref": "../../common/link.schema.json" 62 | } 63 | }, 64 | "required": [ 65 | "Results", 66 | "Links" 67 | ] 68 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/season-summary.json: -------------------------------------------------------------------------------- 1 | { 2 | "SeasonId": "2cdf3fae-3cf9-45a5-8165-7aff644ccdbc", 3 | "RankedPlaylistStats": [] 4 | } 5 | -------------------------------------------------------------------------------- /Source/HaloSharp.Test/JSON/HaloWars2/Stats/season-summary.schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "additionalProperties": false, 5 | "properties": { 6 | "SeasonId": { 7 | "type": "string" 8 | }, 9 | "RankedPlaylistStats": { 10 | "type": "array", 11 | "items": { 12 | "$ref": "common/stats.schema.json" 13 | } 14 | } 15 | }, 16 | "required": [ 17 | "SeasonId", 18 | "RankedPlaylistStats" 19 | ] 20 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("HaloSharp.Test")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("HaloSharp.Test")] 12 | [assembly: AssemblyCopyright("Copyright © 2015")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("3a8e13ea-fd0c-43d7-b4ce-aef9ea0928d9")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("2.0.1.0")] 35 | [assembly: AssemblyFileVersion("2.0.1.0")] -------------------------------------------------------------------------------- /Source/HaloSharp.Test/Setup.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model; 2 | using NUnit.Framework; 3 | using System; 4 | 5 | namespace HaloSharp.Test 6 | { 7 | [SetUpFixture] 8 | public class Global 9 | { 10 | public static IHaloSession Session; 11 | 12 | [SetUp] 13 | public void RunBeforeAnyTests() 14 | { 15 | var developerAccessProduct = new Product 16 | { 17 | SubscriptionKey = "00000000000000000000000000000000", 18 | RateLimit = new RateLimit 19 | { 20 | RequestCount = 10, 21 | TimeSpan = new TimeSpan(0, 0, 0, 10), 22 | Timeout = new TimeSpan(0, 0, 0, 10) 23 | } 24 | }; 25 | 26 | var cacheSettings = new CacheSettings 27 | { 28 | CacheDuration = null 29 | }; 30 | 31 | var client = new HaloClient(developerAccessProduct, cacheSettings); 32 | Session = client.StartSession(); 33 | } 34 | 35 | [TearDown] 36 | public void RunAfterAnyTests() 37 | { 38 | Session.Dispose(); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/Utility/SchemaUtility.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json.Linq; 4 | using Newtonsoft.Json.Schema; 5 | using NUnit.Framework; 6 | 7 | namespace HaloSharp.Test.Utility 8 | { 9 | public class SchemaUtility 10 | { 11 | public static void AssertSchemaIsValid(JSchema jSchema, JContainer jContainer) 12 | { 13 | IList messages; 14 | var isValid = jContainer.IsValid(jSchema, out messages); 15 | foreach (var message in messages) 16 | { 17 | Console.WriteLine(message); 18 | } 19 | 20 | Assert.IsTrue(isValid); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Source/HaloSharp.Test/Utility/SerializationUtility.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Runtime.Serialization; 3 | using System.Runtime.Serialization.Formatters.Binary; 4 | using NUnit.Framework; 5 | 6 | namespace HaloSharp.Test.Utility 7 | { 8 | public class SerializationUtility 9 | { 10 | // ReSharper disable once StaticMemberInGenericType 11 | private static readonly IFormatter Formatter = new BinaryFormatter(); 12 | 13 | public static void AssertRoundTripSerializationIsPossible(T source) 14 | { 15 | var clone = CloneBySerialization(source); 16 | 17 | Assert.AreEqual(source, clone); 18 | Assert.IsFalse(ReferenceEquals(source, clone)); 19 | } 20 | 21 | private static T CloneBySerialization(T source) 22 | { 23 | return Deserialize(Serialize(source)); 24 | } 25 | 26 | private static T Deserialize(Stream stream) 27 | { 28 | stream.Position = 0; 29 | return (T) Formatter.Deserialize(stream); 30 | } 31 | 32 | private static Stream Serialize(object source) 33 | { 34 | Stream stream = new MemoryStream(); 35 | Formatter.Serialize(stream, source); 36 | return stream; 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /Source/HaloSharp.Test/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/HaloSharp.Test/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Source/HaloSharp/Cache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Caching; 3 | 4 | namespace HaloSharp 5 | { 6 | internal static class Cache 7 | { 8 | private static readonly ObjectCache ObjectCache = MemoryCache.Default; 9 | private static readonly object LockObject = new object(); 10 | 11 | internal static TimeSpan? CacheDuration { get; set; } 12 | 13 | public static void Add(string key, T toAdd) where T : class 14 | { 15 | if (string.IsNullOrEmpty(key) || !CacheDuration.HasValue) 16 | { 17 | return; 18 | } 19 | 20 | lock (LockObject) 21 | { 22 | if (!ObjectCache.Contains(key)) 23 | { 24 | var absoluteExpiration = DateTime.UtcNow.Add(CacheDuration.Value); 25 | ObjectCache.Add(key, toAdd, absoluteExpiration); 26 | } 27 | } 28 | } 29 | 30 | public static T Get(string key) where T : class 31 | { 32 | lock (LockObject) 33 | { 34 | return ObjectCache.Get(key) as T; 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Converter/GuidConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Converter 5 | { 6 | internal class GuidConverter : JsonConverter 7 | { 8 | public override bool CanConvert(Type objectType) 9 | { 10 | return objectType == typeof (Guid) || objectType == typeof (Guid?); 11 | } 12 | 13 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 14 | { 15 | if (reader.TokenType == JsonToken.Null) 16 | { 17 | return null; 18 | } 19 | 20 | var value = serializer.Deserialize(reader); 21 | 22 | Guid guid; 23 | if (Guid.TryParse(value, out guid)) 24 | { 25 | return guid; 26 | } 27 | 28 | return null; 29 | } 30 | 31 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 32 | { 33 | var guid = (Guid) value; 34 | serializer.Serialize(writer, guid); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Converter/MillisecondConverter.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace HaloSharp.Converter 5 | { 6 | internal class MillisecondConverter : JsonConverter 7 | { 8 | public override bool CanConvert(Type objectType) 9 | { 10 | return objectType == typeof (TimeSpan); 11 | } 12 | 13 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 14 | { 15 | var value = serializer.Deserialize(reader); 16 | 17 | try 18 | { 19 | return TimeSpan.FromMilliseconds(value); 20 | } 21 | catch 22 | { 23 | return default(TimeSpan); 24 | } 25 | } 26 | 27 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 28 | { 29 | var timeSpan = (TimeSpan)value; 30 | serializer.Serialize(writer, (int)timeSpan.TotalMilliseconds); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Converter/TimeSpanConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Xml; 3 | using Newtonsoft.Json; 4 | 5 | namespace HaloSharp.Converter 6 | { 7 | internal class TimeSpanConverter : JsonConverter 8 | { 9 | public override bool CanConvert(Type objectType) 10 | { 11 | return objectType == typeof (TimeSpan); 12 | } 13 | 14 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 15 | { 16 | var value = serializer.Deserialize(reader); 17 | 18 | try 19 | { 20 | return XmlConvert.ToTimeSpan(value); 21 | } 22 | catch 23 | { 24 | return default(TimeSpan); 25 | } 26 | } 27 | 28 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 29 | { 30 | var timeSpan = (TimeSpan)value; 31 | serializer.Serialize(writer, XmlConvert.ToString(timeSpan)); 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Exception/HaloApiException.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Error; 2 | 3 | namespace HaloSharp.Exception 4 | { 5 | public class HaloApiException : System.Exception 6 | { 7 | public HaloApiError HaloApiError { get; private set; } 8 | 9 | public HaloApiException(HaloApiError haloApiError) 10 | { 11 | HaloApiError = haloApiError; 12 | } 13 | 14 | public HaloApiException(int statusCode, string reasonPhrase) 15 | { 16 | HaloApiError = new HaloApiError 17 | { 18 | StatusCode = statusCode, 19 | Message = reasonPhrase 20 | }; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Exception/ValidationException.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HaloSharp.Model.Error; 3 | 4 | namespace HaloSharp.Exception 5 | { 6 | public class ValidationException : System.Exception 7 | { 8 | public ValidationError ValidationError { get; private set; } 9 | 10 | public ValidationException(ValidationError validationError) 11 | { 12 | ValidationError = validationError; 13 | } 14 | 15 | public ValidationException(List messages) 16 | { 17 | ValidationError = new ValidationError 18 | { 19 | Messages = messages 20 | }; 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Extension/HaloSharpSessionExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace HaloSharp.Extension 4 | { 5 | public static class HaloSessionExtensions 6 | { 7 | public static Task Query(this IHaloSession session, IQuery results) 8 | { 9 | return results.ApplyTo(session); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Extension/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Extension 5 | { 6 | internal static class StringExtensions 7 | { 8 | public static Task ParsedAsJson(this string json) 9 | { 10 | var settings = new JsonSerializerSettings(); 11 | return Task.Factory.StartNew(() => JsonConvert.DeserializeObject(json, settings)); 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /Source/HaloSharp/HaloClient.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model; 2 | 3 | namespace HaloSharp 4 | { 5 | public class HaloClient 6 | { 7 | private readonly Product _product; 8 | private readonly CacheSettings _cacheSettings; 9 | 10 | public HaloClient(Product product, CacheSettings cacheSettings = null) 11 | { 12 | _product = product; 13 | _cacheSettings = cacheSettings; 14 | } 15 | 16 | public IHaloSession StartSession() 17 | { 18 | var session = new HaloSession(_product); 19 | 20 | Cache.CacheDuration = _cacheSettings?.CacheDuration; 21 | 22 | return session; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /Source/HaloSharp/HaloSharp.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $id$ 5 | $version$ 6 | $title$ 7 | $author$ 8 | $author$ 9 | https://github.com/gitFurious/HaloSharp/blob/master/LICENSE 10 | https://github.com/gitFurious/HaloSharp 11 | http://i.imgur.com/bNFI8wr.png 12 | false 13 | $description$ 14 | Halo 5, Halo 5 : Forge, Halo Wars 2! 15 | Copyright 2016 16 | HaloSharp, Halo, API, Game Data 17 | 18 | -------------------------------------------------------------------------------- /Source/HaloSharp/HaloUriBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace HaloSharp 7 | { 8 | public static class HaloUriBuilder 9 | { 10 | public static string Build(string path, IDictionary parameters = null) 11 | { 12 | var uriBuilder = new UriBuilder("https", "www.haloapi.com") 13 | { 14 | Path = path 15 | }; 16 | 17 | if (parameters != null && parameters.Any()) 18 | { 19 | var query = HttpUtility.ParseQueryString(uriBuilder.Query); 20 | 21 | foreach (var parameter in parameters) 22 | { 23 | query[parameter.Key] = parameter.Value; 24 | } 25 | 26 | uriBuilder.Query = query.ToString(); 27 | } 28 | 29 | return uriBuilder.Uri.ToString(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Source/HaloSharp/IHaloSession.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Profile; 2 | using System; 3 | using System.Threading.Tasks; 4 | 5 | namespace HaloSharp 6 | { 7 | public interface IHaloSession : IDisposable 8 | { 9 | Task Get(string path); 10 | Task GetImage(string path); 11 | } 12 | } -------------------------------------------------------------------------------- /Source/HaloSharp/IQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace HaloSharp 4 | { 5 | public interface IQuery 6 | { 7 | Task ApplyTo(IHaloSession session); 8 | } 9 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/CacheSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HaloSharp.Model 4 | { 5 | public class CacheSettings 6 | { 7 | public TimeSpan? CacheDuration { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Source/HaloSharp/Model/Common/ISO8601.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HaloSharp.Model.Common 4 | { 5 | [Serializable] 6 | public class ISO8601 : IEquatable 7 | { 8 | // ReSharper disable once InconsistentNaming 9 | public DateTime? ISO8601Date { get; set; } 10 | 11 | public bool Equals(ISO8601 other) 12 | { 13 | if (ReferenceEquals(null, other)) 14 | { 15 | return false; 16 | } 17 | 18 | if (ReferenceEquals(this, other)) 19 | { 20 | return true; 21 | } 22 | 23 | return ISO8601Date.Equals(other.ISO8601Date); 24 | } 25 | 26 | public override bool Equals(object obj) 27 | { 28 | if (ReferenceEquals(null, obj)) 29 | { 30 | return false; 31 | } 32 | 33 | if (ReferenceEquals(this, obj)) 34 | { 35 | return true; 36 | } 37 | 38 | if (obj.GetType() != typeof(ISO8601)) 39 | { 40 | return false; 41 | } 42 | 43 | return Equals((ISO8601)obj); 44 | } 45 | 46 | public override int GetHashCode() 47 | { 48 | return ISO8601Date.GetHashCode(); 49 | } 50 | 51 | public static bool operator ==(ISO8601 left, ISO8601 right) 52 | { 53 | return Equals(left, right); 54 | } 55 | 56 | public static bool operator !=(ISO8601 left, ISO8601 right) 57 | { 58 | return !Equals(left, right); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Source/HaloSharp/Model/Error/HaloApiError.cs: -------------------------------------------------------------------------------- 1 | namespace HaloSharp.Model.Error 2 | { 3 | public class HaloApiError 4 | { 5 | public string Message { get; set; } 6 | public int? StatusCode { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/Error/ValidationError.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace HaloSharp.Model.Error 4 | { 5 | public class ValidationError 6 | { 7 | public List Messages { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/Halo5/Stats/CarnageReport/Events/PlayerSpawn.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using HaloSharp.Model.Common; 3 | using Newtonsoft.Json; 4 | 5 | namespace HaloSharp.Model.Halo5.Stats.CarnageReport.Events 6 | { 7 | [Serializable] 8 | public class PlayerSpawn : MatchEvent, IEquatable 9 | { 10 | [JsonProperty(PropertyName = "Player")] 11 | public Identity Player { get; set; } 12 | 13 | public bool Equals(PlayerSpawn other) 14 | { 15 | if (ReferenceEquals(null, other)) 16 | { 17 | return false; 18 | } 19 | 20 | if (ReferenceEquals(this, other)) 21 | { 22 | return true; 23 | } 24 | 25 | return Equals(Player, other.Player); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(PlayerSpawn)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((PlayerSpawn)obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | return (Player != null ? Player.GetHashCode() : 0); 51 | } 52 | 53 | public static bool operator ==(PlayerSpawn left, PlayerSpawn right) 54 | { 55 | return Equals(left, right); 56 | } 57 | 58 | public static bool operator !=(PlayerSpawn left, PlayerSpawn right) 59 | { 60 | return !Equals(left, right); 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/Halo5/Stats/CarnageReport/Events/RoundEnd.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.Halo5.Stats.CarnageReport.Events 5 | { 6 | [Serializable] 7 | public class RoundEnd : MatchEvent, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "RoundIndex")] 10 | public int RoundIndex { get; set; } 11 | 12 | public bool Equals(RoundEnd other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return RoundIndex == other.RoundIndex; 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return true; 37 | } 38 | 39 | if (obj.GetType() != typeof(RoundEnd)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((RoundEnd)obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return RoundIndex; 50 | } 51 | 52 | public static bool operator ==(RoundEnd left, RoundEnd right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(RoundEnd left, RoundEnd right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/Halo5/Stats/CarnageReport/Events/RoundStart.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.Halo5.Stats.CarnageReport.Events 5 | { 6 | [Serializable] 7 | public class RoundStart : MatchEvent, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "RoundIndex")] 10 | public int RoundIndex { get; set; } 11 | 12 | public bool Equals(RoundStart other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return RoundIndex == other.RoundIndex; 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return true; 37 | } 38 | 39 | if (obj.GetType() != typeof(RoundStart)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((RoundStart)obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return RoundIndex; 50 | } 51 | 52 | public static bool operator ==(RoundStart left, RoundStart right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(RoundStart left, RoundStart right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/CampaignLevel/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.CampaignLevel 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2CampaignLevel")] 10 | public CampaignLevel CampaignLevel { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(CampaignLevel, other.CampaignLevel); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) return false; 31 | if (ReferenceEquals(this, obj)) return true; 32 | if (obj.GetType() != typeof(View)) return false; 33 | return Equals((View) obj); 34 | } 35 | 36 | public override int GetHashCode() 37 | { 38 | unchecked 39 | { 40 | return (base.GetHashCode()*397) ^ (CampaignLevel != null ? CampaignLevel.GetHashCode() : 0); 41 | } 42 | } 43 | 44 | public static bool operator ==(View left, View right) 45 | { 46 | return Equals(left, right); 47 | } 48 | 49 | public static bool operator !=(View left, View right) 50 | { 51 | return !Equals(left, right); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/CampaignLog/CampaignLog.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HaloSharp.Model.HaloWars2.Metadata.CampaignLog 4 | { 5 | [Serializable] 6 | public class CampaignLog : IEquatable 7 | { 8 | public int Id { get; set; } 9 | 10 | public bool Equals(CampaignLog other) 11 | { 12 | if (ReferenceEquals(null, other)) 13 | { 14 | return false; 15 | } 16 | 17 | if (ReferenceEquals(this, other)) 18 | { 19 | return true; 20 | } 21 | 22 | return Id == other.Id; 23 | } 24 | 25 | public override bool Equals(object obj) 26 | { 27 | if (ReferenceEquals(null, obj)) 28 | { 29 | return false; 30 | } 31 | 32 | if (ReferenceEquals(this, obj)) 33 | { 34 | return true; 35 | } 36 | 37 | if (obj.GetType() != typeof(CampaignLog)) 38 | { 39 | return false; 40 | } 41 | 42 | return Equals((CampaignLog) obj); 43 | } 44 | 45 | public override int GetHashCode() 46 | { 47 | return Id; 48 | } 49 | 50 | public static bool operator ==(CampaignLog left, CampaignLog right) 51 | { 52 | return Equals(left, right); 53 | } 54 | 55 | public static bool operator !=(CampaignLog left, CampaignLog right) 56 | { 57 | return !Equals(left, right); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/CampaignLog/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.CampaignLog 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2Log")] 10 | public CampaignLog CampaignLog { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(CampaignLog, other.CampaignLog); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (CampaignLog?.GetHashCode() ?? 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/CampaignObjective/CampaignObjective.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HaloSharp.Model.HaloWars2.Metadata.CampaignObjective 4 | { 5 | [Serializable] 6 | public class CampaignObjective : IEquatable 7 | { 8 | public int Id { get; set; } 9 | 10 | public bool Equals(CampaignObjective other) 11 | { 12 | if (ReferenceEquals(null, other)) 13 | { 14 | return false; 15 | } 16 | 17 | if (ReferenceEquals(this, other)) 18 | { 19 | return true; 20 | } 21 | 22 | return Id == other.Id; 23 | } 24 | 25 | public override bool Equals(object obj) 26 | { 27 | if (ReferenceEquals(null, obj)) 28 | { 29 | return false; 30 | } 31 | 32 | if (ReferenceEquals(this, obj)) 33 | { 34 | return true; 35 | } 36 | 37 | if (obj.GetType() != typeof(CampaignObjective)) 38 | { 39 | return false; 40 | } 41 | 42 | return Equals((CampaignObjective) obj); 43 | } 44 | 45 | public override int GetHashCode() 46 | { 47 | return Id; 48 | } 49 | 50 | public static bool operator ==(CampaignObjective left, CampaignObjective right) 51 | { 52 | return Equals(left, right); 53 | } 54 | 55 | public static bool operator !=(CampaignObjective left, CampaignObjective right) 56 | { 57 | return !Equals(left, right); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Card/DisplayInfo/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Card.DisplayInfo 5 | { 6 | [Serializable] 7 | public class View : Metadata.DisplayInfo.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2CardDisplayInfo")] 10 | public DisplayInfo DisplayInfo { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(DisplayInfo, other.DisplayInfo); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (DisplayInfo?.GetHashCode() ?? 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/CompetitiveSkillRankDesignation/DisplayInfo/DisplayInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.CompetitiveSkillRankDesignation.DisplayInfo 5 | { 6 | [Serializable] 7 | public class DisplayInfo : IEquatable 8 | { 9 | [JsonProperty(PropertyName = "Name")] 10 | public string Name { get; set; } 11 | 12 | public bool Equals(DisplayInfo other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return string.Equals(Name, other.Name); 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return true; 37 | } 38 | 39 | if (obj.GetType() != typeof(DisplayInfo)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((DisplayInfo) obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return Name?.GetHashCode() ?? 0; 50 | } 51 | 52 | public static bool operator ==(DisplayInfo left, DisplayInfo right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(DisplayInfo left, DisplayInfo right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Difficulty/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Difficulty 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2Difficulty")] 10 | public Difficulty Difficulty { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(Difficulty, other.Difficulty); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (Difficulty != null ? Difficulty.GetHashCode() : 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/DisplayInfo/BatchLocalization.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.DisplayInfo 5 | { 6 | [Serializable] 7 | public class BatchLocalization : IEquatable 8 | { 9 | [JsonProperty(PropertyName = "IsLocked")] 10 | public bool IsLocked { get; set; } 11 | 12 | public bool Equals(BatchLocalization other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return IsLocked == other.IsLocked; 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return true; 37 | } 38 | 39 | if (obj.GetType() != typeof(BatchLocalization)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((BatchLocalization) obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return IsLocked.GetHashCode(); 50 | } 51 | 52 | public static bool operator ==(BatchLocalization left, BatchLocalization right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(BatchLocalization left, BatchLocalization right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/GameObjectCategory/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.GameObjectCategory 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "Autoroute")] 10 | public string Autoroute { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && string.Equals(Autoroute, other.Autoroute); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (Autoroute?.GetHashCode() ?? 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Image/Image.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Image 5 | { 6 | [Serializable] 7 | public class Image : IEquatable 8 | { 9 | [JsonProperty(PropertyName = "Width")] 10 | public int Width { get; set; } 11 | 12 | [JsonProperty(PropertyName = "Height")] 13 | public int Height { get; set; } 14 | 15 | public bool Equals(Image other) 16 | { 17 | if (ReferenceEquals(null, other)) 18 | { 19 | return false; 20 | } 21 | 22 | if (ReferenceEquals(this, other)) 23 | { 24 | return true; 25 | } 26 | 27 | return Width == other.Width 28 | && Height == other.Height; 29 | } 30 | 31 | public override bool Equals(object obj) 32 | { 33 | if (ReferenceEquals(null, obj)) 34 | { 35 | return false; 36 | } 37 | 38 | if (ReferenceEquals(this, obj)) 39 | { 40 | return true; 41 | } 42 | 43 | if (obj.GetType() != typeof(Image)) 44 | { 45 | return false; 46 | } 47 | 48 | return Equals((Image) obj); 49 | } 50 | 51 | public override int GetHashCode() 52 | { 53 | unchecked 54 | { 55 | return (Width*397) ^ Height; 56 | } 57 | } 58 | 59 | public static bool operator ==(Image left, Image right) 60 | { 61 | return Equals(left, right); 62 | } 63 | 64 | public static bool operator !=(Image left, Image right) 65 | { 66 | return !Equals(left, right); 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Leader/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Leader 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2Leader")] 10 | public Leader Leader { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(Leader, other.Leader); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (Leader?.GetHashCode() ?? 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Map/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Map 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2Map")] 10 | public Map Map { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(Map, other.Map); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (Map != null ? Map.GetHashCode() : 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Pack/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Pack 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2Pack")] 10 | public Pack Pack { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(Pack, other.Pack); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (Pack?.GetHashCode() ?? 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Playlist/CardsFixedAtLevel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Playlist 5 | { 6 | [Serializable] 7 | public class CardsFixedAtLevel : IEquatable 8 | { 9 | [JsonIgnore] 10 | public int Unused { get; set; } 11 | 12 | public bool Equals(CardsFixedAtLevel other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return Unused == other.Unused; 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return true; 37 | } 38 | 39 | if (obj.GetType() != typeof(CardsFixedAtLevel)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((CardsFixedAtLevel) obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return Unused; 50 | } 51 | 52 | public static bool operator ==(CardsFixedAtLevel left, CardsFixedAtLevel right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(CardsFixedAtLevel left, CardsFixedAtLevel right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/PlaylistEntry/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.PlaylistEntry 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2PlaylistEntry")] 10 | public PlaylistEntry PlaylistEntry { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(PlaylistEntry, other.PlaylistEntry); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (PlaylistEntry?.GetHashCode() ?? 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Season/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Season 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2Season")] 10 | public Season Season { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) return false; 15 | 16 | if (ReferenceEquals(this, other)) return true; 17 | 18 | return base.Equals(other) 19 | && Equals(Season, other.Season); 20 | } 21 | 22 | public override bool Equals(object obj) 23 | { 24 | if (ReferenceEquals(null, obj)) 25 | { 26 | return false; 27 | } 28 | 29 | if (ReferenceEquals(this, obj)) 30 | { 31 | return true; 32 | } 33 | 34 | if (obj.GetType() != typeof(View)) 35 | { 36 | return false; 37 | } 38 | 39 | return Equals((View) obj); 40 | } 41 | 42 | public override int GetHashCode() 43 | { 44 | unchecked 45 | { 46 | return (base.GetHashCode()*397) ^ (Season != null ? Season.GetHashCode() : 0); 47 | } 48 | } 49 | 50 | public static bool operator ==(View left, View right) 51 | { 52 | return Equals(left, right); 53 | } 54 | 55 | public static bool operator !=(View left, View right) 56 | { 57 | return !Equals(left, right); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Skull/Skull.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HaloSharp.Model.HaloWars2.Metadata.Skull 4 | { 5 | [Serializable] 6 | public class Skull : IEquatable 7 | { 8 | public int Id { get; set; } 9 | 10 | public bool Equals(Skull other) 11 | { 12 | if (ReferenceEquals(null, other)) 13 | { 14 | return false; 15 | } 16 | 17 | if (ReferenceEquals(this, other)) 18 | { 19 | return true; 20 | } 21 | 22 | return Id == other.Id; 23 | } 24 | 25 | public override bool Equals(object obj) 26 | { 27 | if (ReferenceEquals(null, obj)) 28 | { 29 | return false; 30 | } 31 | 32 | if (ReferenceEquals(this, obj)) 33 | { 34 | return true; 35 | } 36 | 37 | if (obj.GetType() != typeof(Skull)) 38 | { 39 | return false; 40 | } 41 | 42 | return Equals((Skull) obj); 43 | } 44 | 45 | public override int GetHashCode() 46 | { 47 | return Id; 48 | } 49 | 50 | public static bool operator ==(Skull left, Skull right) 51 | { 52 | return Equals(left, right); 53 | } 54 | 55 | public static bool operator !=(Skull left, Skull right) 56 | { 57 | return !Equals(left, right); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/Skull/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.Skull 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2Skull")] 10 | public Skull Skull { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(Skull, other.Skull); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (Skull?.GetHashCode() ?? 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/SpartanRank/DisplayInfo/DisplayInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.SpartanRank.DisplayInfo 5 | { 6 | [Serializable] 7 | public class DisplayInfo : IEquatable 8 | { 9 | [JsonProperty(PropertyName = "Name")] 10 | public string Name { get; set; } 11 | 12 | public bool Equals(DisplayInfo other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return string.Equals(Name, other.Name); 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return true; 37 | } 38 | 39 | if (obj.GetType() != typeof(DisplayInfo)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((DisplayInfo) obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return Name?.GetHashCode() ?? 0; 50 | } 51 | 52 | public static bool operator ==(DisplayInfo left, DisplayInfo right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(DisplayInfo left, DisplayInfo right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/SpartanRank/View.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.SpartanRank 5 | { 6 | [Serializable] 7 | public class View : Metadata.View, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "HW2SpartanRank")] 10 | public SpartanRank SpartanRank { get; set; } 11 | 12 | public bool Equals(View other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return base.Equals(other) 25 | && Equals(SpartanRank, other.SpartanRank); 26 | } 27 | 28 | public override bool Equals(object obj) 29 | { 30 | if (ReferenceEquals(null, obj)) 31 | { 32 | return false; 33 | } 34 | 35 | if (ReferenceEquals(this, obj)) 36 | { 37 | return true; 38 | } 39 | 40 | if (obj.GetType() != typeof(View)) 41 | { 42 | return false; 43 | } 44 | 45 | return Equals((View) obj); 46 | } 47 | 48 | public override int GetHashCode() 49 | { 50 | unchecked 51 | { 52 | return (base.GetHashCode()*397) ^ (SpartanRank?.GetHashCode() ?? 0); 53 | } 54 | } 55 | 56 | public static bool operator ==(View left, View right) 57 | { 58 | return Equals(left, right); 59 | } 60 | 61 | public static bool operator !=(View left, View right) 62 | { 63 | return !Equals(left, right); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Metadata/StartingArmy/DisplayInfo/DisplayInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Metadata.StartingArmy.DisplayInfo 5 | { 6 | [Serializable] 7 | public class DisplayInfo : IEquatable 8 | { 9 | [JsonProperty(PropertyName = "Name")] 10 | public string Name { get; set; } 11 | 12 | public bool Equals(DisplayInfo other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return string.Equals(Name, other.Name); 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return true; 37 | } 38 | 39 | if (obj.GetType() != typeof(DisplayInfo)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((DisplayInfo) obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return Name?.GetHashCode() ?? 0; 50 | } 51 | 52 | public static bool operator ==(DisplayInfo left, DisplayInfo right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(DisplayInfo left, DisplayInfo right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Stats/CarnageReport/Events/FirefightWaveStarted.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Stats.CarnageReport.Events 5 | { 6 | [Serializable] 7 | public class FirefightWaveStarted : MatchEvent, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "WaveNumber")] 10 | public int WaveNumber { get; set; } 11 | 12 | public bool Equals(FirefightWaveStarted other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return false; 22 | } 23 | 24 | return WaveNumber == other.WaveNumber; 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return false; 37 | } 38 | 39 | if (obj.GetType() != typeof(FirefightWaveStarted)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((FirefightWaveStarted)obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return WaveNumber; 50 | } 51 | 52 | public static bool operator ==(FirefightWaveStarted left, FirefightWaveStarted right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(FirefightWaveStarted left, FirefightWaveStarted right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Stats/CarnageReport/Events/PlayerEliminated.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Stats.CarnageReport.Events 5 | { 6 | [Serializable] 7 | public class PlayerEliminated : MatchEvent, IEquatable 8 | { 9 | [JsonProperty(PropertyName = "PlayerIndex")] 10 | public int PlayerIndex { get; set; } 11 | 12 | public bool Equals(PlayerEliminated other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return false; 22 | } 23 | 24 | return PlayerIndex == other.PlayerIndex; 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return false; 37 | } 38 | 39 | if (obj.GetType() != typeof(PlayerEliminated)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((PlayerEliminated)obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return PlayerIndex; 50 | } 51 | 52 | public static bool operator ==(PlayerEliminated left, PlayerEliminated right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(PlayerEliminated left, PlayerEliminated right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/HaloWars2/Stats/Common/Team.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace HaloSharp.Model.HaloWars2.Stats.Common 5 | { 6 | [Serializable] 7 | public class Team : IEquatable 8 | { 9 | [JsonProperty(PropertyName = "TeamSize")] 10 | public int TeamSize { get; set; } 11 | 12 | public bool Equals(Team other) 13 | { 14 | if (ReferenceEquals(null, other)) 15 | { 16 | return false; 17 | } 18 | 19 | if (ReferenceEquals(this, other)) 20 | { 21 | return true; 22 | } 23 | 24 | return TeamSize == other.TeamSize; 25 | } 26 | 27 | public override bool Equals(object obj) 28 | { 29 | if (ReferenceEquals(null, obj)) 30 | { 31 | return false; 32 | } 33 | 34 | if (ReferenceEquals(this, obj)) 35 | { 36 | return true; 37 | } 38 | 39 | if (obj.GetType() != typeof(Team)) 40 | { 41 | return false; 42 | } 43 | 44 | return Equals((Team) obj); 45 | } 46 | 47 | public override int GetHashCode() 48 | { 49 | return TeamSize; 50 | } 51 | 52 | public static bool operator ==(Team left, Team right) 53 | { 54 | return Equals(left, right); 55 | } 56 | 57 | public static bool operator !=(Team left, Team right) 58 | { 59 | return !Equals(left, right); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Model/Product.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HaloSharp.Model 4 | { 5 | public class Product 6 | { 7 | public string SubscriptionKey { get; set; } 8 | public RateLimit RateLimit { get; set; } 9 | } 10 | 11 | public class RateLimit 12 | { 13 | public int RequestCount { get; set; } 14 | public TimeSpan TimeSpan { get; set; } 15 | public TimeSpan Timeout { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Source/HaloSharp/Model/ValidationResult.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | 4 | namespace HaloSharp.Model 5 | { 6 | public class ValidationResult 7 | { 8 | public ValidationResult() 9 | { 10 | Messages = new List(); 11 | } 12 | 13 | public List Messages { get; } 14 | public bool Success => !Messages.Any(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Source/HaloSharp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("HaloSharp")] 9 | [assembly: AssemblyDescription("A C# wrapper for the Halo® Game Data API.")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Damon Pollard")] 12 | [assembly: AssemblyProduct("HaloSharp")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5a205d36-6af7-4416-9763-81250ef02924")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2.0.1.0")] 36 | [assembly: AssemblyFileVersion("2.0.1.0")] 37 | 38 | //HaloSharp.Test 39 | [assembly: InternalsVisibleTo("HaloSharp.Test")] -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetCampaignMissions.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetCampaignMissions : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/campaign-missions"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetCommendations.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetCommendations : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/commendations"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetCompetitiveSkillRankDesignations.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetCompetitiveSkillRankDesignations : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/csr-designations"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetEnemies.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetEnemies : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/enemies"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetFlexibleStats.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetFlexibleStats : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/flexible-stats"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetGameBaseVariants.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetGameBaseVariants : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/game-base-variants"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetGameVariant.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Metadata; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Metadata 8 | { 9 | public class GetGameVariant : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"metadata/h5/metadata/game-variants/{_gameVariantId}"); 12 | 13 | private readonly Guid _gameVariantId; 14 | 15 | public GetGameVariant(Guid gameVariantId) 16 | { 17 | _gameVariantId = gameVariantId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_gameVariantId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetGameVariant query requires a Game Variant Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetImpulses.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetImpulses : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/impulses"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetMapVariant.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Metadata; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Metadata 8 | { 9 | public class GetMapVariant : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"metadata/h5/metadata/map-variants/{_mapVariantId}"); 12 | 13 | private readonly Guid _mapVariantId; 14 | 15 | public GetMapVariant(Guid mapVariantId) 16 | { 17 | _mapVariantId = mapVariantId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_mapVariantId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetMapVariant query requires a Map Variant Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetMaps.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetMaps : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/maps"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetMedals.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetMedals : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/medals"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetPlaylists.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetPlaylists : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/playlists"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetRequisition.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Metadata; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Metadata 8 | { 9 | public class GetRequisition : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"metadata/h5/metadata/requisitions/{_requisitionId}"); 12 | 13 | private readonly Guid _requisitionId; 14 | 15 | public GetRequisition(Guid requisitionId) 16 | { 17 | _requisitionId = requisitionId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_requisitionId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetRequisition query requires a Requisition Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetRequisitionPack.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Metadata.Common; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Metadata 8 | { 9 | public class GetRequisitionPack : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"metadata/h5/metadata/requisition-packs/{_requisitionPackId}"); 12 | 13 | private readonly Guid _requisitionPackId; 14 | 15 | public GetRequisitionPack(Guid requisitionPackId) 16 | { 17 | _requisitionPackId = requisitionPackId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_requisitionPackId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetRequisitionPack query requires a Requisition Pack Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetSeasons.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetSeasons : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/seasons"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetSkulls.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetSkulls : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/skulls"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetSpartanRanks.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetSpartanRanks : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/spartan-ranks"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetTeamColors.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetTeamColors : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/team-colors"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetVehicles.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetVehicles : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/vehicles"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Metadata/GetWeapons.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.Halo5.Metadata; 2 | using System.Collections.Generic; 3 | 4 | namespace HaloSharp.Query.Halo5.Metadata 5 | { 6 | public class GetWeapons : Query> 7 | { 8 | public override string Uri => HaloUriBuilder.Build("metadata/h5/metadata/weapons"); 9 | } 10 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Stats/CarnageReport/GetArenaMatchDetails.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Stats.CarnageReport; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Stats.CarnageReport 8 | { 9 | public class GetArenaMatchDetails : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"stats/h5/arena/matches/{_matchId}"); 12 | 13 | private readonly Guid _matchId; 14 | 15 | public GetArenaMatchDetails(Guid matchId) 16 | { 17 | _matchId = matchId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_matchId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetArenaMatchDetails query requires a Match Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Stats/CarnageReport/GetCampaignMatchDetails.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Stats.CarnageReport; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Stats.CarnageReport 8 | { 9 | public class GetCampaignMatchDetails : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"stats/h5/campaign/matches/{_matchId}"); 12 | 13 | private readonly Guid _matchId; 14 | 15 | public GetCampaignMatchDetails(Guid matchId) 16 | { 17 | _matchId = matchId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_matchId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetCampaignMatchDetails query requires a Match Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Stats/CarnageReport/GetCustomMatchDetails.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Stats.CarnageReport; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Stats.CarnageReport 8 | { 9 | public class GetCustomMatchDetails : Query 10 | { 11 | protected virtual string Path => $"stats/h5/custom/matches/{_matchId}"; 12 | 13 | public override string Uri => HaloUriBuilder.Build(Path); 14 | 15 | private readonly Guid _matchId; 16 | 17 | public GetCustomMatchDetails(Guid matchId) 18 | { 19 | _matchId = matchId; 20 | } 21 | 22 | protected override void Validate() 23 | { 24 | var validationResult = new ValidationResult(); 25 | 26 | if (!_matchId.IsValid()) 27 | { 28 | validationResult.Messages.Add("GetCustomMatchDetails query requires a Match Id to be set."); 29 | } 30 | 31 | if (!validationResult.Success) 32 | { 33 | throw new ValidationException(validationResult.Messages); 34 | } 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Stats/CarnageReport/GetMatchEvents.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Stats.CarnageReport; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Stats.CarnageReport 8 | { 9 | public class GetMatchEvents : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"stats/h5/matches/{_matchId}/events"); 12 | 13 | private readonly Guid _matchId; 14 | 15 | public GetMatchEvents(Guid matchId) 16 | { 17 | _matchId = matchId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_matchId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetMatchEvents query requires a Match Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Stats/CarnageReport/GetWarzoneMatchDetails.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Stats.CarnageReport; 4 | using System; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.Halo5.Stats.CarnageReport 8 | { 9 | public class GetWarzoneMatchDetails : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"stats/h5/warzone/matches/{_matchId}"); 12 | 13 | private readonly Guid _matchId; 14 | 15 | public GetWarzoneMatchDetails(Guid matchId) 16 | { 17 | _matchId = matchId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_matchId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetWarzoneMatchDetails query requires a Match Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Stats/Lifetime/GetCampaignServiceRecord.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Stats.Lifetime; 4 | using HaloSharp.Validation.Common; 5 | using System.Collections.Generic; 6 | 7 | namespace HaloSharp.Query.Halo5.Stats.Lifetime 8 | { 9 | public class GetCampaignServiceRecord : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build("stats/h5/servicerecords/campaign", _parameters); 12 | 13 | private readonly IDictionary _parameters = new Dictionary(); 14 | private const string PlayersParameter = "players"; 15 | 16 | public GetCampaignServiceRecord(string gamertag) 17 | { 18 | _parameters[PlayersParameter] = gamertag; 19 | } 20 | 21 | public GetCampaignServiceRecord(IEnumerable gamertags) 22 | { 23 | _parameters[PlayersParameter] = string.Join(",", gamertags); 24 | } 25 | 26 | protected override void Validate() 27 | { 28 | var validationResult = new ValidationResult(); 29 | 30 | var players = _parameters[PlayersParameter].Split(','); 31 | 32 | foreach (var player in players) 33 | { 34 | if (!player.IsValidGamertag()) 35 | { 36 | validationResult.Messages.Add("GetCampaignServiceRecord query requires valid Gamertags to be set."); 37 | } 38 | } 39 | 40 | if (!validationResult.Success) 41 | { 42 | throw new ValidationException(validationResult.Messages); 43 | } 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Stats/Lifetime/GetCustomServiceRecord.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Stats.Lifetime; 4 | using HaloSharp.Validation.Common; 5 | using System.Collections.Generic; 6 | 7 | namespace HaloSharp.Query.Halo5.Stats.Lifetime 8 | { 9 | public class GetCustomServiceRecord : Query 10 | { 11 | protected virtual string Path => "stats/h5/servicerecords/custom"; 12 | 13 | public override string Uri => HaloUriBuilder.Build(Path, _parameters); 14 | 15 | private readonly IDictionary _parameters = new Dictionary(); 16 | private const string PlayersParameter = "players"; 17 | 18 | public GetCustomServiceRecord(string gamertag) 19 | { 20 | _parameters[PlayersParameter] = gamertag; 21 | } 22 | 23 | public GetCustomServiceRecord(IEnumerable gamertags) 24 | { 25 | _parameters[PlayersParameter] = string.Join(",", gamertags); 26 | } 27 | 28 | protected override void Validate() 29 | { 30 | var validationResult = new ValidationResult(); 31 | 32 | var players = _parameters[PlayersParameter].Split(','); 33 | 34 | foreach (var player in players) 35 | { 36 | if (!player.IsValidGamertag()) 37 | { 38 | validationResult.Messages.Add("GetCustomServiceRecord query requires valid Gamertags to be set."); 39 | } 40 | } 41 | 42 | if (!validationResult.Success) 43 | { 44 | throw new ValidationException(validationResult.Messages); 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/Stats/Lifetime/GetWarzoneServiceRecord.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.Stats.Lifetime; 4 | using HaloSharp.Validation.Common; 5 | using System.Collections.Generic; 6 | 7 | namespace HaloSharp.Query.Halo5.Stats.Lifetime 8 | { 9 | public class GetWarzoneServiceRecord : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build("stats/h5/servicerecords/warzone", _parameters); 12 | 13 | private readonly IDictionary _parameters = new Dictionary(); 14 | private const string PlayersParameter = "players"; 15 | 16 | public GetWarzoneServiceRecord(string gamertag) 17 | { 18 | _parameters[PlayersParameter] = gamertag; 19 | } 20 | 21 | public GetWarzoneServiceRecord(IEnumerable gamertags) 22 | { 23 | _parameters[PlayersParameter] = string.Join(",", gamertags); 24 | } 25 | 26 | protected override void Validate() 27 | { 28 | var validationResult = new ValidationResult(); 29 | 30 | var players = _parameters[PlayersParameter].Split(','); 31 | 32 | foreach (var player in players) 33 | { 34 | if (!player.IsValidGamertag()) 35 | { 36 | validationResult.Messages.Add("GetWarzoneServiceRecord query requires valid Gamertags to be set."); 37 | } 38 | } 39 | 40 | if (!validationResult.Success) 41 | { 42 | throw new ValidationException(validationResult.Messages); 43 | } 44 | } 45 | 46 | } 47 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/UserGeneratedContent/GetGameVariant.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.UserGeneratedContent; 4 | using HaloSharp.Validation.Common; 5 | using System; 6 | 7 | namespace HaloSharp.Query.Halo5.UserGeneratedContent 8 | { 9 | public class GetGameVariant : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"ugc/h5/players/{_player}/gamevariants/{_gameVariantId}"); 12 | 13 | private readonly string _player; 14 | private readonly Guid _gameVariantId; 15 | 16 | public GetGameVariant(string gamertag, Guid gameVariantId) 17 | { 18 | _player = gamertag; 19 | _gameVariantId = gameVariantId; 20 | } 21 | 22 | protected override void Validate() 23 | { 24 | var validationResult = new ValidationResult(); 25 | 26 | if (!_player.IsValidGamertag()) 27 | { 28 | validationResult.Messages.Add("GetGameVariant query requires a valid Gamertag to be set."); 29 | } 30 | 31 | if (!_gameVariantId.IsValid()) 32 | { 33 | validationResult.Messages.Add("GetGameVariant query requires a Game Variant Id to be set."); 34 | } 35 | 36 | if (!validationResult.Success) 37 | { 38 | throw new ValidationException(validationResult.Messages); 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5/UserGeneratedContent/GetMapVariant.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.Halo5.UserGeneratedContent; 4 | using HaloSharp.Validation.Common; 5 | using System; 6 | 7 | namespace HaloSharp.Query.Halo5.UserGeneratedContent 8 | { 9 | public class GetMapVariant : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"ugc/h5/players/{_player}/mapvariants/{_mapVariantId}"); 12 | 13 | private readonly string _player; 14 | private readonly Guid _mapVariantId; 15 | 16 | public GetMapVariant(string gamertag, Guid mapVariantId) 17 | { 18 | _player = gamertag; 19 | _mapVariantId = mapVariantId; 20 | } 21 | 22 | protected override void Validate() 23 | { 24 | var validationResult = new ValidationResult(); 25 | 26 | if (!_player.IsValidGamertag()) 27 | { 28 | validationResult.Messages.Add("GetMapVariant query requires a valid Gamertag to be set."); 29 | } 30 | 31 | if (!_mapVariantId.IsValid()) 32 | { 33 | validationResult.Messages.Add("GetMapVariant query requires a Map Variant Id to be set."); 34 | } 35 | 36 | if (!validationResult.Success) 37 | { 38 | throw new ValidationException(validationResult.Messages); 39 | } 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5Forge/Stats/CarnageReport/GetCustomMatchDetails.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HaloSharp.Query.Halo5Forge.Stats.CarnageReport 4 | { 5 | public class GetCustomMatchDetails : Halo5.Stats.CarnageReport.GetCustomMatchDetails 6 | { 7 | protected override string Path => $"stats/h5pc/custom/matches/{_matchId}"; 8 | 9 | private readonly Guid _matchId; 10 | 11 | public GetCustomMatchDetails(Guid matchId) : base(matchId) 12 | { 13 | _matchId = matchId; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5Forge/Stats/GetMatchHistory.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace HaloSharp.Query.Halo5Forge.Stats 3 | { 4 | public class GetMatchHistory : Halo5.Stats.GetMatchHistory 5 | { 6 | protected override string Path => $"stats/h5pc/players/{_player}/matches"; 7 | 8 | private readonly string _player; 9 | 10 | public GetMatchHistory(string gamertag) : base(gamertag) 11 | { 12 | _player = gamertag; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Halo5Forge/Stats/Lifetime/GetCustomServiceRecord.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace HaloSharp.Query.Halo5Forge.Stats.Lifetime 4 | { 5 | public class GetCustomServiceRecord : Halo5.Stats.Lifetime.GetCustomServiceRecord 6 | { 7 | protected override string Path => "stats/h5pc/servicerecords/custom"; 8 | 9 | public GetCustomServiceRecord(string gamertag) : base(gamertag) { } 10 | 11 | public GetCustomServiceRecord(IEnumerable gamertags) : base(gamertags) { } 12 | } 13 | } -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetCampaignLevels.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetCampaignLevels : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/campaign-levels", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetCampaignLevels Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetCampaignLevels optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetCampaignLogs.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetCampaignLogs : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/campaign-logs", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetCampaignLogs Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetCampaignLogs optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetCardKeywords.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetCardKeywords : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/card-keywords", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetCardKeywords Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetCardKeywords optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetCards.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetCards : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/cards", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetCards Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetCards optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetCompetitiveSkillRankDesignations.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetCompetitiveSkillRankDesignations : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/csr-designations", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetCompetitiveSkillRankDesignations Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetCompetitiveSkillRankDesignations optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetDifficulties.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetDifficulties : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/difficulties", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetDifficulties Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetDifficulties optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetGameObjectCategories.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetGameObjectCategories : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/game-object-categories", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetGameObjectCategories Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetGameObjectCategories optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetGameObjects.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetGameObjects : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/game-objects", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetGameObjects Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetGameObjects optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetLeaderPowers.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetLeaderPowers : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/leader-powers", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetLeaderPowers Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetLeaderPowers optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetLeaders.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetLeaders : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/leaders", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetLeaders Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetLeaders optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetMaps.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetMaps : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/maps", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetMaps Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetMaps optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetPacks.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetPacks : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/packs", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetPacks Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetPacks optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetPlaylists.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetPlaylists : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/playlists", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetPlaylists Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetPlaylists optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetSeasons.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetSeasons : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/seasons", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetSeasons Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetSeasons optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetSpartanRanks.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetSpartanRanks : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/spartan-ranks", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetSpartanRanks Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetSpartanRanks optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Metadata/GetTechs.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Metadata; 4 | using System.Collections.Generic; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Metadata 8 | { 9 | public class GetTechs : Query>> 10 | { 11 | public override string Uri => HaloUriBuilder.Build("metadata/hw2/techs", Parameters); 12 | 13 | internal readonly IDictionary Parameters = new Dictionary(); 14 | private const string StartAtParameter = "startAt"; 15 | 16 | public GetTechs Skip(int count) 17 | { 18 | Parameters[StartAtParameter] = count.ToString(); 19 | 20 | return this; 21 | } 22 | 23 | protected override void Validate() 24 | { 25 | var validationResult = new ValidationResult(); 26 | 27 | if (Parameters.ContainsKey(StartAtParameter)) 28 | { 29 | int startAt; 30 | var parsed = int.TryParse(Parameters[StartAtParameter], out startAt); 31 | 32 | if (!parsed || !startAt.IsValidStartAt()) 33 | { 34 | validationResult.Messages.Add($"GetTechs optional parameter '{StartAtParameter}' is invalid: {startAt}."); 35 | } 36 | } 37 | 38 | if (!validationResult.Success) 39 | { 40 | throw new ValidationException(validationResult.Messages); 41 | } 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Stats/CarnageReport/GetMatchDetails.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.HaloWars2.Stats.CarnageReport; 2 | using System; 3 | using HaloSharp.Exception; 4 | using HaloSharp.Model; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Stats.CarnageReport 8 | { 9 | public class GetMatchDetails : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"stats/hw2/matches/{_matchId}"); 12 | 13 | private readonly Guid _matchId; 14 | 15 | public GetMatchDetails(Guid matchId) 16 | { 17 | _matchId = matchId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_matchId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetMatchDetails query requires a valid Match Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Stats/CarnageReport/GetMatchEvents.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Model.HaloWars2.Stats.CarnageReport; 2 | using System; 3 | using HaloSharp.Exception; 4 | using HaloSharp.Model; 5 | using HaloSharp.Validation.Common; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Stats.CarnageReport 8 | { 9 | public class GetMatchEvents : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"stats/hw2/matches/{_matchId}/events"); 12 | 13 | private readonly Guid _matchId; 14 | 15 | public GetMatchEvents(Guid matchId) 16 | { 17 | _matchId = matchId; 18 | } 19 | 20 | protected override void Validate() 21 | { 22 | var validationResult = new ValidationResult(); 23 | 24 | if (!_matchId.IsValid()) 25 | { 26 | validationResult.Messages.Add("GetMatchEvents query requires a valid Match Id to be set."); 27 | } 28 | 29 | if (!validationResult.Success) 30 | { 31 | throw new ValidationException(validationResult.Messages); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Stats/Lifetime/GetCampaignSummary.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Stats.Lifetime; 4 | using HaloSharp.Validation.Common; 5 | 6 | namespace HaloSharp.Query.HaloWars2.Stats.Lifetime 7 | { 8 | public class GetCampaignSummary : Query 9 | { 10 | public override string Uri => HaloUriBuilder.Build($"stats/hw2/players/{_player}/campaign-progress"); 11 | 12 | private readonly string _player; 13 | 14 | public GetCampaignSummary(string player) 15 | { 16 | _player = player; 17 | } 18 | 19 | protected override void Validate() 20 | { 21 | var validationResult = new ValidationResult(); 22 | 23 | if (!_player.IsValidGamertag()) 24 | { 25 | validationResult.Messages.Add("GetCampaignSummary query requires a valid Gamertag to be set."); 26 | } 27 | 28 | if (!validationResult.Success) 29 | { 30 | throw new ValidationException(validationResult.Messages); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Stats/Lifetime/GetExperienceSummary.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Stats.Lifetime; 4 | using HaloSharp.Validation.Common; 5 | using System.Collections.Generic; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Stats.Lifetime 8 | { 9 | public class GetExperienceSummary : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"stats/hw2/xp", _parameters); 12 | 13 | private readonly IDictionary _parameters = new Dictionary(); 14 | private const string PlayersParameter = "players"; 15 | 16 | public GetExperienceSummary(string player) 17 | { 18 | _parameters[PlayersParameter] = player; 19 | } 20 | 21 | public GetExperienceSummary(IEnumerable players) 22 | { 23 | _parameters[PlayersParameter] = string.Join(",", players); 24 | } 25 | 26 | protected override void Validate() 27 | { 28 | var validationResult = new ValidationResult(); 29 | 30 | var players = _parameters[PlayersParameter].Split(','); 31 | 32 | foreach (var player in players) 33 | { 34 | if (!player.IsValidGamertag()) 35 | { 36 | validationResult.Messages.Add("GetExperienceSummary query requires a valid Gamertag to be set."); 37 | } 38 | } 39 | 40 | if (!validationResult.Success) 41 | { 42 | throw new ValidationException(validationResult.Messages); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Stats/Lifetime/GetSeasonSummary.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Stats.Lifetime; 4 | using HaloSharp.Validation.Common; 5 | using System; 6 | 7 | namespace HaloSharp.Query.HaloWars2.Stats.Lifetime 8 | { 9 | public class GetSeasonSummary : Query 10 | { 11 | public override string Uri => HaloUriBuilder.Build($"stats/hw2/players/{_player}/stats/seasons/{_seasonId}"); 12 | 13 | private readonly string _player; 14 | private readonly Guid _seasonId; 15 | 16 | public GetSeasonSummary(string player, Guid seasonId) 17 | { 18 | _player = player; 19 | _seasonId = seasonId; 20 | } 21 | 22 | protected override void Validate() 23 | { 24 | var validationResult = new ValidationResult(); 25 | 26 | if (!_player.IsValidGamertag()) 27 | { 28 | validationResult.Messages.Add("GetSeasonSummary query requires a valid Gamertag to be set."); 29 | } 30 | 31 | if (!_seasonId.IsValid()) 32 | { 33 | validationResult.Messages.Add("GetSeasonSummary query requires a valid Season Id to be set."); 34 | } 35 | 36 | if (!validationResult.Success) 37 | { 38 | throw new ValidationException(validationResult.Messages); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/HaloWars2/Stats/Lifetime/GetSummary.cs: -------------------------------------------------------------------------------- 1 | using HaloSharp.Exception; 2 | using HaloSharp.Model; 3 | using HaloSharp.Model.HaloWars2.Stats.Lifetime; 4 | using HaloSharp.Validation.Common; 5 | 6 | namespace HaloSharp.Query.HaloWars2.Stats.Lifetime 7 | { 8 | public class GetSummary : Query 9 | { 10 | public override string Uri => HaloUriBuilder.Build($"stats/hw2/players/{_player}/stats"); 11 | 12 | private readonly string _player; 13 | 14 | public GetSummary(string player) 15 | { 16 | _player = player; 17 | } 18 | 19 | protected override void Validate() 20 | { 21 | var validationResult = new ValidationResult(); 22 | 23 | if (!_player.IsValidGamertag()) 24 | { 25 | validationResult.Messages.Add("GetSummary query requires a valid Gamertag to be set."); 26 | } 27 | 28 | if (!validationResult.Success) 29 | { 30 | throw new ValidationException(validationResult.Messages); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/ImageQuery.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using HaloSharp.Model.Halo5.Profile; 3 | 4 | namespace HaloSharp.Query 5 | { 6 | public abstract class ImageQuery : IQuery 7 | { 8 | private bool _useCache = true; 9 | 10 | public ImageQuery SkipCache() 11 | { 12 | _useCache = false; 13 | 14 | return this; 15 | } 16 | 17 | public abstract string Uri { get; } 18 | 19 | public async Task ApplyTo(IHaloSession session) 20 | { 21 | Validate(); 22 | 23 | var response = _useCache 24 | ? Cache.Get(Uri) 25 | : null; 26 | 27 | if (response == null) 28 | { 29 | response = await session.GetImage(Uri); 30 | 31 | Cache.Add(Uri, response); 32 | } 33 | 34 | return response; 35 | } 36 | 37 | protected virtual void Validate() { } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Source/HaloSharp/Query/Query.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace HaloSharp.Query 4 | { 5 | public abstract class Query : IQuery where T : class 6 | { 7 | private bool _useCache = true; 8 | 9 | public Query SkipCache() 10 | { 11 | _useCache = false; 12 | 13 | return this; 14 | } 15 | 16 | public abstract string Uri { get; } 17 | 18 | public virtual async Task ApplyTo(IHaloSession session) 19 | { 20 | Validate(); 21 | 22 | var response = _useCache 23 | ? Cache.Get(Uri) 24 | : null; 25 | 26 | if (response == null) 27 | { 28 | response = await session.Get(Uri); 29 | 30 | Cache.Add(Uri, response); 31 | } 32 | 33 | return response; 34 | } 35 | 36 | protected virtual void Validate() { } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Source/HaloSharp/Validation/Common/GamertagValidator.cs: -------------------------------------------------------------------------------- 1 | using System.Text.RegularExpressions; 2 | 3 | namespace HaloSharp.Validation.Common 4 | { 5 | public static class GamertagValidator 6 | { 7 | public static bool IsValidGamertag(this string gamertag) 8 | { 9 | var regex = new Regex(@"^[a-zA-Z0-9 ]{1,16}$"); 10 | 11 | return !string.IsNullOrWhiteSpace(gamertag) && regex.IsMatch(gamertag); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/HaloSharp/Validation/Common/GuidValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace HaloSharp.Validation.Common 4 | { 5 | public static class GuidValidator 6 | { 7 | public static bool IsValid(this Guid guid) 8 | { 9 | return guid != default(Guid); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Source/HaloSharp/Validation/Common/ImageSizeValidator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace HaloSharp.Validation.Common 4 | { 5 | public static class ImageSizeValidator 6 | { 7 | public static bool IsValidSize(this int size) 8 | { 9 | var validSizes = new List { 95, 128, 190, 256, 512 }; 10 | 11 | return validSizes.Contains(size); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/HaloSharp/Validation/Common/StartAtValidator.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace HaloSharp.Validation.Common 3 | { 4 | public static class StartAtValidator 5 | { 6 | public static bool IsValidStartAt(this int startAt) 7 | { 8 | return startAt % 100 == 0; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/HaloSharp/Validation/Common/TakeValidator.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace HaloSharp.Validation.Common 3 | { 4 | public static class TakeValidator 5 | { 6 | public static bool IsValidTake(this int take) 7 | { 8 | return take > 0; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Source/HaloSharp/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | --------------------------------------------------------------------------------