Commit 64d747d2 authored by Francis's avatar Francis
Browse files

Merge branch 'UpdateProfileEndpoints' into 'master'

Added new WoW endpoints and deprecated WoW community endpoints

See merge request !14
parents dbe430bf 86e0dc38
Pipeline #86164550 passed with stage
in 5 minutes and 1 second
Please view this file on the master branch, otherwise it may be outdated
**Version 0.2.9**
https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-api-update-collections-hunter-pets-and-reputations/757
* Added new character endpoints:
* reputations
* hunter-pets
* collections
* pets
* mounts
* Added new endpoints:
* reputation-tiers
* reputation-faction
* Marked all WoW community endpoints as deprecated: https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
**Version 0.2.8**
* Added the new character status endpoint
......
PATH
remote: .
specs:
blizzard_api (0.2.7)
blizzard_api (0.2.9)
redis (~> 4.1, >= 4.1.0)
GEM
......
......@@ -195,6 +195,12 @@ Most **data** endpoints will have always 3 methods available `index`, `get` and
- index
- get :id
- media :id
* Blizzard::Wow::ReputationTier
- index
- get :id
* Blizzard::Wow::ReputationFaction
- index
- get :id
* Blizzard::Wow::Auction
- get :realm
......@@ -237,7 +243,11 @@ Most **data** endpoints will have always 3 methods available `index`, `get` and
- titles :realm, :character
- mythic_keystone_profile :realm, :character
- mythic_keystone_seasons :realm, :character
- collections :realm, :character (Not active yet on Blizzard servers)
- collections :realm, :character
- pets :realm, :character
- mounts :realm, :character
- hunter_pets :realm, :character
- reputations :realm, :character
- raid_progression :realm, :character (Not active yet on Blizzard servers)
### 4.2. Diablo III endpoints
......
......@@ -2,5 +2,5 @@
module BlizzardApi
# Gem version
VERSION = '0.2.7'
VERSION = '0.2.9'
end
......@@ -30,6 +30,8 @@ module BlizzardApi
require_relative 'wow/game_data/title'
require_relative 'wow/game_data/item'
require_relative 'wow/game_data/azerite_essence'
require_relative 'wow/game_data/reputation_tier'
require_relative 'wow/game_data/reputation_faction'
##
# @return {Achievement}
......@@ -169,6 +171,18 @@ module BlizzardApi
BlizzardApi::Wow::AzeriteEssence.new
end
##
# @return {ReputationTier}
def self.reputation_tier
BlizzardApi::Wow::ReputationTier.new
end
##
# @return {ReputationFaction}
def self.reputation_faction
BlizzardApi::Wow::ReputationFaction.new
end
# Wow community api
require_relative 'wow/community/auction'
require_relative 'wow/community/boss'
......
......@@ -5,6 +5,8 @@ module BlizzardApi
##
# This class allows access to World of Warcraft auctions
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# You can get an instance of this class using the default region as follows:
......
......@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.boss
class Boss < Wow::Request
......
......@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.challenge
class Challenge < Wow::Request
......
......@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.pvp
class PvP < Wow::Request
......
......@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.quest
class Quest < Wow::Request
......
......@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.recipe
class Recipe < Wow::Request
......
......@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.spell
class Spell < Wow::Request
......
......@@ -7,6 +7,8 @@ module BlizzardApi
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-community-api
#
# @deprecated See https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.zone
class Zone < Wow::Request
......
......@@ -3,7 +3,7 @@
module BlizzardApi
module Wow
##
# This class allows access to World of Warcraft achievements
# This class allows access to World of Warcraft creatures
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-game-data-api
#
......
# frozen_string_literal: true
module BlizzardApi
module Wow
##
# This class allows access to World of Warcraft reputation
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-game-data-api
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.creature
class ReputationFaction < Wow::GenericDataEndpoint
protected
def endpoint_setup
@endpoint = 'reputation-faction'
@namespace = :static
@collection = 'achievements'
@ttl = CACHE_TRIMESTER
end
end
end
end
# frozen_string_literal: true
module BlizzardApi
module Wow
##
# This class allows access to World of Warcraft reputation
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-game-data-api
#
# You can get an instance of this class using the default region as follows:
# api_instance = BlizzardApi::Wow.creature
class ReputationTier < Wow::GenericDataEndpoint
protected
def endpoint_setup
@endpoint = 'reputation-tiers'
@namespace = :static
@collection = 'achievements'
@ttl = CACHE_TRIMESTER
end
end
end
end
......@@ -12,25 +12,8 @@ module BlizzardApi
class CharacterProfile < Wow::Request
# Valid fields for character profile requests
VALID_FIELDS = %w[
achievements
appearance
feed
guild
hunterPets
items
mounts
pets
petSlots
professions
progression
pvp
quests
reputation
statistics
stats
talents
titles
audit
achievements appearance feed guild hunterPets items mounts pets petSlots professions progression
pvp quests reputation statistics stats talents titles audit
].freeze
##
......@@ -272,6 +255,62 @@ module BlizzardApi
character_request realm, character, options, 'collections'
end
##
# Return a character's pet collection
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
#
# @param realm [String] The character realm's slug
# @param character [String] The character name
# @!macro request_options
#
# @!macro response
def pets(realm, character, options = {})
character_request realm, character, options, 'collections/pets'
end
##
# Return a character's mount collection
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
#
# @param realm [String] The character realm's slug
# @param character [String] The character name
# @!macro request_options
#
# @!macro response
def mounts(realm, character, options = {})
character_request realm, character, options, 'collections/mounts'
end
##
# Return a character's reputations
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
#
# @param realm [String] The character realm's slug
# @param character [String] The character name
# @!macro request_options
#
# @!macro response
def reputation(realm, character, options = {})
character_request realm, character, options, 'reputations'
end
##
# Return a character's hunter pets
#
# @see https://develop.battle.net/documentation/api-reference/world-of-warcraft-profile-api
#
# @param realm [String] The character realm's slug
# @param character [String] The character name
# @!macro request_options
#
# @!macro response
def hunter_pets(realm, character, options = {})
character_request realm, character, options, 'hunter-pets'
end
##
# Return a character's raid progression
#
......
# frozen_string_literal: true
require 'test_helper'
module BlizzardApi
module Wow
class ReputationFactionTest < Minitest::Test
def setup
@reputation = BlizzardApi::Wow::ReputationFaction.new
end
def test_reputation_tier_index
reputation_data = @reputation.index
assert_equal 196, reputation_data[:factions].count
end
def test_reputation_tier_get
reputation_data = @reputation.get 1105
assert_equal 'The Oracles', reputation_data[:name][:en_US]
end
end
end
end
# frozen_string_literal: true
require 'test_helper'
module BlizzardApi
module Wow
class ReputationTierTest < Minitest::Test
def setup
@reputation = BlizzardApi::Wow::ReputationTier.new
end
def test_reputation_tier_index
reputation_data = @reputation.index
assert_equal 37, reputation_data[:reputation_tiers].count
end
def test_reputation_tier_get
reputation_data = @reputation.get 26
assert_equal 'Nat Pagle', reputation_data[:faction][:name][:en_US]
end
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment