Sha256: eaef8797697a26bae91b1a9339d18381a863805a99730fb24fd0e1e3bbe4216a

Contents?: true

Size: 1.79 KB

Versions: 65

Compression:

Stored size: 1.79 KB

Contents

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

65 entries across 65 versions & 1 rubygems

Version Path
fastlane-2.74.0.beta.20180106010004 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.73.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.73.0.beta.20180105010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.73.0.beta.20180104010004 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.73.0.beta.20180103010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.72.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.72.0.beta.20180102010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.72.0.beta.20180101010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.72.0.beta.20171231010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.1 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.72.0.beta.20171230010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.72.0.beta.20171229010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.72.0.beta.20171228010004 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171227010004 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171226010004 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171225010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171224010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171223010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171222010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb