diff --git a/.gitignore b/.gitignore index 7a3b830..1ac4ba9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # Folders _obj _test +_tmp # Architecture specific extensions/prefixes *.[568vq] diff --git a/README.md b/README.md index dad40c8..0940fa9 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ go-halo5-api is a wrapper around the Halo5 API as documented at https://developer.haloapi.com. # Usage -Set your API key as an environment variable +Set your API key as an environment variable. Request and API key at https://developer.haloapi.com/products ```go export HALO_API_KEY="123456789abcdefghi" ``` @@ -23,7 +23,7 @@ import ( ) func main() { - fmt.Println(vehicles("https://www.haloapi.com", "h5")) + fmt.Println(string(Vehicles("https://www.haloapi.com", "h5"))) } ``` Results: diff --git a/halo/go-halo5-api.go b/halo/go-halo5-api.go index a75d4aa..2468f7f 100644 --- a/halo/go-halo5-api.go +++ b/halo/go-halo5-api.go @@ -8,7 +8,6 @@ import ( "net/url" "os" "regexp" - "strings" ) func checkErr(err error) { @@ -17,243 +16,6 @@ func checkErr(err error) { } } -func EventsForMatch(baseurl, title, matchid string) []byte { - verifyValidID(matchid, "Match ID") - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/matches/%s/events", baseurl, title, matchid)) - checkErr(err) - q := url.Query() - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func MatchesForPlayer(baseurl, title, player, modes string, start, count int) []byte { - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/players/%s/matches", baseurl, title, player)) - checkErr(err) - q := url.Query() - - if modes != "" { - q.Set("modes", modes) - } - if start != 0 { - q.Set("start", string(start)) - } - if count != 0 { - q.Set("count", string(count)) - } - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func PlayerLeaderboard(baseurl, title, seasonid, playlistid string, count int) []byte { - verifyValidID(playlistid, "Playlist ID") - verifyValidID(seasonid, "Season ID") - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/player-leaderboards/csr/%s/%s", baseurl, title, seasonid, playlistid)) - checkErr(err) - q := url.Query() - - if count != 0 { - q.Set("count", string(count)) - } - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func CarnageReportArena(baseurl, title, matchid string) []byte { - verifyValidID(matchid, "Match ID") - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/arena/matches/%s", baseurl, title, matchid)) - checkErr(err) - q := url.Query() - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func CarnageReportCampaign(baseurl, title, matchid string) []byte { - verifyValidID(matchid, "Match ID") - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/campaign/matches/%s", baseurl, title, matchid)) - checkErr(err) - q := url.Query() - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func CarnageReportCustom(baseurl, title, matchid string) []byte { - verifyValidID(matchid, "Match ID") - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/custom/matches/%s", baseurl, title, matchid)) - checkErr(err) - q := url.Query() - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func CarnageReportWarzone(baseurl, title, matchid string) []byte { - verifyValidID(matchid, "Match ID") - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/warzone/matches/%s", baseurl, title, matchid)) - checkErr(err) - q := url.Query() - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func ServiceRecordArena(baseurl, title, players, seasonid string) []byte { - verifyValidID(seasonid, "Season ID") - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/servicerecords/arena", baseurl, title)) - checkErr(err) - q := url.Query() - q.Set("players", players) - if seasonid != "" { - q.Set("seasonId", seasonid) - } - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func ServiceRecordCampaign(baseurl, title, players string) []byte { - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/servicerecords/campaign", baseurl, title)) - checkErr(err) - q := url.Query() - q.Set("players", players) - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func ServiceRecordCustom(baseurl, title, players string) []byte { - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/servicerecords/custom", baseurl, title)) - checkErr(err) - q := url.Query() - q.Set("players", players) - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func ServiceRecordWarzone(baseurl, title, players string) []byte { - url, err := url.Parse(fmt.Sprintf("%s/stats/%s/servicerecords/warzone", baseurl, title)) - checkErr(err) - q := url.Query() - q.Set("players", players) - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -// Begin profile section -func EmblemImage(baseurl, title, player string, size int) []byte { - url, err := url.Parse(fmt.Sprintf("%s/profile/%s/profiles/%s", baseurl, title, player)) - checkErr(err) - q := url.Query() - if (size == 95) || (size == 128) || (size == 190) || (size == 256) || (size == 512) { - q.Set("size", string(size)) - } - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -func SpartanImage(baseurl, title, player string, size int, crop string) []byte { - url, err := url.Parse(fmt.Sprintf("%s/profile/%s/profiles/%s/spartan", baseurl, title, player)) - checkErr(err) - q := url.Query() - if (size == 95) || (size == 128) || (size == 190) || (size == 256) || (size == 512) { - q.Set("size", string(size)) - } - if (strings.ToLower(crop) == "full") || (strings.ToLower(crop) == "portrait") { - q.Set("crop", crop) - } - url.RawQuery = q.Encode() - response := sendRequest(url.String()) - return response -} - -// Begin metadata section -func CampaignMissions(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "campaign-missions", "") -} - -func Commendations(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "commendations", "") -} - -func CsrDesignations(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "csr-designations", "") -} - -func Enemies(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "enemies", "") -} - -func FlexibleStats(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "flexible-stats", "") -} - -func GameBaseVariants(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "game-base-variants", "") -} - -func GameVariants(baseurl, title, id string) []byte { - return metadataRequest(baseurl, title, "game-variants", id) -} - -func Impulses(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "impulses", "") -} - -func MapVariants(baseurl, title, id string) []byte { - return metadataRequest(baseurl, title, "map-variants", id) -} - -func Maps(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "maps", "") -} - -func Medals(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "medals", "") -} - -func Playlists(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "playlists", "") -} - -func RequisitionPacks(baseurl, title, id string) []byte { - return metadataRequest(baseurl, title, "requisition-packs", id) -} - -func Requisitions(baseurl, title, id string) []byte { - return metadataRequest(baseurl, title, "requisitions", id) -} - -func Seasons(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "seasons", "") -} - -func Skulls(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "skulls", "") -} - -func SpartanRanks(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "spartan-ranks", "") -} - -func TeamColors(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "team-colors", "") -} - -func Vehicles(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "vehicles", "") -} - -func Weapons(baseurl, title string) []byte { - return metadataRequest(baseurl, title, "weapons", "") -} - func metadataRequest(baseurl, title, datatype, id string) []byte { url, err := url.Parse(fmt.Sprintf("%s/metadata/%s/metadata/%s/%s", baseurl, title, datatype, id)) checkErr(err) diff --git a/halo/metadata.go b/halo/metadata.go new file mode 100644 index 0000000..eeee237 --- /dev/null +++ b/halo/metadata.go @@ -0,0 +1,183 @@ +package halo + +import "encoding/json" + +// This one works! +type CampaignMissionsStruct []struct { + MissionNumber json.Number `json:"missionNumber"` + Name string `json:"name"` + Description string `json:"description"` + ImageURL string `json:"imageUrl"` + Type string `json:"type"` + ID string `json:"id"` + ContentID string `json:"contentId"` +} + +// This one works! +type CommendationsStruct []struct { + Type string `json:"type"` + Name string `json:"name"` + Description string `json:"description"` + IconImageURL string `json:"iconImageUrl"` + Levels []struct { + Reward struct { + Xp int `json:"xp"` + RequisitionPacks []struct { + Name string `json:"name"` + Description string `json:"description"` + LargeImageURL string `json:"largeImageUrl"` + IsStack bool `json:"isStack"` + IsFeatured bool `json:"isFeatured"` + IsNew bool `json:"isNew"` + CreditPrice int `json:"creditPrice"` + IsPurchasableWithCredits bool `json:"isPurchasableWithCredits"` + IsPurchasableFromMarketplace bool `json:"isPurchasableFromMarketplace"` + XboxMarketplaceProductID interface{} `json:"xboxMarketplaceProductId"` + XboxMarketplaceProductURL interface{} `json:"xboxMarketplaceProductUrl"` + MerchandisingOrder int `json:"merchandisingOrder"` + Flair interface{} `json:"flair"` + StackedRequisitionPacks []interface{} `json:"stackedRequisitionPacks"` + ID string `json:"id"` + ContentID string `json:"contentId"` + } `json:"requisitionPacks"` + ID string `json:"id"` + ContentID string `json:"contentId"` + } `json:"reward"` + Threshold int `json:"threshold"` + ID string `json:"id"` + ContentID string `json:"contentId"` + } `json:"levels"` + RequiredLevels []interface{} `json:"requiredLevels"` + Reward interface{} `json:"reward"` + Category struct { + Name string `json:"name"` + IconImageURL string `json:"iconImageUrl"` + Order int `json:"order"` + ID string `json:"id"` + ContentID string `json:"contentId"` + } `json:"category"` + ID string `json:"id"` + ContentID string `json:"contentId"` +} + +// This one works! +type CsrDesignationsStruct []struct { + Name string `json:"name"` + BannerImageURL string `json:"bannerImageUrl"` + Tiers []struct { + IconImageURL string `json:"iconImageUrl"` + ID string `json:"id"` + ContentID string `json:"contentId"` + } `json:"tiers"` + ID string `json:"id"` + ContentID string `json:"contentId"` +} + +type EnemiesStruct []struct { + Faction string `json:"faction"` + Name string `json:"name"` + Description interface{} `json:"description"` + LargeIconImageURL string `json:"largeIconImageUrl"` + SmallIconImageURL string `json:"smallIconImageUrl"` + ID string `json:"id"` + ContentID string `json:"contentId"` +} + +type VehiclesStruct []struct { + Name string `json:"name"` + Description string `json:"description"` + LargeIconImageURL string `json:"largeIconImageUrl"` + SmallIconImageURL string `json:"smallIconImageUrl"` + IsUsableByPlayer bool `json:"isUsableByPlayer"` + ID string `json:"id"` + ContentID string `json:"contentId"` +} + +func CampaignMissions(baseurl, title string) CampaignMissionsStruct { + var j CampaignMissionsStruct + err := json.Unmarshal(metadataRequest(baseurl, title, "campaign-missions", ""), &j) + checkErr(err) + return j +} + +func Commendations(baseurl, title string) CommendationsStruct { + var j CommendationsStruct + err := json.Unmarshal(metadataRequest(baseurl, title, "commendations", ""), &j) + checkErr(err) + return j +} + +func CsrDesignations(baseurl, title string) CsrDesignationsStruct { + var j CsrDesignationsStruct + err := json.Unmarshal(metadataRequest(baseurl, title, "csr-designations", ""), &j) + checkErr(err) + return j +} + +func Enemies(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "enemies", "") +} + +func FlexibleStats(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "flexible-stats", "") +} + +func GameBaseVariants(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "game-base-variants", "") +} + +func GameVariants(baseurl, title, id string) []byte { + return metadataRequest(baseurl, title, "game-variants", id) +} + +func Impulses(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "impulses", "") +} + +func MapVariants(baseurl, title, id string) []byte { + return metadataRequest(baseurl, title, "map-variants", id) +} + +func Maps(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "maps", "") +} + +func Medals(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "medals", "") +} + +func Playlists(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "playlists", "") +} + +func RequisitionPacks(baseurl, title, id string) []byte { + return metadataRequest(baseurl, title, "requisition-packs", id) +} + +func Requisitions(baseurl, title, id string) []byte { + return metadataRequest(baseurl, title, "requisitions", id) +} + +func Seasons(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "seasons", "") +} + +func Skulls(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "skulls", "") +} + +func SpartanRanks(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "spartan-ranks", "") +} + +func TeamColors(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "team-colors", "") +} + +func Vehicles(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "vehicles", "") +} + +func Weapons(baseurl, title string) []byte { + return metadataRequest(baseurl, title, "weapons", "") +} diff --git a/halo/profile.go b/halo/profile.go new file mode 100644 index 0000000..8647e9c --- /dev/null +++ b/halo/profile.go @@ -0,0 +1,34 @@ +package halo + +import ( + "fmt" + "net/url" + "strings" +) + +func EmblemImage(baseurl, title, player string, size int) []byte { + url, err := url.Parse(fmt.Sprintf("%s/profile/%s/profiles/%s", baseurl, title, player)) + checkErr(err) + q := url.Query() + if (size == 95) || (size == 128) || (size == 190) || (size == 256) || (size == 512) { + q.Set("size", string(size)) + } + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func SpartanImage(baseurl, title, player string, size int, crop string) []byte { + url, err := url.Parse(fmt.Sprintf("%s/profile/%s/profiles/%s/spartan", baseurl, title, player)) + checkErr(err) + q := url.Query() + if (size == 95) || (size == 128) || (size == 190) || (size == 256) || (size == 512) { + q.Set("size", string(size)) + } + if (strings.ToLower(crop) == "full") || (strings.ToLower(crop) == "portrait") { + q.Set("crop", crop) + } + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} diff --git a/halo/stats.go b/halo/stats.go new file mode 100644 index 0000000..fc0d1d1 --- /dev/null +++ b/halo/stats.go @@ -0,0 +1,249 @@ +package halo + +import ( + "fmt" + "net/url" + "time" +) + +// Stats Structs +type EventsForMatchStruct struct { + GameEvents []struct { + EventName string `json:"EventName"` + RoundIndex int `json:"RoundIndex"` + TimeSinceStart string `json:"TimeSinceStart"` + } `json:"GameEvents"` + IsCompleteSetOfEvents bool `json:"IsCompleteSetOfEvents"` + Links struct { + StatsMatchDetails struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString interface{} `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"StatsMatchDetails"` + UgcFilmManifest struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"UgcFilmManifest"` + } `json:"Links"` +} + +type MatchesForPlayerStruct struct { + Start int `json:"Start"` + Count int `json:"Count"` + ResultCount int `json:"ResultCount"` + Results []struct { + Links struct { + StatsMatchDetails struct { + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString interface{} `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + } `json:"StatsMatchDetails"` + UgcFilmManifest struct { + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + } `json:"UgcFilmManifest"` + } `json:"Links"` + ID struct { + MatchID string `json:"MatchId"` + GameMode int `json:"GameMode"` + } `json:"Id"` + HopperID string `json:"HopperId"` + MapID string `json:"MapId"` + MapVariant struct { + ResourceType int `json:"ResourceType"` + ResourceID string `json:"ResourceId"` + OwnerType int `json:"OwnerType"` + Owner string `json:"Owner"` + } `json:"MapVariant"` + GameBaseVariantID string `json:"GameBaseVariantId"` + GameVariant struct { + ResourceType int `json:"ResourceType"` + ResourceID string `json:"ResourceId"` + OwnerType int `json:"OwnerType"` + Owner string `json:"Owner"` + } `json:"GameVariant"` + MatchDuration string `json:"MatchDuration"` + MatchCompletedDate struct { + ISO8601Date time.Time `json:"ISO8601Date"` + } `json:"MatchCompletedDate"` + Teams []struct { + ID int `json:"Id"` + Score int `json:"Score"` + Rank int `json:"Rank"` + } `json:"Teams"` + Players []struct { + Player struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"Player"` + TeamID int `json:"TeamId"` + Rank int `json:"Rank"` + Result int `json:"Result"` + TotalKills int `json:"TotalKills"` + TotalDeaths int `json:"TotalDeaths"` + TotalAssists int `json:"TotalAssists"` + PreMatchRatings interface{} `json:"PreMatchRatings"` + PostMatchRatings interface{} `json:"PostMatchRatings"` + } `json:"Players"` + IsTeamGame bool `json:"IsTeamGame"` + SeasonID interface{} `json:"SeasonId"` + MatchCompletedDateFidelity int `json:"MatchCompletedDateFidelity"` + } `json:"Results"` + Links struct { + Self struct { + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + } `json:"Self"` + } `json:"Links"` +} + +func EventsForMatch(baseurl, title, matchid string) []byte { + verifyValidID(matchid, "Match ID") + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/matches/%s/events", baseurl, title, matchid)) + checkErr(err) + q := url.Query() + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func MatchesForPlayer(baseurl, title, player, modes string, start, count int) []byte { + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/players/%s/matches", baseurl, title, player)) + checkErr(err) + q := url.Query() + + if modes != "" { + q.Set("modes", modes) + } + if start != 0 { + q.Set("start", string(start)) + } + if count != 0 { + q.Set("count", string(count)) + } + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func PlayerLeaderboard(baseurl, title, seasonid, playlistid string, count int) []byte { + verifyValidID(playlistid, "Playlist ID") + verifyValidID(seasonid, "Season ID") + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/player-leaderboards/csr/%s/%s", baseurl, title, seasonid, playlistid)) + checkErr(err) + q := url.Query() + + if count != 0 { + q.Set("count", string(count)) + } + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func CarnageReportArena(baseurl, title, matchid string) []byte { + verifyValidID(matchid, "Match ID") + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/arena/matches/%s", baseurl, title, matchid)) + checkErr(err) + q := url.Query() + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func CarnageReportCampaign(baseurl, title, matchid string) []byte { + verifyValidID(matchid, "Match ID") + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/campaign/matches/%s", baseurl, title, matchid)) + checkErr(err) + q := url.Query() + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func CarnageReportCustom(baseurl, title, matchid string) []byte { + verifyValidID(matchid, "Match ID") + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/custom/matches/%s", baseurl, title, matchid)) + checkErr(err) + q := url.Query() + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func CarnageReportWarzone(baseurl, title, matchid string) []byte { + verifyValidID(matchid, "Match ID") + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/warzone/matches/%s", baseurl, title, matchid)) + checkErr(err) + q := url.Query() + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func ServiceRecordArena(baseurl, title, players, seasonid string) []byte { + verifyValidID(seasonid, "Season ID") + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/servicerecords/arena", baseurl, title)) + checkErr(err) + q := url.Query() + q.Set("players", players) + if seasonid != "" { + q.Set("seasonId", seasonid) + } + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func ServiceRecordCampaign(baseurl, title, players string) []byte { + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/servicerecords/campaign", baseurl, title)) + checkErr(err) + q := url.Query() + q.Set("players", players) + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func ServiceRecordCustom(baseurl, title, players string) []byte { + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/servicerecords/custom", baseurl, title)) + checkErr(err) + q := url.Query() + q.Set("players", players) + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} + +func ServiceRecordWarzone(baseurl, title, players string) []byte { + url, err := url.Parse(fmt.Sprintf("%s/stats/%s/servicerecords/warzone", baseurl, title)) + checkErr(err) + q := url.Query() + q.Set("players", players) + url.RawQuery = q.Encode() + response := sendRequest(url.String()) + return response +} diff --git a/halo/structs.go b/halo/structs.go new file mode 100644 index 0000000..081c854 --- /dev/null +++ b/halo/structs.go @@ -0,0 +1,1609 @@ +type CarnageReportArenaStruct struct { + GameBaseVariantID string `json:"GameBaseVariantId"` + GameVariantID string `json:"GameVariantId"` + GameVariantResourceID struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"GameVariantResourceId"` + IsMatchOver bool `json:"IsMatchOver"` + IsTeamGame bool `json:"IsTeamGame"` + MapID string `json:"MapId"` + MapVariantID string `json:"MapVariantId"` + MapVariantResourceID struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"MapVariantResourceId"` + PlayerStats []struct { + AvgLifeTimeOfPlayer string `json:"AvgLifeTimeOfPlayer"` + CreditsEarned struct { + BoostAmount int `json:"BoostAmount"` + MatchSpeedWinAmount int `json:"MatchSpeedWinAmount"` + ObjectivesCompletedAmount int `json:"ObjectivesCompletedAmount"` + PlayerRankAmount int `json:"PlayerRankAmount"` + Result int `json:"Result"` + SpartanRankModifier int `json:"SpartanRankModifier"` + TimePlayedAmount int `json:"TimePlayedAmount"` + TotalCreditsEarned int `json:"TotalCreditsEarned"` + } `json:"CreditsEarned"` + CurrentCsr struct { + Csr int `json:"Csr"` + DesignationID int `json:"DesignationId"` + PercentToNextTier int `json:"PercentToNextTier"` + Rank interface{} `json:"Rank"` + Tier int `json:"Tier"` + } `json:"CurrentCsr"` + DNF bool `json:"DNF"` + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []interface{} `json:"EnemyKills"` + FlexibleStats struct { + ImpulseStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"ImpulseStatCounts"` + ImpulseTimelapses []struct { + ID string `json:"Id"` + Timelapse string `json:"Timelapse"` + } `json:"ImpulseTimelapses"` + MedalStatCounts []interface{} `json:"MedalStatCounts"` + MedalTimelapses []interface{} `json:"MedalTimelapses"` + } `json:"FlexibleStats"` + Impulses []interface{} `json:"Impulses"` + KilledByOpponentDetails []struct { + GamerTag string `json:"GamerTag"` + TotalKills int `json:"TotalKills"` + } `json:"KilledByOpponentDetails"` + KilledOpponentDetails []struct { + GamerTag string `json:"GamerTag"` + TotalKills int `json:"TotalKills"` + } `json:"KilledOpponentDetails"` + MeasurementMatchesLeft int `json:"MeasurementMatchesLeft"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + MetaCommendationDeltas []interface{} `json:"MetaCommendationDeltas"` + Player struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"Player"` + PlayerScore int `json:"PlayerScore"` + PostMatchRatings interface{} `json:"PostMatchRatings"` + PreMatchRatings interface{} `json:"PreMatchRatings"` + PreviousCsr struct { + Csr int `json:"Csr"` + DesignationID int `json:"DesignationId"` + PercentToNextTier int `json:"PercentToNextTier"` + Rank interface{} `json:"Rank"` + Tier int `json:"Tier"` + } `json:"PreviousCsr"` + ProgressiveCommendationDeltas []struct { + ID string `json:"Id"` + PreviousProgress int `json:"PreviousProgress"` + Progress int `json:"Progress"` + } `json:"ProgressiveCommendationDeltas"` + Rank int `json:"Rank"` + RewardSets []interface{} `json:"RewardSets"` + TeamID int `json:"TeamId"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage int `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage int `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage int `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage int `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt int `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt int `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + XpInfo struct { + BoostAmount int `json:"BoostAmount"` + MatchSpeedWinAmount int `json:"MatchSpeedWinAmount"` + ObjectivesCompletedAmount int `json:"ObjectivesCompletedAmount"` + PerformanceXP int `json:"PerformanceXP"` + PlayerRankXPAward int `json:"PlayerRankXPAward"` + PlayerTimePerformanceXPAward int `json:"PlayerTimePerformanceXPAward"` + PrevSpartanRank int `json:"PrevSpartanRank"` + PrevTotalXP int `json:"PrevTotalXP"` + SpartanRank int `json:"SpartanRank"` + SpartanRankMatchXPScalar int `json:"SpartanRankMatchXPScalar"` + TotalXP int `json:"TotalXP"` + } `json:"XpInfo"` + } `json:"PlayerStats"` + PlaylistID string `json:"PlaylistId"` + SeasonID string `json:"SeasonId"` + TeamStats []struct { + Rank int `json:"Rank"` + RoundStats []struct { + Rank int `json:"Rank"` + RoundNumber int `json:"RoundNumber"` + Score int `json:"Score"` + } `json:"RoundStats"` + Score int `json:"Score"` + TeamID int `json:"TeamId"` + } `json:"TeamStats"` + TotalDuration string `json:"TotalDuration"` +} + +type CarnageReportCampaignStruct struct { + Difficulty int `json:"Difficulty"` + GameBaseVariantID string `json:"GameBaseVariantId"` + GameVariantID string `json:"GameVariantId"` + GameVariantResourceID struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"GameVariantResourceId"` + IsMatchOver bool `json:"IsMatchOver"` + IsTeamGame bool `json:"IsTeamGame"` + MapID string `json:"MapId"` + MapVariantID string `json:"MapVariantId"` + MapVariantResourceID struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"MapVariantResourceId"` + MissionCompleted bool `json:"MissionCompleted"` + PlayerStats []struct { + AvgLifeTimeOfPlayer string `json:"AvgLifeTimeOfPlayer"` + BiggestKillScore int `json:"BiggestKillScore"` + CharacterIndex interface{} `json:"CharacterIndex"` + DNF bool `json:"DNF"` + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"EnemyKills"` + FlexibleStats struct { + ImpulseStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"ImpulseStatCounts"` + ImpulseTimelapses []interface{} `json:"ImpulseTimelapses"` + MedalStatCounts []interface{} `json:"MedalStatCounts"` + MedalTimelapses []interface{} `json:"MedalTimelapses"` + } `json:"FlexibleStats"` + Impulses []interface{} `json:"Impulses"` + MedalAwards []interface{} `json:"MedalAwards"` + Player struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"Player"` + PlayerScore interface{} `json:"PlayerScore"` + PostMatchRatings interface{} `json:"PostMatchRatings"` + PreMatchRatings interface{} `json:"PreMatchRatings"` + Rank int `json:"Rank"` + Score int `json:"Score"` + TeamID int `json:"TeamId"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage int `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage int `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage int `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage int `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt int `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt int `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"PlayerStats"` + PlaylistID string `json:"PlaylistId"` + SeasonID interface{} `json:"SeasonId"` + Skulls []interface{} `json:"Skulls"` + TotalDuration string `json:"TotalDuration"` + TotalMissionPlaythroughTime string `json:"TotalMissionPlaythroughTime"` +} + +type CarnageReportCustomStruct struct { + GameBaseVariantID string `json:"GameBaseVariantId"` + GameVariantID string `json:"GameVariantId"` + GameVariantResourceID struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"GameVariantResourceId"` + IsMatchOver bool `json:"IsMatchOver"` + IsTeamGame bool `json:"IsTeamGame"` + MapID string `json:"MapId"` + MapVariantID string `json:"MapVariantId"` + MapVariantResourceID struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"MapVariantResourceId"` + PlayerStats []struct { + AvgLifeTimeOfPlayer string `json:"AvgLifeTimeOfPlayer"` + DNF bool `json:"DNF"` + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []interface{} `json:"EnemyKills"` + FlexibleStats struct { + ImpulseStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"ImpulseStatCounts"` + ImpulseTimelapses []struct { + ID string `json:"Id"` + Timelapse string `json:"Timelapse"` + } `json:"ImpulseTimelapses"` + MedalStatCounts []interface{} `json:"MedalStatCounts"` + MedalTimelapses []interface{} `json:"MedalTimelapses"` + } `json:"FlexibleStats"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + KilledByOpponentDetails []struct { + GamerTag string `json:"GamerTag"` + TotalKills int `json:"TotalKills"` + } `json:"KilledByOpponentDetails"` + KilledOpponentDetails []struct { + GamerTag string `json:"GamerTag"` + TotalKills int `json:"TotalKills"` + } `json:"KilledOpponentDetails"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + Player struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"Player"` + PlayerScore int `json:"PlayerScore"` + PostMatchRatings interface{} `json:"PostMatchRatings"` + PreMatchRatings interface{} `json:"PreMatchRatings"` + Rank int `json:"Rank"` + TeamID int `json:"TeamId"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage int `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"PlayerStats"` + PlaylistID string `json:"PlaylistId"` + SeasonID interface{} `json:"SeasonId"` + TeamStats []struct { + Rank int `json:"Rank"` + RoundStats []interface{} `json:"RoundStats"` + Score int `json:"Score"` + TeamID int `json:"TeamId"` + } `json:"TeamStats"` + TotalDuration string `json:"TotalDuration"` +} + +type CarnageReportWarzoneStruct struct { + GameBaseVariantID string `json:"GameBaseVariantId"` + GameVariantID string `json:"GameVariantId"` + GameVariantResourceID struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"GameVariantResourceId"` + IsMatchOver bool `json:"IsMatchOver"` + IsTeamGame bool `json:"IsTeamGame"` + MapID string `json:"MapId"` + MapVariantID string `json:"MapVariantId"` + MapVariantResourceID struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"MapVariantResourceId"` + PlayerStats []struct { + AvgLifeTimeOfPlayer string `json:"AvgLifeTimeOfPlayer"` + CreditsEarned struct { + BoostAmount int `json:"BoostAmount"` + MatchSpeedWinAmount int `json:"MatchSpeedWinAmount"` + ObjectivesCompletedAmount int `json:"ObjectivesCompletedAmount"` + PlayerRankAmount int `json:"PlayerRankAmount"` + Result int `json:"Result"` + SpartanRankModifier int `json:"SpartanRankModifier"` + TimePlayedAmount int `json:"TimePlayedAmount"` + TotalCreditsEarned int `json:"TotalCreditsEarned"` + } `json:"CreditsEarned"` + DNF bool `json:"DNF"` + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"EnemyKills"` + FlexibleStats struct { + ImpulseStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"ImpulseStatCounts"` + ImpulseTimelapses []interface{} `json:"ImpulseTimelapses"` + MedalStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"MedalStatCounts"` + MedalTimelapses []interface{} `json:"MedalTimelapses"` + } `json:"FlexibleStats"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + KilledByOpponentDetails []struct { + GamerTag string `json:"GamerTag"` + TotalKills int `json:"TotalKills"` + } `json:"KilledByOpponentDetails"` + KilledOpponentDetails []struct { + GamerTag string `json:"GamerTag"` + TotalKills int `json:"TotalKills"` + } `json:"KilledOpponentDetails"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + MetaCommendationDeltas []interface{} `json:"MetaCommendationDeltas"` + Player struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"Player"` + PlayerScore int `json:"PlayerScore"` + PostMatchRatings interface{} `json:"PostMatchRatings"` + PreMatchRatings interface{} `json:"PreMatchRatings"` + ProgressiveCommendationDeltas []struct { + ID string `json:"Id"` + PreviousProgress int `json:"PreviousProgress"` + Progress int `json:"Progress"` + } `json:"ProgressiveCommendationDeltas"` + Rank int `json:"Rank"` + RewardSets []struct { + CommendationLevelID string `json:"CommendationLevelId"` + CommendationSource string `json:"CommendationSource"` + RewardSet string `json:"RewardSet"` + RewardSourceType int `json:"RewardSourceType"` + SpartanRankSource interface{} `json:"SpartanRankSource"` + } `json:"RewardSets"` + TeamID int `json:"TeamId"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage float64 `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPiesEarned int `json:"TotalPiesEarned"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WarzoneLevel int `json:"WarzoneLevel"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + XpInfo struct { + BoostAmount int `json:"BoostAmount"` + MatchSpeedWinAmount int `json:"MatchSpeedWinAmount"` + ObjectivesCompletedAmount int `json:"ObjectivesCompletedAmount"` + PerformanceXP int `json:"PerformanceXP"` + PlayerRankXPAward int `json:"PlayerRankXPAward"` + PlayerTimePerformanceXPAward int `json:"PlayerTimePerformanceXPAward"` + PrevSpartanRank int `json:"PrevSpartanRank"` + PrevTotalXP int `json:"PrevTotalXP"` + SpartanRank int `json:"SpartanRank"` + SpartanRankMatchXPScalar float64 `json:"SpartanRankMatchXPScalar"` + TotalXP int `json:"TotalXP"` + } `json:"XpInfo"` + } `json:"PlayerStats"` + PlaylistID string `json:"PlaylistId"` + SeasonID string `json:"SeasonId"` + TeamStats []struct { + Rank int `json:"Rank"` + RoundStats []struct { + Rank int `json:"Rank"` + RoundNumber int `json:"RoundNumber"` + Score int `json:"Score"` + } `json:"RoundStats"` + Score int `json:"Score"` + TeamID int `json:"TeamId"` + } `json:"TeamStats"` + TotalDuration string `json:"TotalDuration"` +} + +type EnemiesStruct []interface{} + +type EventsForMatchStruct struct { + GameEvents []struct { + EventName string `json:"EventName"` + RoundIndex int `json:"RoundIndex"` + TimeSinceStart string `json:"TimeSinceStart"` + } `json:"GameEvents"` + IsCompleteSetOfEvents bool `json:"IsCompleteSetOfEvents"` + Links struct { + StatsMatchDetails struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString interface{} `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"StatsMatchDetails"` + UgcFilmManifest struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"UgcFilmManifest"` + } `json:"Links"` +} + +type FlexibleStatsStruct []interface{} + +type GameBaseVariantsStruct []interface{} + +type GameVariantsStruct struct { + ContentID string `json:"contentId"` + Description string `json:"description"` + GameBaseVariantID string `json:"gameBaseVariantId"` + IconURL string `json:"iconUrl"` + ID string `json:"id"` + Name string `json:"name"` +} + +type ImpulsesStruct []interface{} + +type MapsStruct []interface{} + +type MapVariantsStruct struct { + ContentID string `json:"contentId"` + Description string `json:"description"` + ID string `json:"id"` + MapID string `json:"mapId"` + MapImageURL string `json:"mapImageUrl"` + Name string `json:"name"` +} + +type MatchesForPlayerStruct struct { + Count int `json:"Count"` + Links struct { + Self struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"Self"` + } `json:"Links"` + ResultCount int `json:"ResultCount"` + Results []struct { + GameBaseVariantID string `json:"GameBaseVariantId"` + GameVariant struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"GameVariant"` + HopperID string `json:"HopperId"` + ID struct { + GameMode int `json:"GameMode"` + MatchID string `json:"MatchId"` + } `json:"Id"` + IsTeamGame bool `json:"IsTeamGame"` + Links struct { + StatsMatchDetails struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString interface{} `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"StatsMatchDetails"` + UgcFilmManifest struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"UgcFilmManifest"` + } `json:"Links"` + MapID string `json:"MapId"` + MapVariant struct { + Owner string `json:"Owner"` + OwnerType int `json:"OwnerType"` + ResourceID string `json:"ResourceId"` + ResourceType int `json:"ResourceType"` + } `json:"MapVariant"` + MatchCompletedDate struct { + ISO8601Date string `json:"ISO8601Date"` + } `json:"MatchCompletedDate"` + MatchCompletedDateFidelity int `json:"MatchCompletedDateFidelity"` + MatchDuration string `json:"MatchDuration"` + Players []struct { + Player struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"Player"` + PostMatchRatings interface{} `json:"PostMatchRatings"` + PreMatchRatings interface{} `json:"PreMatchRatings"` + Rank int `json:"Rank"` + Result int `json:"Result"` + TeamID int `json:"TeamId"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalKills int `json:"TotalKills"` + } `json:"Players"` + SeasonID string `json:"SeasonId"` + Teams []struct { + ID int `json:"Id"` + Rank int `json:"Rank"` + Score int `json:"Score"` + } `json:"Teams"` + } `json:"Results"` + Start int `json:"Start"` +} + +type MedalsStruct []interface{} + +type PlayerLeaderboardStruct struct { + Count int `json:"Count"` + Links struct { + Self struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"Self"` + } `json:"Links"` + ResultCount int `json:"ResultCount"` + Results []struct { + Player struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"Player"` + Rank int `json:"Rank"` + Score struct { + Csr int `json:"Csr"` + DesignationID int `json:"DesignationId"` + PercentToNextTier int `json:"PercentToNextTier"` + Rank int `json:"Rank"` + Tier int `json:"Tier"` + } `json:"Score"` + } `json:"Results"` + Start int `json:"Start"` +} + +type PlaylistsStruct []interface{} + +type RequisitionPacksStruct struct { + ContentID string `json:"contentId"` + CreditPrice int `json:"creditPrice"` + Description string `json:"description"` + Flair interface{} `json:"flair"` + ID string `json:"id"` + IsFeatured bool `json:"isFeatured"` + IsNew bool `json:"isNew"` + IsPurchasableFromMarketplace bool `json:"isPurchasableFromMarketplace"` + IsPurchasableWithCredits bool `json:"isPurchasableWithCredits"` + IsStack bool `json:"isStack"` + LargeImageURL string `json:"largeImageUrl"` + MerchandisingOrder int `json:"merchandisingOrder"` + Name string `json:"name"` + StackedRequisitionPacks []interface{} `json:"stackedRequisitionPacks"` + XboxMarketplaceProductID interface{} `json:"xboxMarketplaceProductId"` + XboxMarketplaceProductURL interface{} `json:"xboxMarketplaceProductUrl"` +} + +type RequisitionsStruct struct { + CategoryName interface{} `json:"categoryName"` + CertificationRequisitionID interface{} `json:"certificationRequisitionId"` + ContentID string `json:"contentId"` + Description string `json:"description"` + HideIfNotAcquired bool `json:"hideIfNotAcquired"` + ID string `json:"id"` + InternalCategoryName interface{} `json:"internalCategoryName"` + InternalSubcategoryName interface{} `json:"internalSubcategoryName"` + IsCertification bool `json:"isCertification"` + IsMythic bool `json:"isMythic"` + IsWearable bool `json:"isWearable"` + LargeImageURL string `json:"largeImageUrl"` + LevelRequirement int `json:"levelRequirement"` + Name string `json:"name"` + Rarity string `json:"rarity"` + RarityType string `json:"rarityType"` + SellPrice int `json:"sellPrice"` + SubcategoryName interface{} `json:"subcategoryName"` + SubcategoryOrder int `json:"subcategoryOrder"` + SupportedGameModes []string `json:"supportedGameModes"` + UseType string `json:"useType"` +} + +type SeasonsStruct []interface{} + +type ServiceRecordArenaStruct struct { + Links struct { + Self struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"Self"` + } `json:"Links"` + Results []struct { + ID string `json:"Id"` + Result struct { + ArenaStats struct { + ArenaGameBaseVariantStats []struct { + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []interface{} `json:"EnemyKills"` + FlexibleStats struct { + ImpulseStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"ImpulseStatCounts"` + ImpulseTimelapses []struct { + ID string `json:"Id"` + Timelapse string `json:"Timelapse"` + } `json:"ImpulseTimelapses"` + MedalStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"MedalStatCounts"` + MedalTimelapses []interface{} `json:"MedalTimelapses"` + } `json:"FlexibleStats"` + GameBaseVariantID string `json:"GameBaseVariantId"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage float64 `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"ArenaGameBaseVariantStats"` + ArenaPlaylistStats []struct { + Csr interface{} `json:"Csr"` + CsrPercentile interface{} `json:"CsrPercentile"` + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []interface{} `json:"EnemyKills"` + HighestCsr interface{} `json:"HighestCsr"` + Impulses []interface{} `json:"Impulses"` + MeasurementMatchesLeft int `json:"MeasurementMatchesLeft"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + PlaylistID string `json:"PlaylistId"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage int `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage int `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage int `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage int `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt int `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt int `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"ArenaPlaylistStats"` + ArenaPlaylistStatsSeasonID string `json:"ArenaPlaylistStatsSeasonId"` + DestroyedEnemyVehicles []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"DestroyedEnemyVehicles"` + EnemyKills []interface{} `json:"EnemyKills"` + HighestCsrAttained struct { + Csr int `json:"Csr"` + DesignationID int `json:"DesignationId"` + PercentToNextTier int `json:"PercentToNextTier"` + Rank interface{} `json:"Rank"` + Tier int `json:"Tier"` + } `json:"HighestCsrAttained"` + HighestCsrPlaylistID string `json:"HighestCsrPlaylistId"` + HighestCsrSeasonID interface{} `json:"HighestCsrSeasonId"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + TopGameBaseVariants []struct { + GameBaseVariantID string `json:"GameBaseVariantId"` + GameBaseVariantRank int `json:"GameBaseVariantRank"` + NumberOfMatchesCompleted int `json:"NumberOfMatchesCompleted"` + NumberOfMatchesWon int `json:"NumberOfMatchesWon"` + } `json:"TopGameBaseVariants"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage float64 `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage float64 `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage float64 `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"ArenaStats"` + PlayerID struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"PlayerId"` + SpartanRank int `json:"SpartanRank"` + Xp int `json:"Xp"` + } `json:"Result"` + ResultCode int `json:"ResultCode"` + } `json:"Results"` +} + +type ServiceRecordCampaignStruct struct { + Links struct { + Self struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"Self"` + } `json:"Links"` + Results []struct { + ID string `json:"Id"` + Result struct { + CampaignStat struct { + CampaignMissionStats []struct { + CoopStats struct { + Three struct { + AllSkullsOn bool `json:"AllSkullsOn"` + FastestCompletionTime string `json:"FastestCompletionTime"` + HighestScore int `json:"HighestScore"` + Skulls []interface{} `json:"Skulls"` + TotalTimesCompleted int `json:"TotalTimesCompleted"` + } `json:"3"` + } `json:"CoopStats"` + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"EnemyKills"` + FlexibleStats struct { + ImpulseStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"ImpulseStatCounts"` + ImpulseTimelapses []interface{} `json:"ImpulseTimelapses"` + MedalStatCounts []interface{} `json:"MedalStatCounts"` + MedalTimelapses []interface{} `json:"MedalTimelapses"` + } `json:"FlexibleStats"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + MedalAwards []interface{} `json:"MedalAwards"` + MissionID string `json:"MissionId"` + SoloStats struct { + Two struct { + AllSkullsOn bool `json:"AllSkullsOn"` + FastestCompletionTime string `json:"FastestCompletionTime"` + HighestScore int `json:"HighestScore"` + Skulls []interface{} `json:"Skulls"` + TotalTimesCompleted int `json:"TotalTimesCompleted"` + } `json:"2"` + } `json:"SoloStats"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage float64 `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"CampaignMissionStats"` + DestroyedEnemyVehicles []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"DestroyedEnemyVehicles"` + EnemyKills []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"EnemyKills"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + MedalAwards []interface{} `json:"MedalAwards"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage float64 `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage float64 `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage float64 `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"CampaignStat"` + PlayerID struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"PlayerId"` + SpartanRank int `json:"SpartanRank"` + Xp int `json:"Xp"` + } `json:"Result"` + ResultCode int `json:"ResultCode"` + } `json:"Results"` +} + +type ServiceRecordCustomStruct struct { + Links struct { + Self struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"Self"` + } `json:"Links"` + Results []struct { + ID string `json:"Id"` + Result struct { + CustomStats struct { + CustomGameBaseVariantStats []struct { + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []interface{} `json:"EnemyKills"` + FlexibleStats struct { + ImpulseStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"ImpulseStatCounts"` + ImpulseTimelapses []struct { + ID string `json:"Id"` + Timelapse string `json:"Timelapse"` + } `json:"ImpulseTimelapses"` + MedalStatCounts []interface{} `json:"MedalStatCounts"` + MedalTimelapses []interface{} `json:"MedalTimelapses"` + } `json:"FlexibleStats"` + GameBaseVariantID string `json:"GameBaseVariantId"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage int `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt int `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"CustomGameBaseVariantStats"` + DestroyedEnemyVehicles []interface{} `json:"DestroyedEnemyVehicles"` + EnemyKills []interface{} `json:"EnemyKills"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + TopGameBaseVariants []struct { + GameBaseVariantID string `json:"GameBaseVariantId"` + GameBaseVariantRank int `json:"GameBaseVariantRank"` + NumberOfMatchesCompleted int `json:"NumberOfMatchesCompleted"` + NumberOfMatchesWon int `json:"NumberOfMatchesWon"` + } `json:"TopGameBaseVariants"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage int `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"CustomStats"` + PlayerID struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"PlayerId"` + SpartanRank int `json:"SpartanRank"` + Xp int `json:"Xp"` + } `json:"Result"` + ResultCode int `json:"ResultCode"` + } `json:"Results"` +} + +type ServiceRecordWarzoneStruct struct { + Links struct { + Self struct { + AcknowledgementTypeID int `json:"AcknowledgementTypeId"` + AuthenticationLifetimeExtensionSupported bool `json:"AuthenticationLifetimeExtensionSupported"` + AuthorityID string `json:"AuthorityId"` + Path string `json:"Path"` + QueryString string `json:"QueryString"` + RetryPolicyID string `json:"RetryPolicyId"` + TopicName string `json:"TopicName"` + } `json:"Self"` + } `json:"Links"` + Results []struct { + ID string `json:"Id"` + Result struct { + PlayerID struct { + Gamertag string `json:"Gamertag"` + Xuid interface{} `json:"Xuid"` + } `json:"PlayerId"` + SpartanRank int `json:"SpartanRank"` + WarzoneStat struct { + DestroyedEnemyVehicles []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"DestroyedEnemyVehicles"` + EnemyKills []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"EnemyKills"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + ScenarioStats []struct { + DestroyedEnemyVehicles []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"DestroyedEnemyVehicles"` + EnemyKills []struct { + Enemy struct { + Attachments []interface{} `json:"Attachments"` + BaseID int `json:"BaseId"` + } `json:"Enemy"` + TotalKills int `json:"TotalKills"` + } `json:"EnemyKills"` + FlexibleStats struct { + ImpulseStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"ImpulseStatCounts"` + ImpulseTimelapses []interface{} `json:"ImpulseTimelapses"` + MedalStatCounts []struct { + Count int `json:"Count"` + ID string `json:"Id"` + } `json:"MedalStatCounts"` + MedalTimelapses []interface{} `json:"MedalTimelapses"` + } `json:"FlexibleStats"` + GameBaseVariantID string `json:"GameBaseVariantId"` + Impulses []struct { + Count int `json:"Count"` + ID int `json:"Id"` + } `json:"Impulses"` + MapID string `json:"MapId"` + MedalAwards []struct { + Count int `json:"Count"` + MedalID int `json:"MedalId"` + } `json:"MedalAwards"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage float64 `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage int `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPiesEarned int `json:"TotalPiesEarned"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage int `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"ScenarioStats"` + TotalAssassinations int `json:"TotalAssassinations"` + TotalAssists int `json:"TotalAssists"` + TotalDeaths int `json:"TotalDeaths"` + TotalGamesCompleted int `json:"TotalGamesCompleted"` + TotalGamesLost int `json:"TotalGamesLost"` + TotalGamesTied int `json:"TotalGamesTied"` + TotalGamesWon int `json:"TotalGamesWon"` + TotalGrenadeDamage float64 `json:"TotalGrenadeDamage"` + TotalGrenadeKills int `json:"TotalGrenadeKills"` + TotalGroundPoundDamage float64 `json:"TotalGroundPoundDamage"` + TotalGroundPoundKills int `json:"TotalGroundPoundKills"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalMeleeDamage float64 `json:"TotalMeleeDamage"` + TotalMeleeKills int `json:"TotalMeleeKills"` + TotalPiesEarned int `json:"TotalPiesEarned"` + TotalPowerWeaponDamage float64 `json:"TotalPowerWeaponDamage"` + TotalPowerWeaponGrabs int `json:"TotalPowerWeaponGrabs"` + TotalPowerWeaponKills int `json:"TotalPowerWeaponKills"` + TotalPowerWeaponPossessionTime string `json:"TotalPowerWeaponPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + TotalShoulderBashDamage float64 `json:"TotalShoulderBashDamage"` + TotalShoulderBashKills int `json:"TotalShoulderBashKills"` + TotalSpartanKills int `json:"TotalSpartanKills"` + TotalTimePlayed string `json:"TotalTimePlayed"` + TotalWeaponDamage float64 `json:"TotalWeaponDamage"` + WeaponStats []struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponStats"` + WeaponWithMostKills struct { + TotalDamageDealt float64 `json:"TotalDamageDealt"` + TotalHeadshots int `json:"TotalHeadshots"` + TotalKills int `json:"TotalKills"` + TotalPossessionTime string `json:"TotalPossessionTime"` + TotalShotsFired int `json:"TotalShotsFired"` + TotalShotsLanded int `json:"TotalShotsLanded"` + WeaponID struct { + Attachments []interface{} `json:"Attachments"` + StockID int `json:"StockId"` + } `json:"WeaponId"` + } `json:"WeaponWithMostKills"` + } `json:"WarzoneStat"` + Xp int `json:"Xp"` + } `json:"Result"` + ResultCode int `json:"ResultCode"` + } `json:"Results"` +} + +type SkullsStruct []interface{} + +type SpartanRanksStruct []interface{} + +type TeamColorsStruct []interface{} + +type VehiclesStruct []interface{} + +type WeaponsStruct []interface{} + + diff --git a/main.go b/main.go index 05f5663..c982dd4 100644 --- a/main.go +++ b/main.go @@ -6,19 +6,68 @@ var title string = "h5" // Sample values for testing var sampleGamertag string = "motta13" var sampleMode string = "warzone" -var sampleMatchID string = "c35a35f8-f450-4836-a4c2-65100a7acb79" -var sampleSeasonID string = "b46c2095-4ca6-4f4b-a565-4702d7cfe586" //February 2016 Season -var samplePlaylistID string = "2323b76a-db98-4e03-aa37-e171cfbdd1a4" //SWAT gametype 2016 Season +var sampleArenaMatchID string = "f15986a8-1132-48d7-9194-e23388ec6084" +var sampleCampaignMatchID string = "f9d5a884-68a5-4e01-a9cc-92239787559f" +var sampleCustomMatchID string = "5e0985de-309c-4031-8133-fea03500fd1b" +var sampleWarzoneMatchID string = "c35a35f8-f450-4836-a4c2-65100a7acb79" +var sampleSeasonID string = "b46c2095-4ca6-4f4b-a565-4702d7cfe586" //February 2016 Season +var samplePlaylistID string = "2323b76a-db98-4e03-aa37-e171cfbdd1a4" //SWAT gametype 2016 Season +var sampleGameVariantID string = "963ca478-369a-4a37-97e3-432fa13035e1" //Slayer +var sampleMapVariantsID string = "a44373ee-9f63-4733-befd-5cd8fbb1b44a" //Truth +var sampleRequisitionPacksID string = "d10141cb-68a5-4c6b-af38-4e4935f973f7" +var sampleRequisitionID string = "e4f549b2-90af-4dab-b2bc-11a46ea44103" var samplePlayers string = "motta13,smoke721" func main() { // Uncomment any of the below for sample output. + // Metadata + //fmt.Println(halo.CampaignMissions(baseurl, title)) + //fmt.Println(halo.Commendations(baseurl, title)) + //fmt.Println(halo.CsrDesignations(baseurl, title)) + //fmt.Println(string(halo.Enemies(baseurl, title))) + //fmt.Println(string(halo.FlexibleStats(baseurl, title))) + //fmt.Println(string(halo.GameBaseVariants(baseurl, title))) + //fmt.Println(string(halo.GameVariants(baseurl, title))) + //fmt.Println(string(halo.Impulses(baseurl, title))) + //fmt.Println(string(halo.MapVariants(baseurl, title))) + //fmt.Println(string(halo.Maps(baseurl, title))) + //fmt.Println(string(halo.Medals(baseurl, title))) + //fmt.Println(string(halo.Playlists(baseurl, title))) + //fmt.Println(string(halo.RequisitionPacks(baseurl, title))) + //fmt.Println(string(halo.Requisitions(baseurl, title))) + //fmt.Println(string(halo.Seasons(baseurl, title))) + //fmt.Println(string(halo.Sculls(baseurl, title))) + //fmt.Println(string(halo.SpartanRanks(baseurl, title))) + //fmt.Println(string(halo.TeamColors(baseurl, title))) + //fmt.Println(string(halo.Vehicles(baseurl, title))) + //fmt.Println(string(halo.Weapons(baseurl, title))) + + //ioutil.WriteFile("tmp/Enemies.txt", halo.Enemies(baseurl, title), 0755) + //ioutil.WriteFile("tmp/FlexibleStats.txt", halo.FlexibleStats(baseurl, title), 0755) + //ioutil.WriteFile("tmp/GameBaseVariants.txt", halo.GameBaseVariants(baseurl, title), 0755) + //ioutil.WriteFile("tmp/GameVariants.txt", halo.GameVariants(baseurl, title, sampleGameVariantID), 0755) + //ioutil.WriteFile("tmp/Impulses.txt", halo.Impulses(baseurl, title), 0755) + //ioutil.WriteFile("tmp/MapVariants.txt", halo.MapVariants(baseurl, title, sampleMapVariantsID), 0755) + //ioutil.WriteFile("tmp/Maps.txt", halo.Maps(baseurl, title), 0755) + //ioutil.WriteFile("tmp/Medals.txt", halo.Medals(baseurl, title), 0755) + //ioutil.WriteFile("tmp/Playlists.txt", halo.Playlists(baseurl, title), 0755) + //fmt.Println("Sleeping") + //time.Sleep(10 * time.Second) + //ioutil.WriteFile("tmp/RequisitionPacks.txt", halo.RequisitionPacks(baseurl, title, sampleRequisitionPacksID), 0755) + //ioutil.WriteFile("tmp/Requisitions.txt", halo.Requisitions(baseurl, title, sampleRequisitionID), 0755) + //ioutil.WriteFile("tmp/Seasons.txt", halo.Seasons(baseurl, title), 0755) + //ioutil.WriteFile("tmp/Skulls.txt", halo.Skulls(baseurl, title), 0755) + //ioutil.WriteFile("tmp/SpartanRanks.txt", halo.SpartanRanks(baseurl, title), 0755) + //ioutil.WriteFile("tmp/TeamColors.txt", halo.TeamColors(baseurl, title), 0755) + //ioutil.WriteFile("tmp/Vehicles.txt", halo.Vehicles(baseurl, title), 0755) + //ioutil.WriteFile("tmp/Weapons.txt", halo.Weapons(baseurl, title), 0755) + // Matches For Player //fmt.Println(string(halo.MatchesForPlayer(baseurl, title, sampleGamertag, "warzone", 0, 0))) // Events For Match - //fmt.Println(string(halo.EventsForMatch(baseurl, title, sampleMatchID))) + //fmt.Println(string(halo.EventsForMatch(baseurl, title, sampleArenaMatchID))) // Player Leaderboards //fmt.Println(string(halo.PlayerLeaderboard(baseurl, title, sampleSeasonID, samplePlaylistID, 0))) @@ -26,9 +75,21 @@ func main() { // Service Record: Arena //fmt.Println(string(halo.ServiceRecordArena(baseurl, title, samplePlayers, sampleSeasonID))) - // Vehicles - //fmt.Println(string(halo.Vehicles(baseurl, title))) - // Spartan Image //fmt.Println(string(halo.SpartanImage(baseurl, title, sampleGamertag, 0, ""))) + + // ioutil.WriteFile("tmp/EventsForMatch.txt", halo.EventsForMatch(baseurl, title, sampleArenaMatchID), 0755) + // ioutil.WriteFile("tmp/MatchesForPlayer.txt", halo.MatchesForPlayer(baseurl, title, sampleGamertag, "", 0, 0), 0755) + // ioutil.WriteFile("tmp/PlayerLeaderboard.txt", halo.PlayerLeaderboard(baseurl, title, sampleSeasonID, samplePlaylistID, 0), 0755) + // ioutil.WriteFile("tmp/CarnageReportArena.txt", halo.CarnageReportArena(baseurl, title, sampleArenaMatchID), 0755) + // ioutil.WriteFile("tmp/CarnageReportCampaign.txt", halo.CarnageReportCampaign(baseurl, title, sampleCampaignMatchID), 0755) + // ioutil.WriteFile("tmp/CarnageReportCustom.txt", halo.CarnageReportCustom(baseurl, title, sampleCustomMatchID), 0755) + // ioutil.WriteFile("tmp/CarnageReportWarzone.txt", halo.CarnageReportWarzone(baseurl, title, sampleWarzoneMatchID), 0755) + // fmt.Println("Sleeping") + // time.Sleep(10 * time.Second) + // ioutil.WriteFile("tmp/ServiceRecordArena.txt", halo.ServiceRecordArena(baseurl, title, samplePlayers, sampleSeasonID), 0755) + // ioutil.WriteFile("tmp/ServiceRecordCampaign.txt", halo.ServiceRecordCampaign(baseurl, title, samplePlayers), 0755) + // ioutil.WriteFile("tmp/ServiceRecordCustom.txt", halo.ServiceRecordCustom(baseurl, title, samplePlayers), 0755) + // ioutil.WriteFile("tmp/ServiceRecordWarzone.txt", halo.ServiceRecordWarzone(baseurl, title, samplePlayers), 0755) + }