lib/spaceship/tunes/tunes_client.rb in spaceship-0.23.0 vs lib/spaceship/tunes/tunes_client.rb in spaceship-0.24.0

- old
+ new

@@ -1,10 +1,10 @@ module Spaceship # rubocop:disable Metrics/ClassLength class TunesClient < Spaceship::Client # ITunesConnectError is only thrown when iTunes Connect raises an exception - class ITunesConnectError < StandardError + class ITunesConnectError < BasicPreferredInfoError end # raised if the server failed to save temporarily class ITunesConnectTemporaryError < ITunesConnectError end @@ -78,11 +78,11 @@ t_id = (ENV['FASTLANE_ITC_TEAM_ID'] || '').strip t_name = (ENV['FASTLANE_ITC_TEAM_NAME'] || '').strip if t_name.length > 0 teams.each do |t| - t_id = t['contentProvider']['contentProviderId'].to_s if t['contentProvider']['name'].downcase == t_name.downcase + t_id = t['contentProvider']['contentProviderId'].to_s if t['contentProvider']['name'].casecmp(t_name.downcase).zero? end end t_id = teams.first['contentProvider']['contentProviderId'].to_s if teams.count == 1 @@ -569,9 +569,25 @@ r = request(:post) do |req| req.url "ra/apps/#{app_id}/platforms/#{platform}/trains/#{train}/builds/#{build_number}/reject" req.body = {}.to_json req.headers['Content-Type'] = 'application/json' end + handle_itc_response(r.body) + end + + # All build trains, even if there is no TestFlight + def all_build_trains(app_id: nil) + r = request(:get, "ra/apps/#{app_id}/buildHistory?platform=ios") + handle_itc_response(r.body) + end + + def all_builds_for_train(app_id: nil, train: nil) + r = request(:get, "ra/apps/#{app_id}/trains/#{train}/buildHistory?platform=ios") + handle_itc_response(r.body) + end + + def build_details(app_id: nil, train: nil, build_number: nil) + r = request(:get, "ra/apps/#{app_id}/platforms/ios/trains/#{train}/builds/#{build_number}/details") handle_itc_response(r.body) end def update_build_information!(app_id: nil, train: nil,