Skip to content

Commit

Permalink
Add UpdateAttendeeCapabilities and BatchUpdateAttendeeCapabilitiesExcept
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardd committed Sep 26, 2024
1 parent 32e8673 commit 1f4e6c3
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.14.2
erlang 26.1.2
elixir 1.17.2
erlang 27.0.1
44 changes: 39 additions & 5 deletions lib/ex_aws/chime/meetings.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ defmodule ExAws.Chime.Meetings do
"""

alias ExAws.Chime
alias ExAws.Chime.Meetings.AttendeeCapabilities
alias ExAws.Chime.Meetings.CreateAttendeeRequestItem
alias ExAws.Chime.Meetings.CreateAttendeeRequestItem
alias ExAws.Chime.Meetings.EngineTranscribeSettings
alias ExAws.Chime.Meetings.MeetingNotificationConfiguration
alias ExAws.Chime.Meetings.NotificationConfiguration
alias ExAws.Chime.Tag
alias ExAws.Chime.Utils
alias ExAws.Operation.JSON
Expand All @@ -28,6 +30,26 @@ defmodule ExAws.Chime.Meetings do
)
end

@spec batch_update_attendee_capabilities_except(String.t(), AttendeeCapabilities.t(), [
String.t()
]) :: JSON.t()
def batch_update_attendee_capabilities_except(
meeting_id,
attendee_capabilities,
excluded_attendee_ids
) do
json_request(
"/meetings/#{meeting_id}/attendees/capabilities",
%{
operation: "batch-update-except"
},
%{
"Capabilities" => attendee_capabilities,
"ExcludedAttendeeIds" => Enum.map(excluded_attendee_ids, &%{AttendeeId: &1})
}
)
end

@spec create_attendee(String.t(), CreateAttendeeRequestItem.t()) :: JSON.t()
def create_attendee(meeting_id, create_attendee) do
json_request(
Expand All @@ -41,7 +63,7 @@ defmodule ExAws.Chime.Meetings do
String.t() | nil,
String.t() | nil,
String.t() | nil,
MeetingNotificationConfiguration.t() | nil,
NotificationConfiguration.t() | nil,
[Tag.t()] | nil
) :: JSON.t()
def create_meeting(
Expand Down Expand Up @@ -70,7 +92,7 @@ defmodule ExAws.Chime.Meetings do
String.t(),
String.t() | nil,
String.t() | nil,
MeetingNotificationConfiguration.t() | nil,
NotificationConfiguration.t() | nil,
[Tag.t()] | nil
) :: JSON.t()
def create_meeting_with_attendees(
Expand Down Expand Up @@ -177,9 +199,21 @@ defmodule ExAws.Chime.Meetings do
)
end

@spec update_attendee_capabilities(String.t(), String.t(), AttendeeCapabilities.t()) :: JSON.t()
def update_attendee_capabilities(meeting_id, attendee_id, attendee_capabilities) do
json_request(
"/meetings/#{meeting_id}/attendees/#{attendee_id}/capabilities",
%{},
%{
"Capabilities" => attendee_capabilities
},
:put
)
end

### HELPERS
defp json_request(path, params, data),
do: Chime.json_request(path, params, data, :post, @service)
defp json_request(path, params, data, method \\ :post),
do: Chime.json_request(path, params, data, method, @service)

defp delete_request(path), do: Chime.delete_request(path, @service)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
defmodule ExAws.Chime.Meetings.MeetingNotificationConfiguration do
defmodule ExAws.Chime.Meetings.NotificationConfiguration do
@moduledoc """
Module representing the Chime MeetingNotificationConfiguration data type
Module representing the Chime NotificationConfiguration data type
See https://docs.aws.amazon.com/chime/latest/APIReference/API_MeetingNotificationConfiguration.html
See https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_meeting-chime_NotificationsConfiguration.html
"""

defstruct [
:lambda_function_arn,
:sns_topic_arn,
:sqs_queue_arn
]

@type t :: %__MODULE__{
lambda_function_arn: String.t() | nil,
sns_topic_arn: String.t() | nil,
sqs_queue_arn: String.t() | nil
}
Expand Down

0 comments on commit 1f4e6c3

Please sign in to comment.