lib/spaceship/tunes/application.rb in spaceship-0.24.1 vs lib/spaceship/tunes/application.rb in spaceship-0.25.0

- old
+ new

@@ -374,9 +374,26 @@ raise "Tester is not on #{self.name} betatesters" unless tester tester.remove_from_app!(self.apple_id) end + ##################################################### + # @!group Promo codes + ##################################################### + def promocodes + data = client.app_promocodes(app_id: self.apple_id) + data.map do |attrs| + Tunes::AppVersionPromocodes.factory(attrs) + end + end + + def promocodes_history + data = client.app_promocodes_history(app_id: self.apple_id) + data.map do |attrs| + Tunes::AppVersionGeneratedPromocodes.factory(attrs) + end + end + # private to module def ensure_not_a_bundle # we only support applications platform = Spaceship::Tunes::AppVersionCommon.find_platform(raw_data['versionSets']) raise "We do not support BUNDLE types right now" if platform['type'] == 'BUNDLE'