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.70.3 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171221010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.70.2 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171220010004 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.71.0.beta.20171219010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.70.1 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.70.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.70.0.beta.20171217010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.70.0.beta.20171216010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.70.0.beta.20171215010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.69.3 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.70.0.beta.20171214010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.69.2 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.69.1 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.70.0.beta.20171213010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.69.0 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.69.0.beta.20171212010004 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.69.0.beta.20171211010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.69.0.beta.20171210010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb
fastlane-2.69.0.beta.20171209010003 spaceship/lib/spaceship/tunes/sandbox_tester.rb