Sha256: 9762d44e1934e69013b43c7b5b9b2c4281b9cf0ed33d81faa32d5e437581818b

Contents?: true

Size: 888 Bytes

Versions: 7

Compression:

Stored size: 888 Bytes

Contents

# frozen_string_literal: true

require_relative "../../../response/subscribe_to_updates_response"
require_relative "../../../response/changed_users_response"

module ONEAccess
  module API
    module V1_1 # rubocop:disable Style/ClassAndModuleCamelCase
      module Entitlement
        class UserSubscription < Base
          api_path "/entitlement/userSubscription"

          def self.subscribe(user_ids:)
            response = send_post("subscribeToUpdates", user_ids)

            Response::SubscribeToUpdatesResponse.from_json(response.body)
          end

          def self.changed_users(from_date: nil)
            params = { dateFrom: from_date }.reject { |_, v| v.nil? }
            response = send_get("subscribeToUpdates/changedUsers/getList", params)

            Response::ChangedUsersResponse.from_json(response.body)
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
oneaccess-0.4.4 lib/oneaccess/api/v1_1/entitlement/user_subscription.rb
oneaccess-0.4.3 lib/oneaccess/api/v1_1/entitlement/user_subscription.rb
oneaccess-0.4.2 lib/oneaccess/api/v1_1/entitlement/user_subscription.rb
oneaccess-0.4.1 lib/oneaccess/api/v1_1/entitlement/user_subscription.rb
oneaccess-0.4.0 lib/oneaccess/api/v1_1/entitlement/user_subscription.rb
oneaccess-0.3.0 lib/oneaccess/api/v1_1/entitlement/user_subscription.rb
oneaccess-0.2.0 lib/oneaccess/api/v1_1/entitlement/user_subscription.rb