Sha256: 68963b3289e457108aa25350ca61727320f931c8cfa9c8507a43b6ed9a43015c

Contents?: true

Size: 1.48 KB

Versions: 189

Compression:

Stored size: 1.48 KB

Contents

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

189 entries across 189 versions & 1 rubygems

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