Sha256: b56348e4ac5aaa2b67ad3de6447973feb7d2ec64f873dde9c2918a455f0cf36d

Contents?: true

Size: 1.82 KB

Versions: 660

Compression:

Stored size: 1.82 KB

Contents

require_relative 'tunes_base'

module Spaceship
  module Tunes
    class SandboxTester < TunesBase
      # @return (String) The email of this sandbox tester
      # @example
      #   "tester@spaceship.com"
      attr_accessor :email

      # @return (String) The first name of this tester
      # @example
      #   "Cary"
      attr_accessor :first_name

      # @return (String) The last name of this tester
      # @example
      #   "Bennett"
      attr_accessor :last_name

      # @return (String) The two-letter country code of this tester
      # @example
      #   "US"
      attr_accessor :country

      attr_mapping(
        'emailAddress.value' => :email,
        'firstName.value' => :first_name,
        'lastName.value' => :last_name,
        'storeFront.value' => :country
      )

      def self.url
        {
          index:  "ra/users/iap",
          create: "ra/users/iap/add",
          delete: "ra/users/iap/delete"
        }
      end

      def self.all
        client.sandbox_testers(self).map { |tester| self.new(tester) }
      end

      def self.create!(email: nil, password: nil, first_name: 'Test', last_name: 'Test', country: 'US')
        data = client.create_sandbox_tester!(
          tester_class: self,
          email: email,
          password: password,
          first_name: first_name,
          last_name: last_name,
          country: country
        )
        self.new(data)
      end

      def self.delete!(emails)
        client.delete_sandbox_testers!(self, emails)
      end

      def self.delete_all!
        delete!(self.all.map(&:email))
      end

      #####################################################
      # @!group Subclasses
      #####################################################
      # Delete current tester
      def delete!
        client.delete_tester!(self)
      end
    end
  end
end

Version data entries

660 entries across 660 versions & 5 rubygems

Version Path
fastlane-2.189.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.188.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.187.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.186.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.185.1 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.185.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.184.1 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.184.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.183.2 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.183.1 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.183.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.182.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.181.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.180.1 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.180.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.179.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.178.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.177.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.176.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.175.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb