Sha256: 0e717414827ec124fe3b99decef87c877e99ccef9ad826bdb802922a9454df2a

Contents?: true

Size: 1.08 KB

Versions: 156

Compression:

Stored size: 1.08 KB

Contents

require_relative '../client'
require_relative '../../tunes/tunes_client'

module Spaceship
  class ConnectAPI
    module Users
      class Client < Spaceship::ConnectAPI::Client
        def self.instance
          # Verify there is a token or a client that can be used
          if Spaceship::ConnectAPI.token
            if @client.nil? || @client.token != Spaceship::ConnectAPI.token
              @client = Client.new(token: Spaceship::ConnectAPI.token)
            end
          elsif Spaceship::Tunes.client
            # Initialize new client if new or if team changed
            if @client.nil? || @client.team_id != Spaceship::Tunes.client.team_id
              @client = Client.client_with_authorization_from(Spaceship::Tunes.client)
            end
          end

          # Need to handle not having a client but this shouldn't ever happen
          raise "Please login using `Spaceship::Tunes.login('user', 'password')`" unless @client

          @client
        end

        def self.hostname
          'https://appstoreconnect.apple.com/iris/v1/'
        end
      end
    end
  end
end

Version data entries

156 entries across 156 versions & 2 rubygems

Version Path
fastlane-2.129.0.beta.20190810200059 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190809200051 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190808200013 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190807200122 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190806200055 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190805200019 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190804200053 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190803200103 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190802200057 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190731200035 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190730200040 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190729200106 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190728200052 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190727200032 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190726200041 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.128.1 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190725200033 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.129.0.beta.20190723200012 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.128.0 spaceship/lib/spaceship/connect_api/users/client.rb
fastlane-2.128.0.beta.20190722200021 spaceship/lib/spaceship/connect_api/users/client.rb