Class: Knockapi::Resources::Providers::MsTeams

Inherits:
Object
  • Object
show all
Defined in:
lib/knockapi/resources/providers/ms_teams.rb

Instance Method Summary collapse

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.

Parameters:



116
117
118
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 116

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.

Parameters:

  • channel_id (String)

    The ID of the Knock Microsoft Teams channel to check.

  • ms_teams_tenant_object (String)

    A JSON encoded string containing the Microsoft Teams tenant object reference.

  • request_options (Knockapi::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 21

def check_auth(channel_id, params)
  parsed, options = Knockapi::Providers::MsTeamCheckAuthParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/providers/ms-teams/%1$s/auth_check", channel_id],
    query: parsed,
    model: Knockapi::Models::Providers::MsTeamCheckAuthResponse,
    options: 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.

Parameters:

Returns:

See Also:



50
51
52
53
54
55
56
57
58
59
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 50

def list_channels(channel_id, params)
  parsed, options = Knockapi::Providers::MsTeamListChannelsParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/providers/ms-teams/%1$s/channels", channel_id],
    query: parsed,
    model: Knockapi::Models::Providers::MsTeamListChannelsResponse,
    options: 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.

Parameters:

Returns:

See Also:



77
78
79
80
81
82
83
84
85
86
87
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 77

def list_teams(channel_id, params)
  parsed, options = Knockapi::Providers::MsTeamListTeamsParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/providers/ms-teams/%1$s/teams", channel_id],
    query: parsed,
    page: Knockapi::Internal::MsTeamsPagination,
    model: Knockapi::Models::Providers::MsTeamListTeamsResponse,
    options: 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.

Parameters:

  • channel_id (String)

    The ID of the Knock Microsoft Teams channel to revoke access for.

  • ms_teams_tenant_object (String)

    A JSON encoded string containing the Microsoft Teams tenant object reference.

  • request_options (Knockapi::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



102
103
104
105
106
107
108
109
110
111
# File 'lib/knockapi/resources/providers/ms_teams.rb', line 102

def revoke_access(channel_id, params)
  parsed, options = Knockapi::Providers::MsTeamRevokeAccessParams.dump_request(params)
  @client.request(
    method: :put,
    path: ["v1/providers/ms-teams/%1$s/revoke_access", channel_id],
    query: parsed,
    model: Knockapi::Models::Providers::MsTeamRevokeAccessResponse,
    options: options
  )
end