Sha256: a207e8935ecb57d711bb72ec50a8cb79c288ac4a887e9d0e17110029d717bb9d

Contents?: true

Size: 1.51 KB

Versions: 660

Compression:

Stored size: 1.51 KB

Contents

require_relative 'portal_base'

module Spaceship
  module Portal
    class Person < PortalBase
      # @return (String) Person Id
      attr_accessor :person_id

      # @return (String) First name
      attr_accessor :firstname

      # @return (String) Last name
      attr_accessor :lastname

      # @return (String) Email Address
      attr_accessor :email_address

      # @return (String) Developer status (active, inactive)
      attr_accessor :developer_status

      # @return (String) Joined Date
      attr_accessor :joined

      # @return (String) Id in Team scope
      attr_accessor :team_member_id

      # @return (String) Role (member, admin or agent)
      attr_accessor :type

      attr_mapping(
        'personId' => :person_id,
        'firstName' => :firstname,
        'lastName' => :lastname,
        'email' => :email_address,
        'developerStatus' => :developer_status,
        'dateJoined' => :joined,
        'teamMemberId' => :team_member_id
      )

      def remove!
        client.team_remove_member!(team_member_id)
      end

      def change_role(role)
        client.team_set_role(team_member_id, role)
      end

      class << self
        def factory(attrs)
          begin
            attrs['dateJoined'] = Time.parse(attrs['dateJoined'])
          rescue TypeError
            # Raised if we start getting integer timestamps
          rescue ArgumentError
            # Raised if the string's format can't be parsed
          end
          return self.new(attrs)
        end
      end
    end
  end
end

Version data entries

660 entries across 660 versions & 5 rubygems

Version Path
fastlane-2.225.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.224.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.223.1 spaceship/lib/spaceship/portal/person.rb
fastlane-2.223.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.222.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.221.1 spaceship/lib/spaceship/portal/person.rb
fastlane-2.221.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.220.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.219.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.218.0 spaceship/lib/spaceship/portal/person.rb
fastlane-security-patched-2.216.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.217.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.216.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.215.1 spaceship/lib/spaceship/portal/person.rb
fastlane-2.215.0 spaceship/lib/spaceship/portal/person.rb
fastlane-mercafacil-2.214.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.214.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.213.0 spaceship/lib/spaceship/portal/person.rb
fastlane-2.212.2 spaceship/lib/spaceship/portal/person.rb
fastlane_pricing_fix-2.212.1 spaceship/lib/spaceship/portal/person.rb