Sha256: 7848eaa9b76fdb7df1f733012cfce770b391f2a3c18fb9004d5c25c8b2960246

Contents?: true

Size: 1.74 KB

Versions: 1

Compression:

Stored size: 1.74 KB

Contents

# frozen_string_literal: true

module Zoom
  module Actions
    module IM
      module Chat
        def get_chat_channels(*args)
          params = Zoom::Params.new(Utils.extract_options!(args))
          params.require(:channel_id)
          Utils.parse_response self.class.get("/chat/channels/#{params[:channel_id]}", headers: request_headers)
        end

        def get_chat_user_channels(*args)
          params = Zoom::Params.new(Utils.extract_options!(args))
          params.require(:user_id).permit(%i[next_page_token page_size])
          Utils.parse_response self.class.get("/chat/users/#{params[:user_id]}/channels", query: params.except(:user_id), headers: request_headers)
        end

        # Get chat messages for a specified period.
        def chat_get(*args)
          options = Utils.extract_options!(args)
          Zoom::Params.new(options).require(:access_token, :session_id, :from, :to)
          # TODO: handle date format for `from` and `to` params
          # TODO: implement `next_page_token`, will be returned whenever the set of available chat history list exceeds 100. The expiration period is 30 minutes.
          Utils.parse_response self.class.post('/chat/get', query: options)
        end

        # Get chat history list for a specified time period.
        def chat_list(*args)
          options = Utils.extract_options!(args)
          Zoom::Params.new(options).require(:access_token, :from, :to)
          # TODO: handle date format for `from` and `to` params
          # TODO: implement `next_page_token`, will be returned whenever the set of available chat history list exceeds 100. The expiration period is 30 minutes.
          Utils.parse_response self.class.post('/chat/list', query: options)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zoom_rb-0.11.0 lib/zoom/actions/im/chat.rb