Sha256: 4ee1e164efe55c5f10ce50e277eb4fd51040d0e6a96add95283b75e3b2167244

Contents?: true

Size: 1.15 KB

Versions: 35

Compression:

Stored size: 1.15 KB

Contents

module RockRMS
  class Client
    module GroupMember
      def create_group_member(group_id:,
                              group_member_status:,
                              group_role_id:,
                              person_id:)
        post(
          group_member_path,
          IsSystem: false,
          GroupId: group_id,
          GroupMemberStatus: group_member_status,
          GroupRoleId: group_role_id,
          PersonId: person_id
        )
      end

      def list_group_members(options = {})
        Response::GroupMember.format(
          get(group_member_path, options)
        )
      end

      def delete_group_member(id)
        delete(group_member_path(id))
      end

      def create_known_relationship(person_id:, related_person_id:, relationship_role_id:)
        url_params = {
          personId: person_id,
          relatedPersonId: related_person_id,
          relationshipRoleId: relationship_role_id
        }

        post("GroupMembers/KnownRelationship?#{URI.encode_www_form(url_params)}")
      end

      private

      def group_member_path(id = nil)
        id ? "GroupMembers/#{id}" : 'GroupMembers'
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rock_rms-9.13.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.12.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.11.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.10.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.9.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.8.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.7.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.6.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.5.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.4.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.3.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.2.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.1.0 lib/rock_rms/resources/group_member.rb
rock_rms-9.0.0 lib/rock_rms/resources/group_member.rb
rock_rms-8.23.0 lib/rock_rms/resources/group_member.rb
rock_rms-8.22.0 lib/rock_rms/resources/group_member.rb
rock_rms-8.21.0 lib/rock_rms/resources/group_member.rb
rock_rms-8.20.0 lib/rock_rms/resources/group_member.rb
rock_rms-8.19.0 lib/rock_rms/resources/group_member.rb
rock_rms-8.18.0 lib/rock_rms/resources/group_member.rb