Class: Teems::Api::Channels

Inherits:
Client
  • Object
show all
Defined in:
lib/teems/api/channels.rb

Overview

API wrapper for Teams and channels endpoints using Microsoft Graph API

Constant Summary

Constants inherited from Client

Teems::Api::Client::ENDPOINT

Instance Method Summary collapse

Methods inherited from Client

#initialize

Constructor Details

This class inherits a constructor from Teems::Api::Client

Instance Method Details

#get_channel(team_id:, channel_id:) ⇒ Object

Get details about a specific channel



19
20
21
22
23
# File 'lib/teems/api/channels.rb', line 19

def get_channel(team_id:, channel_id:)
  encoded_team = URI.encode_www_form_component(team_id)
  encoded_channel = URI.encode_www_form_component(channel_id)
  get("/v1.0/teams/#{encoded_team}/channels/#{encoded_channel}")
end

#list_channels(team_id:) ⇒ Object

Get channels for a specific team



13
14
15
16
# File 'lib/teems/api/channels.rb', line 13

def list_channels(team_id:)
  encoded_team = URI.encode_www_form_component(team_id)
  get("/v1.0/teams/#{encoded_team}/channels")
end

#list_teamsObject

Get list of teams the user has joined



8
9
10
# File 'lib/teems/api/channels.rb', line 8

def list_teams
  get('/v1.0/me/joinedTeams')
end