Class: Knockapi::Resources::Providers::MsTeams
- Inherits:
-
Object
- Object
- Knockapi::Resources::Providers::MsTeams
- Defined in:
- lib/knockapi/resources/providers/ms_teams.rb,
sig/knockapi/resources/providers/ms_teams.rbs
Overview
A provider represents a third-party service that Knock integrates with and is configured via a channel.
Instance Method Summary collapse
-
#check_auth(channel_id, ms_teams_tenant_object:, request_options: {}) ⇒ Knockapi::Models::Providers::MsTeamCheckAuthResponse
Check if a connection to Microsoft Teams has been authorized for a given Microsoft Teams tenant object.
-
#initialize(client:) ⇒ MsTeams
constructor
private
A new instance of MsTeams.
-
#list_channels(channel_id, ms_teams_tenant_object:, team_id:, query_options: nil, request_options: {}) ⇒ Knockapi::Models::Providers::MsTeamListChannelsResponse
List the Microsoft Teams channels within a team.
-
#list_teams(channel_id, ms_teams_tenant_object:, query_options: nil, request_options: {}) ⇒ Knockapi::Internal::MsTeamsPagination<Knockapi::Models::Providers::MsTeamListTeamsResponse>
Get a list of teams belonging to the Microsoft Entra tenant.
-
#revoke_access(channel_id, ms_teams_tenant_object:, request_options: {}) ⇒ Knockapi::Models::Providers::MsTeamRevokeAccessResponse
Remove a Microsoft Entra tenant ID from a Microsoft Teams tenant object.
Constructor Details
#initialize(client:) ⇒ MsTeams
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of MsTeams.
122 123 124 |
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 122 def initialize(client:) @client = client end |
Instance Method Details
#check_auth(channel_id, ms_teams_tenant_object:, request_options: {}) ⇒ Knockapi::Models::Providers::MsTeamCheckAuthResponse
Check if a connection to Microsoft Teams has been authorized for a given Microsoft Teams tenant object.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 23 def check_auth(channel_id, params) parsed, = Knockapi::Providers::MsTeamCheckAuthParams.dump_request(params) query = Knockapi::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/providers/ms-teams/%1$s/auth_check", channel_id], query: query, model: Knockapi::Models::Providers::MsTeamCheckAuthResponse, options: ) end |
#list_channels(channel_id, ms_teams_tenant_object:, team_id:, query_options: nil, request_options: {}) ⇒ Knockapi::Models::Providers::MsTeamListChannelsResponse
List the Microsoft Teams channels within a team. By default, archived and private channels are excluded from the results.
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 53 def list_channels(channel_id, params) parsed, = Knockapi::Providers::MsTeamListChannelsParams.dump_request(params) query = Knockapi::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/providers/ms-teams/%1$s/channels", channel_id], query: query, model: Knockapi::Models::Providers::MsTeamListChannelsResponse, options: ) end |
#list_teams(channel_id, ms_teams_tenant_object:, query_options: nil, request_options: {}) ⇒ Knockapi::Internal::MsTeamsPagination<Knockapi::Models::Providers::MsTeamListTeamsResponse>
Get a list of teams belonging to the Microsoft Entra tenant. By default, archived and private channels are excluded from the results.
81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 81 def list_teams(channel_id, params) parsed, = Knockapi::Providers::MsTeamListTeamsParams.dump_request(params) query = Knockapi::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["v1/providers/ms-teams/%1$s/teams", channel_id], query: query, page: Knockapi::Internal::MsTeamsPagination, model: Knockapi::Models::Providers::MsTeamListTeamsResponse, options: ) end |
#revoke_access(channel_id, ms_teams_tenant_object:, request_options: {}) ⇒ Knockapi::Models::Providers::MsTeamRevokeAccessResponse
Remove a Microsoft Entra tenant ID from a Microsoft Teams tenant object.
107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 107 def revoke_access(channel_id, params) parsed, = Knockapi::Providers::MsTeamRevokeAccessParams.dump_request(params) query = Knockapi::Internal::Util.encode_query_params(parsed) @client.request( method: :put, path: ["v1/providers/ms-teams/%1$s/revoke_access", channel_id], query: query, model: Knockapi::Models::Providers::MsTeamRevokeAccessResponse, options: ) end |