%% WARNING: DO NOT EDIT, AUTO-GENERATED CODE! %% See https://github.com/aws-beam/aws-codegen for more details. %% @doc Amazon GameLift Streams %% %% Amazon GameLift Streams provides a global cloud solution for content %% streaming experiences. %% %% Use Amazon GameLift Streams tools to upload and configure content for %% streaming, deploy and scale computing resources to host streams, and %% manage stream session placement to meet customer demand. %% %% This Reference Guide describes the Amazon GameLift Streams service API. %% You can use the API through the Amazon Web Services SDK, the Command Line %% Interface (CLI), or by making direct REST calls through HTTPS. %% %% See the Amazon GameLift Streams Developer Guide for more information on %% how Amazon GameLift Streams works and how to work with it. -module(aws_gameliftstreams). -export([add_stream_group_locations/3, add_stream_group_locations/4, associate_applications/3, associate_applications/4, create_application/2, create_application/3, create_stream_group/2, create_stream_group/3, create_stream_session_connection/4, create_stream_session_connection/5, delete_application/3, delete_application/4, delete_stream_group/3, delete_stream_group/4, disassociate_applications/3, disassociate_applications/4, export_stream_session_files/4, export_stream_session_files/5, get_application/2, get_application/4, get_application/5, get_stream_group/2, get_stream_group/4, get_stream_group/5, get_stream_session/3, get_stream_session/5, get_stream_session/6, list_applications/1, list_applications/3, list_applications/4, list_stream_groups/1, list_stream_groups/3, list_stream_groups/4, list_stream_sessions/2, list_stream_sessions/4, list_stream_sessions/5, list_stream_sessions_by_account/1, list_stream_sessions_by_account/3, list_stream_sessions_by_account/4, list_tags_for_resource/2, list_tags_for_resource/4, list_tags_for_resource/5, remove_stream_group_locations/3, remove_stream_group_locations/4, start_stream_session/3, start_stream_session/4, tag_resource/3, tag_resource/4, terminate_stream_session/4, terminate_stream_session/5, untag_resource/3, untag_resource/4, update_application/3, update_application/4, update_stream_group/3, update_stream_group/4]). -include_lib("hackney/include/hackney_lib.hrl"). %% Example: %% stream_session_summary() :: #{ %% <<"ApplicationArn">> => string(), %% <<"Arn">> => string(), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"ExportFilesMetadata">> => export_files_metadata(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"Location">> => string(), %% <<"Protocol">> => list(any()), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()), %% <<"UserId">> => string() %% } -type stream_session_summary() :: #{binary() => any()}. %% Example: %% tag_resource_request() :: #{ %% <<"Tags">> := map() %% } -type tag_resource_request() :: #{binary() => any()}. %% Example: %% create_stream_session_connection_input() :: #{ %% <<"ClientToken">> => string(), %% <<"SignalRequest">> := string() %% } -type create_stream_session_connection_input() :: #{binary() => any()}. %% Example: %% disassociate_applications_input() :: #{ %% <<"ApplicationIdentifiers">> := list(string()) %% } -type disassociate_applications_input() :: #{binary() => any()}. %% Example: %% performance_stats_configuration() :: #{ %% <<"SharedWithClient">> => [boolean()] %% } -type performance_stats_configuration() :: #{binary() => any()}. %% Example: %% remove_stream_group_locations_input() :: #{ %% <<"Locations">> := list([string()]()) %% } -type remove_stream_group_locations_input() :: #{binary() => any()}. %% Example: %% untag_resource_response() :: #{} -type untag_resource_response() :: #{}. %% Example: %% list_stream_sessions_output() :: #{ %% <<"Items">> => list(stream_session_summary()), %% <<"NextToken">> => string() %% } -type list_stream_sessions_output() :: #{binary() => any()}. %% Example: %% get_stream_group_input() :: #{} -type get_stream_group_input() :: #{}. %% Example: %% associate_applications_input() :: #{ %% <<"ApplicationIdentifiers">> := list(string()) %% } -type associate_applications_input() :: #{binary() => any()}. %% Example: %% start_stream_session_output() :: #{ %% <<"AdditionalEnvironmentVariables">> => map(), %% <<"AdditionalLaunchArgs">> => list([string()]()), %% <<"ApplicationArn">> => string(), %% <<"Arn">> => string(), %% <<"ConnectionTimeoutSeconds">> => integer(), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"Description">> => string(), %% <<"ExportFilesMetadata">> => export_files_metadata(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"Location">> => string(), %% <<"LogFileLocationUri">> => string(), %% <<"PerformanceStatsConfiguration">> => performance_stats_configuration(), %% <<"Protocol">> => list(any()), %% <<"SessionLengthSeconds">> => integer(), %% <<"SignalRequest">> => string(), %% <<"SignalResponse">> => string(), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()), %% <<"StreamGroupId">> => string(), %% <<"UserId">> => string(), %% <<"WebSdkProtocolUrl">> => string() %% } -type start_stream_session_output() :: #{binary() => any()}. %% Example: %% list_stream_sessions_by_account_output() :: #{ %% <<"Items">> => list(stream_session_summary()), %% <<"NextToken">> => string() %% } -type list_stream_sessions_by_account_output() :: #{binary() => any()}. %% Example: %% create_application_output() :: #{ %% <<"ApplicationLogOutputUri">> => string(), %% <<"ApplicationLogPaths">> => list(string()), %% <<"ApplicationSourceUri">> => string(), %% <<"Arn">> => string(), %% <<"AssociatedStreamGroups">> => list(string()), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"Description">> => string(), %% <<"ExecutablePath">> => string(), %% <<"Id">> => string(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"ReplicationStatuses">> => list(replication_status()), %% <<"RuntimeEnvironment">> => runtime_environment(), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()) %% } -type create_application_output() :: #{binary() => any()}. %% Example: %% default_application() :: #{ %% <<"Arn">> => string(), %% <<"Id">> => string() %% } -type default_application() :: #{binary() => any()}. %% Example: %% create_stream_group_output() :: #{ %% <<"Arn">> => string(), %% <<"AssociatedApplications">> => list(string()), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"DefaultApplication">> => default_application(), %% <<"Description">> => string(), %% <<"ExpiresAt">> => [non_neg_integer()], %% <<"Id">> => string(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"LocationStates">> => list(location_state()), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()), %% <<"StreamClass">> => list(any()) %% } -type create_stream_group_output() :: #{binary() => any()}. %% Example: %% untag_resource_request() :: #{ %% <<"TagKeys">> := list(string()) %% } -type untag_resource_request() :: #{binary() => any()}. %% Example: %% location_configuration() :: #{ %% <<"AlwaysOnCapacity">> => integer(), %% <<"LocationName">> => string(), %% <<"MaximumCapacity">> => integer(), %% <<"OnDemandCapacity">> => integer(), %% <<"TargetIdleCapacity">> => integer(), %% <<"VpcTransitConfiguration">> => vpc_transit_configuration() %% } -type location_configuration() :: #{binary() => any()}. %% Example: %% location_state() :: #{ %% <<"AllocatedCapacity">> => integer(), %% <<"AlwaysOnCapacity">> => integer(), %% <<"IdleCapacity">> => integer(), %% <<"InternalVpcIpv4CidrBlock">> => string(), %% <<"LocationName">> => string(), %% <<"MaximumCapacity">> => integer(), %% <<"OnDemandCapacity">> => integer(), %% <<"RequestedCapacity">> => integer(), %% <<"Status">> => list(any()), %% <<"TargetIdleCapacity">> => integer(), %% <<"VpcTransitConfiguration">> => vpc_transit_configuration_response() %% } -type location_state() :: #{binary() => any()}. %% Example: %% delete_stream_group_input() :: #{} -type delete_stream_group_input() :: #{}. %% Example: %% export_stream_session_files_output() :: #{} -type export_stream_session_files_output() :: #{}. %% Example: %% associate_applications_output() :: #{ %% <<"ApplicationArns">> => list(string()), %% <<"Arn">> => string() %% } -type associate_applications_output() :: #{binary() => any()}. %% Example: %% list_applications_output() :: #{ %% <<"Items">> => list(application_summary()), %% <<"NextToken">> => string() %% } -type list_applications_output() :: #{binary() => any()}. %% Example: %% list_applications_input() :: #{ %% <<"MaxResults">> => integer(), %% <<"NextToken">> => string() %% } -type list_applications_input() :: #{binary() => any()}. %% Example: %% conflict_exception() :: #{ %% <<"Message">> => [string()] %% } -type conflict_exception() :: #{binary() => any()}. %% Example: %% resource_not_found_exception() :: #{ %% <<"Message">> => [string()] %% } -type resource_not_found_exception() :: #{binary() => any()}. %% Example: %% service_quota_exceeded_exception() :: #{ %% <<"Message">> => [string()] %% } -type service_quota_exceeded_exception() :: #{binary() => any()}. %% Example: %% terminate_stream_session_input() :: #{} -type terminate_stream_session_input() :: #{}. %% Example: %% create_application_input() :: #{ %% <<"ApplicationLogOutputUri">> => string(), %% <<"ApplicationLogPaths">> => list(string()), %% <<"ApplicationSourceUri">> := string(), %% <<"ClientToken">> => string(), %% <<"Description">> := string(), %% <<"ExecutablePath">> := string(), %% <<"RuntimeEnvironment">> := runtime_environment(), %% <<"Tags">> => map() %% } -type create_application_input() :: #{binary() => any()}. %% Example: %% list_stream_sessions_by_account_input() :: #{ %% <<"ExportFilesStatus">> => list(any()), %% <<"MaxResults">> => integer(), %% <<"NextToken">> => string(), %% <<"Status">> => list(any()) %% } -type list_stream_sessions_by_account_input() :: #{binary() => any()}. %% Example: %% export_files_metadata() :: #{ %% <<"OutputUri">> => string(), %% <<"Status">> => list(any()), %% <<"StatusReason">> => string() %% } -type export_files_metadata() :: #{binary() => any()}. %% Example: %% disassociate_applications_output() :: #{ %% <<"ApplicationArns">> => list(string()), %% <<"Arn">> => string() %% } -type disassociate_applications_output() :: #{binary() => any()}. %% Example: %% list_tags_for_resource_response() :: #{ %% <<"Tags">> => map() %% } -type list_tags_for_resource_response() :: #{binary() => any()}. %% Example: %% add_stream_group_locations_output() :: #{ %% <<"Identifier">> => string(), %% <<"Locations">> => list(location_state()) %% } -type add_stream_group_locations_output() :: #{binary() => any()}. %% Example: %% start_stream_session_input() :: #{ %% <<"AdditionalEnvironmentVariables">> => map(), %% <<"AdditionalLaunchArgs">> => list([string()]()), %% <<"ApplicationIdentifier">> := string(), %% <<"ClientToken">> => string(), %% <<"ConnectionTimeoutSeconds">> => integer(), %% <<"Description">> => string(), %% <<"Locations">> => list(string()), %% <<"PerformanceStatsConfiguration">> => performance_stats_configuration(), %% <<"Protocol">> := list(any()), %% <<"SessionLengthSeconds">> => integer(), %% <<"SignalRequest">> := string(), %% <<"UserId">> => string() %% } -type start_stream_session_input() :: #{binary() => any()}. %% Example: %% update_stream_group_input() :: #{ %% <<"DefaultApplicationIdentifier">> => string(), %% <<"Description">> => string(), %% <<"LocationConfigurations">> => list(location_configuration()) %% } -type update_stream_group_input() :: #{binary() => any()}. %% Example: %% list_stream_groups_input() :: #{ %% <<"MaxResults">> => integer(), %% <<"NextToken">> => string() %% } -type list_stream_groups_input() :: #{binary() => any()}. %% Example: %% replication_status() :: #{ %% <<"Location">> => string(), %% <<"Status">> => list(any()) %% } -type replication_status() :: #{binary() => any()}. %% Example: %% get_application_output() :: #{ %% <<"ApplicationLogOutputUri">> => string(), %% <<"ApplicationLogPaths">> => list(string()), %% <<"ApplicationSourceUri">> => string(), %% <<"Arn">> => string(), %% <<"AssociatedStreamGroups">> => list(string()), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"Description">> => string(), %% <<"ExecutablePath">> => string(), %% <<"Id">> => string(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"ReplicationStatuses">> => list(replication_status()), %% <<"RuntimeEnvironment">> => runtime_environment(), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()) %% } -type get_application_output() :: #{binary() => any()}. %% Example: %% stream_group_summary() :: #{ %% <<"Arn">> => string(), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"DefaultApplication">> => default_application(), %% <<"Description">> => string(), %% <<"ExpiresAt">> => [non_neg_integer()], %% <<"Id">> => string(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"Status">> => list(any()), %% <<"StreamClass">> => list(any()) %% } -type stream_group_summary() :: #{binary() => any()}. %% Example: %% create_stream_group_input() :: #{ %% <<"ClientToken">> => string(), %% <<"DefaultApplicationIdentifier">> => string(), %% <<"Description">> := string(), %% <<"LocationConfigurations">> => list(location_configuration()), %% <<"StreamClass">> := list(any()), %% <<"Tags">> => map() %% } -type create_stream_group_input() :: #{binary() => any()}. %% Example: %% internal_server_exception() :: #{ %% <<"Message">> => [string()] %% } -type internal_server_exception() :: #{binary() => any()}. %% Example: %% vpc_transit_configuration() :: #{ %% <<"Ipv4CidrBlocks">> => list(string()), %% <<"VpcId">> => string() %% } -type vpc_transit_configuration() :: #{binary() => any()}. %% Example: %% access_denied_exception() :: #{ %% <<"Message">> => [string()] %% } -type access_denied_exception() :: #{binary() => any()}. %% Example: %% delete_application_input() :: #{} -type delete_application_input() :: #{}. %% Example: %% tag_resource_response() :: #{} -type tag_resource_response() :: #{}. %% Example: %% create_stream_session_connection_output() :: #{ %% <<"SignalResponse">> => string() %% } -type create_stream_session_connection_output() :: #{binary() => any()}. %% Example: %% runtime_environment() :: #{ %% <<"Type">> => list(any()), %% <<"Version">> => string() %% } -type runtime_environment() :: #{binary() => any()}. %% Example: %% get_stream_group_output() :: #{ %% <<"Arn">> => string(), %% <<"AssociatedApplications">> => list(string()), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"DefaultApplication">> => default_application(), %% <<"Description">> => string(), %% <<"ExpiresAt">> => [non_neg_integer()], %% <<"Id">> => string(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"LocationStates">> => list(location_state()), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()), %% <<"StreamClass">> => list(any()) %% } -type get_stream_group_output() :: #{binary() => any()}. %% Example: %% validation_exception() :: #{ %% <<"Message">> => [string()] %% } -type validation_exception() :: #{binary() => any()}. %% Example: %% list_tags_for_resource_request() :: #{} -type list_tags_for_resource_request() :: #{}. %% Example: %% throttling_exception() :: #{ %% <<"Message">> => [string()] %% } -type throttling_exception() :: #{binary() => any()}. %% Example: %% application_summary() :: #{ %% <<"Arn">> => string(), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"Description">> => string(), %% <<"Id">> => string(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"RuntimeEnvironment">> => runtime_environment(), %% <<"Status">> => list(any()) %% } -type application_summary() :: #{binary() => any()}. %% Example: %% update_application_input() :: #{ %% <<"ApplicationLogOutputUri">> => string(), %% <<"ApplicationLogPaths">> => list(string()), %% <<"Description">> => string() %% } -type update_application_input() :: #{binary() => any()}. %% Example: %% add_stream_group_locations_input() :: #{ %% <<"LocationConfigurations">> := list(location_configuration()) %% } -type add_stream_group_locations_input() :: #{binary() => any()}. %% Example: %% vpc_transit_configuration_response() :: #{ %% <<"Ipv4CidrBlocks">> => list(string()), %% <<"TransitGatewayId">> => [string()], %% <<"TransitGatewayResourceShareArn">> => [string()], %% <<"VpcId">> => string() %% } -type vpc_transit_configuration_response() :: #{binary() => any()}. %% Example: %% update_stream_group_output() :: #{ %% <<"Arn">> => string(), %% <<"AssociatedApplications">> => list(string()), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"DefaultApplication">> => default_application(), %% <<"Description">> => string(), %% <<"ExpiresAt">> => [non_neg_integer()], %% <<"Id">> => string(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"LocationStates">> => list(location_state()), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()), %% <<"StreamClass">> => list(any()) %% } -type update_stream_group_output() :: #{binary() => any()}. %% Example: %% export_stream_session_files_input() :: #{ %% <<"OutputUri">> := string() %% } -type export_stream_session_files_input() :: #{binary() => any()}. %% Example: %% list_stream_groups_output() :: #{ %% <<"Items">> => list(stream_group_summary()), %% <<"NextToken">> => string() %% } -type list_stream_groups_output() :: #{binary() => any()}. %% Example: %% get_application_input() :: #{} -type get_application_input() :: #{}. %% Example: %% list_stream_sessions_input() :: #{ %% <<"ExportFilesStatus">> => list(any()), %% <<"MaxResults">> => integer(), %% <<"NextToken">> => string(), %% <<"Status">> => list(any()) %% } -type list_stream_sessions_input() :: #{binary() => any()}. %% Example: %% get_stream_session_output() :: #{ %% <<"AdditionalEnvironmentVariables">> => map(), %% <<"AdditionalLaunchArgs">> => list([string()]()), %% <<"ApplicationArn">> => string(), %% <<"Arn">> => string(), %% <<"ConnectionTimeoutSeconds">> => integer(), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"Description">> => string(), %% <<"ExportFilesMetadata">> => export_files_metadata(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"Location">> => string(), %% <<"LogFileLocationUri">> => string(), %% <<"PerformanceStatsConfiguration">> => performance_stats_configuration(), %% <<"Protocol">> => list(any()), %% <<"SessionLengthSeconds">> => integer(), %% <<"SignalRequest">> => string(), %% <<"SignalResponse">> => string(), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()), %% <<"StreamGroupId">> => string(), %% <<"UserId">> => string(), %% <<"WebSdkProtocolUrl">> => string() %% } -type get_stream_session_output() :: #{binary() => any()}. %% Example: %% get_stream_session_input() :: #{} -type get_stream_session_input() :: #{}. %% Example: %% update_application_output() :: #{ %% <<"ApplicationLogOutputUri">> => string(), %% <<"ApplicationLogPaths">> => list(string()), %% <<"ApplicationSourceUri">> => string(), %% <<"Arn">> => string(), %% <<"AssociatedStreamGroups">> => list(string()), %% <<"CreatedAt">> => [non_neg_integer()], %% <<"Description">> => string(), %% <<"ExecutablePath">> => string(), %% <<"Id">> => string(), %% <<"LastUpdatedAt">> => [non_neg_integer()], %% <<"ReplicationStatuses">> => list(replication_status()), %% <<"RuntimeEnvironment">> => runtime_environment(), %% <<"Status">> => list(any()), %% <<"StatusReason">> => list(any()) %% } -type update_application_output() :: #{binary() => any()}. -type add_stream_group_locations_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | service_quota_exceeded_exception() | resource_not_found_exception(). -type associate_applications_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | service_quota_exceeded_exception() | resource_not_found_exception(). -type create_application_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | service_quota_exceeded_exception() | conflict_exception(). -type create_stream_group_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | service_quota_exceeded_exception() | resource_not_found_exception() | conflict_exception(). -type create_stream_session_connection_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception() | conflict_exception(). -type delete_application_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception() | conflict_exception(). -type delete_stream_group_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception() | conflict_exception(). -type disassociate_applications_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type export_stream_session_files_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type get_application_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type get_stream_group_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type get_stream_session_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type list_applications_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception(). -type list_stream_groups_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception(). -type list_stream_sessions_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type list_stream_sessions_by_account_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception(). -type list_tags_for_resource_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception(). -type remove_stream_group_locations_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type start_stream_session_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception() | conflict_exception(). -type tag_resource_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception(). -type terminate_stream_session_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type untag_resource_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception(). -type update_application_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | resource_not_found_exception(). -type update_stream_group_errors() :: throttling_exception() | validation_exception() | access_denied_exception() | internal_server_exception() | service_quota_exceeded_exception() | resource_not_found_exception() | conflict_exception(). %%==================================================================== %% API %%==================================================================== %% @doc Add locations that can host stream sessions. %% %% To add a location, the stream group must be in `ACTIVE' status. You %% configure locations and their corresponding capacity for each stream %% group. Creating a stream group in a location that's nearest to your %% end users can help minimize latency and improve quality. %% %% This operation provisions stream capacity at the specified locations. By %% default, all locations have 1 or 2 capacity, depending on the stream class %% option: 2 for 'High' and 1 for 'Ultra' and %% 'Win2022'. This operation also copies the content files of all %% associated applications to an internal S3 bucket at each location. This %% allows Amazon GameLift Streams to host performant stream sessions. -spec add_stream_group_locations(aws_client:aws_client(), binary() | list(), add_stream_group_locations_input()) -> {ok, add_stream_group_locations_output(), tuple()} | {error, any()} | {error, add_stream_group_locations_errors(), tuple()}. add_stream_group_locations(Client, Identifier, Input) -> add_stream_group_locations(Client, Identifier, Input, []). -spec add_stream_group_locations(aws_client:aws_client(), binary() | list(), add_stream_group_locations_input(), proplists:proplist()) -> {ok, add_stream_group_locations_output(), tuple()} | {error, any()} | {error, add_stream_group_locations_errors(), tuple()}. add_stream_group_locations(Client, Identifier, Input0, Options0) -> Method = post, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/locations"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc When you associate, or link, an application with a stream group, then %% Amazon GameLift Streams can launch the application using the stream %% group's allocated compute resources. %% %% The stream group must be in `ACTIVE' status. You can reverse this %% action by using DisassociateApplications: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DisassociateApplications.html. %% %% If a stream group does not already have a linked application, Amazon %% GameLift Streams will automatically assign the first application provided %% in `ApplicationIdentifiers' as the default. -spec associate_applications(aws_client:aws_client(), binary() | list(), associate_applications_input()) -> {ok, associate_applications_output(), tuple()} | {error, any()} | {error, associate_applications_errors(), tuple()}. associate_applications(Client, Identifier, Input) -> associate_applications(Client, Identifier, Input, []). -spec associate_applications(aws_client:aws_client(), binary() | list(), associate_applications_input(), proplists:proplist()) -> {ok, associate_applications_output(), tuple()} | {error, any()} | {error, associate_applications_errors(), tuple()}. associate_applications(Client, Identifier, Input0, Options0) -> Method = post, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/associations"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Creates an application resource in Amazon GameLift Streams, which %% specifies the application content you want to stream, such as a game build %% or other software, and configures the settings to run it. %% %% Before you create an application, upload your application content files to %% an Amazon Simple Storage Service (Amazon S3) bucket. For more information, %% see Getting Started in the Amazon GameLift Streams Developer Guide. %% %% Make sure that your files in the Amazon S3 bucket are the correct version %% you want to use. If you change the files at a later time, you will need to %% create a new Amazon GameLift Streams application. %% %% If the request is successful, Amazon GameLift Streams begins to create an %% application and sets the status to `INITIALIZED'. When an application %% reaches `READY' status, you can use the application to set up stream %% groups and start streams. To track application status, call %% GetApplication: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_GetApplication.html. -spec create_application(aws_client:aws_client(), create_application_input()) -> {ok, create_application_output(), tuple()} | {error, any()} | {error, create_application_errors(), tuple()}. create_application(Client, Input) -> create_application(Client, Input, []). -spec create_application(aws_client:aws_client(), create_application_input(), proplists:proplist()) -> {ok, create_application_output(), tuple()} | {error, any()} | {error, create_application_errors(), tuple()}. create_application(Client, Input0, Options0) -> Method = post, Path = ["/applications"], SuccessStatusCode = 201, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Stream groups manage how Amazon GameLift Streams allocates resources %% and handles concurrent streams, allowing you to effectively manage %% capacity and costs. %% %% Within a stream group, you specify an application to stream, streaming %% locations and their capacity, and the stream class you want to use when %% streaming applications to your end-users. A stream class defines the %% hardware configuration of the compute resources that Amazon GameLift %% Streams will use when streaming, such as the CPU, GPU, and memory. %% %% Stream capacity represents the number of concurrent streams that can be %% active at a time. You set stream capacity per location, per stream group. %% The following capacity settings are available: %% %% Always-on capacity: This setting, if non-zero, indicates minimum streaming %% capacity which is allocated to you and is never released back to the %% service. You pay for this base level of capacity at all times, whether %% used or idle. %% %% Maximum capacity: This indicates the maximum capacity that the service can %% allocate for you. Newly created streams may take a few minutes to start. %% Capacity is released back to the service when idle. You pay for capacity %% that is allocated to you until it is released. %% %% Target-idle capacity: This indicates idle capacity which the service %% pre-allocates and holds for you in anticipation of future activity. This %% helps to insulate your users from capacity-allocation delays. You pay for %% capacity which is held in this intentional idle state. %% %% Values for capacity must be whole number multiples of the tenancy value of %% the stream group's stream class. %% %% To adjust the capacity of any `ACTIVE' stream group, call %% UpdateStreamGroup: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_UpdateStreamGroup.html. %% %% If the `CreateStreamGroup' request is successful, Amazon GameLift %% Streams assigns a unique ID to the stream group resource and sets the %% status to `ACTIVATING'. It can take a few minutes for Amazon GameLift %% Streams to finish creating the stream group while it searches for %% unallocated compute resources and provisions them. When complete, the %% stream group status will be `ACTIVE' and you can start stream sessions %% by using StartStreamSession: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_StartStreamSession.html. %% To check the stream group's status, call GetStreamGroup: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_GetStreamGroup.html. %% %% Stream groups should be recreated every 3-4 weeks to pick up important %% service updates and fixes. Stream groups that are older than 180 days can %% no longer be updated with new application associations. Stream groups %% expire when they are 365 days old, at which point they can no longer %% stream sessions. The exact expiration date is indicated by the date value %% in the `ExpiresAt' field. -spec create_stream_group(aws_client:aws_client(), create_stream_group_input()) -> {ok, create_stream_group_output(), tuple()} | {error, any()} | {error, create_stream_group_errors(), tuple()}. create_stream_group(Client, Input) -> create_stream_group(Client, Input, []). -spec create_stream_group(aws_client:aws_client(), create_stream_group_input(), proplists:proplist()) -> {ok, create_stream_group_output(), tuple()} | {error, any()} | {error, create_stream_group_errors(), tuple()}. create_stream_group(Client, Input0, Options0) -> Method = post, Path = ["/streamgroups"], SuccessStatusCode = 201, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Enables clients to reconnect to a stream session while preserving all %% session state and data in the disconnected session. %% %% This reconnection process can be initiated when a stream session is in %% either `PENDING_CLIENT_RECONNECTION' or `ACTIVE' status. The %% process works as follows: %% %% Initial disconnect: %% %% When a client disconnects or loses connection, the stream session %% transitions from `CONNECTED' to `PENDING_CLIENT_RECONNECTION' %% %% Reconnection time window: %% %% Clients have `ConnectionTimeoutSeconds' (defined in %% StartStreamSession: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_StartStreamSession.html) %% to reconnect before session termination %% %% Your backend server must call CreateStreamSessionConnection to initiate %% reconnection %% %% Session transitions to `RECONNECTING' status %% %% Reconnection completion: %% %% On successful CreateStreamSessionConnection, session status changes to %% `ACTIVE' %% %% Provide the new connection information to the requesting client %% %% Client must establish connection within `ConnectionTimeoutSeconds' %% %% Session terminates automatically if client fails to connect in time %% %% For more information about the stream session lifecycle, see Stream %% sessions: %% https://docs.aws.amazon.com/gameliftstreams/latest/developerguide/stream-sessions.html %% in the Amazon GameLift Streams Developer Guide. %% %% To begin re-connecting to an existing stream session, specify the stream %% group ID and stream session ID that you want to reconnect to, and the %% signal request to use with the stream. -spec create_stream_session_connection(aws_client:aws_client(), binary() | list(), binary() | list(), create_stream_session_connection_input()) -> {ok, create_stream_session_connection_output(), tuple()} | {error, any()} | {error, create_stream_session_connection_errors(), tuple()}. create_stream_session_connection(Client, Identifier, StreamSessionIdentifier, Input) -> create_stream_session_connection(Client, Identifier, StreamSessionIdentifier, Input, []). -spec create_stream_session_connection(aws_client:aws_client(), binary() | list(), binary() | list(), create_stream_session_connection_input(), proplists:proplist()) -> {ok, create_stream_session_connection_output(), tuple()} | {error, any()} | {error, create_stream_session_connection_errors(), tuple()}. create_stream_session_connection(Client, Identifier, StreamSessionIdentifier, Input0, Options0) -> Method = post, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/streamsessions/", aws_util:encode_uri(StreamSessionIdentifier), "/connections"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Permanently deletes an Amazon GameLift Streams application resource. %% %% This also deletes the application content files stored with Amazon %% GameLift Streams. However, this does not delete the original files that %% you uploaded to your Amazon S3 bucket; you can delete these any time after %% Amazon GameLift Streams creates an application, which is the only time %% Amazon GameLift Streams accesses your Amazon S3 bucket. %% %% You can only delete an application that meets the following conditions: %% %% The application is in `READY' or `ERROR' status. You cannot delete %% an application that's in `PROCESSING' or `INITIALIZED' status. %% %% The application is not the default application of any stream groups. You %% must first delete the stream group by using DeleteStreamGroup: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DeleteStreamGroup.html. %% %% The application is not linked to any stream groups. You must first unlink %% the stream group by using DisassociateApplications: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_DisassociateApplications.html. %% %% An application is not streaming in any ongoing stream session. You must %% wait until the client ends the stream session or call %% TerminateStreamSession: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_TerminateStreamSession.html %% to end the stream. %% %% If any active stream groups exist for this application, this request %% returns a `ValidationException'. -spec delete_application(aws_client:aws_client(), binary() | list(), delete_application_input()) -> {ok, undefined, tuple()} | {error, any()} | {error, delete_application_errors(), tuple()}. delete_application(Client, Identifier, Input) -> delete_application(Client, Identifier, Input, []). -spec delete_application(aws_client:aws_client(), binary() | list(), delete_application_input(), proplists:proplist()) -> {ok, undefined, tuple()} | {error, any()} | {error, delete_application_errors(), tuple()}. delete_application(Client, Identifier, Input0, Options0) -> Method = delete, Path = ["/applications/", aws_util:encode_uri(Identifier), ""], SuccessStatusCode = 204, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Permanently deletes all compute resources and information related to %% a stream group. %% %% To delete a stream group, specify the unique stream group identifier. %% During the deletion process, the stream group's status is %% `DELETING'. This operation stops streams in progress and prevents new %% streams from starting. As a best practice, before deleting the stream %% group, call ListStreamSessions: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_ListStreamSessions.html %% to check for streams in progress and take action to stop them. When you %% delete a stream group, any application associations referring to that %% stream group are automatically removed. -spec delete_stream_group(aws_client:aws_client(), binary() | list(), delete_stream_group_input()) -> {ok, undefined, tuple()} | {error, any()} | {error, delete_stream_group_errors(), tuple()}. delete_stream_group(Client, Identifier, Input) -> delete_stream_group(Client, Identifier, Input, []). -spec delete_stream_group(aws_client:aws_client(), binary() | list(), delete_stream_group_input(), proplists:proplist()) -> {ok, undefined, tuple()} | {error, any()} | {error, delete_stream_group_errors(), tuple()}. delete_stream_group(Client, Identifier, Input0, Options0) -> Method = delete, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), ""], SuccessStatusCode = 204, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc When you disassociate, or unlink, an application from a stream group, %% you can no longer stream this application by using that stream group's %% allocated compute resources. %% %% Any streams in process will continue until they terminate, which helps %% avoid interrupting an end-user's stream. Amazon GameLift Streams will %% not initiate new streams in the stream group using the disassociated %% application. The disassociate action does not affect the stream capacity %% of a stream group. To disassociate an application, the stream group must %% be in `ACTIVE' status. %% %% If you disassociate the default application, Amazon GameLift Streams will %% automatically choose a new default application from the remaining %% associated applications. To change which application is the default %% application, call UpdateStreamGroup: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_UpdateStreamGroup.html %% and specify a new `DefaultApplicationIdentifier'. -spec disassociate_applications(aws_client:aws_client(), binary() | list(), disassociate_applications_input()) -> {ok, disassociate_applications_output(), tuple()} | {error, any()} | {error, disassociate_applications_errors(), tuple()}. disassociate_applications(Client, Identifier, Input) -> disassociate_applications(Client, Identifier, Input, []). -spec disassociate_applications(aws_client:aws_client(), binary() | list(), disassociate_applications_input(), proplists:proplist()) -> {ok, disassociate_applications_output(), tuple()} | {error, any()} | {error, disassociate_applications_errors(), tuple()}. disassociate_applications(Client, Identifier, Input0, Options0) -> Method = post, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/disassociations"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Export the files that your application modifies or generates in a %% stream session, which can help you debug or verify your application. %% %% When your application runs, it generates output files such as logs, %% diagnostic information, crash dumps, save files, user data, screenshots, %% and so on. The files can be defined by the engine or frameworks that your %% application uses, or information that you've programmed your %% application to output. %% %% You can only call this action on a stream session that is in progress, %% specifically in one of the following statuses `ACTIVE', %% `CONNECTED', `PENDING_CLIENT_RECONNECTION', and %% `RECONNECTING'. You must provide an Amazon Simple Storage Service %% (Amazon S3) bucket to store the files in. When the session ends, Amazon %% GameLift Streams produces a compressed folder that contains all of the %% files and directories that were modified or created by the application %% during the stream session. AWS uses your security credentials to %% authenticate and authorize access to your Amazon S3 bucket. %% %% Amazon GameLift Streams collects the following generated and modified %% files. Find them in the corresponding folders in the `.zip' archive. %% %% `application/': The folder where your application or game is stored. %% %% `profile/': The user profile folder. %% %% `temp/': The system temp folder. %% %% To verify the status of the exported files, use GetStreamSession. %% %% To delete the files, delete the object in the S3 bucket. -spec export_stream_session_files(aws_client:aws_client(), binary() | list(), binary() | list(), export_stream_session_files_input()) -> {ok, export_stream_session_files_output(), tuple()} | {error, any()} | {error, export_stream_session_files_errors(), tuple()}. export_stream_session_files(Client, Identifier, StreamSessionIdentifier, Input) -> export_stream_session_files(Client, Identifier, StreamSessionIdentifier, Input, []). -spec export_stream_session_files(aws_client:aws_client(), binary() | list(), binary() | list(), export_stream_session_files_input(), proplists:proplist()) -> {ok, export_stream_session_files_output(), tuple()} | {error, any()} | {error, export_stream_session_files_errors(), tuple()}. export_stream_session_files(Client, Identifier, StreamSessionIdentifier, Input0, Options0) -> Method = put, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/streamsessions/", aws_util:encode_uri(StreamSessionIdentifier), "/exportfiles"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Retrieves properties for an Amazon GameLift Streams application %% resource. %% %% Specify the ID of the application that you want to retrieve. If the %% operation is successful, it returns properties for the requested %% application. -spec get_application(aws_client:aws_client(), binary() | list()) -> {ok, get_application_output(), tuple()} | {error, any()} | {error, get_application_errors(), tuple()}. get_application(Client, Identifier) when is_map(Client) -> get_application(Client, Identifier, #{}, #{}). -spec get_application(aws_client:aws_client(), binary() | list(), map(), map()) -> {ok, get_application_output(), tuple()} | {error, any()} | {error, get_application_errors(), tuple()}. get_application(Client, Identifier, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_application(Client, Identifier, QueryMap, HeadersMap, []). -spec get_application(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> {ok, get_application_output(), tuple()} | {error, any()} | {error, get_application_errors(), tuple()}. get_application(Client, Identifier, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/applications/", aws_util:encode_uri(Identifier), ""], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary} | Options2], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves properties for a Amazon GameLift Streams stream group %% resource. %% %% Specify the ID of the stream group that you want to retrieve. If the %% operation is successful, it returns properties for the requested stream %% group. -spec get_stream_group(aws_client:aws_client(), binary() | list()) -> {ok, get_stream_group_output(), tuple()} | {error, any()} | {error, get_stream_group_errors(), tuple()}. get_stream_group(Client, Identifier) when is_map(Client) -> get_stream_group(Client, Identifier, #{}, #{}). -spec get_stream_group(aws_client:aws_client(), binary() | list(), map(), map()) -> {ok, get_stream_group_output(), tuple()} | {error, any()} | {error, get_stream_group_errors(), tuple()}. get_stream_group(Client, Identifier, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_stream_group(Client, Identifier, QueryMap, HeadersMap, []). -spec get_stream_group(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> {ok, get_stream_group_output(), tuple()} | {error, any()} | {error, get_stream_group_errors(), tuple()}. get_stream_group(Client, Identifier, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/streamgroups/", aws_util:encode_uri(Identifier), ""], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary} | Options2], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves properties for a Amazon GameLift Streams stream session %% resource. %% %% Specify the Amazon Resource Name (ARN) of the stream session that you want %% to retrieve and its stream group ARN. If the operation is successful, it %% returns properties for the requested resource. -spec get_stream_session(aws_client:aws_client(), binary() | list(), binary() | list()) -> {ok, get_stream_session_output(), tuple()} | {error, any()} | {error, get_stream_session_errors(), tuple()}. get_stream_session(Client, Identifier, StreamSessionIdentifier) when is_map(Client) -> get_stream_session(Client, Identifier, StreamSessionIdentifier, #{}, #{}). -spec get_stream_session(aws_client:aws_client(), binary() | list(), binary() | list(), map(), map()) -> {ok, get_stream_session_output(), tuple()} | {error, any()} | {error, get_stream_session_errors(), tuple()}. get_stream_session(Client, Identifier, StreamSessionIdentifier, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> get_stream_session(Client, Identifier, StreamSessionIdentifier, QueryMap, HeadersMap, []). -spec get_stream_session(aws_client:aws_client(), binary() | list(), binary() | list(), map(), map(), proplists:proplist()) -> {ok, get_stream_session_output(), tuple()} | {error, any()} | {error, get_stream_session_errors(), tuple()}. get_stream_session(Client, Identifier, StreamSessionIdentifier, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/streamsessions/", aws_util:encode_uri(StreamSessionIdentifier), ""], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary} | Options2], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves a list of all Amazon GameLift Streams applications that are %% associated with the Amazon Web Services account in use. %% %% This operation returns applications in all statuses, in no particular %% order. You can paginate the results as needed. -spec list_applications(aws_client:aws_client()) -> {ok, list_applications_output(), tuple()} | {error, any()} | {error, list_applications_errors(), tuple()}. list_applications(Client) when is_map(Client) -> list_applications(Client, #{}, #{}). -spec list_applications(aws_client:aws_client(), map(), map()) -> {ok, list_applications_output(), tuple()} | {error, any()} | {error, list_applications_errors(), tuple()}. list_applications(Client, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_applications(Client, QueryMap, HeadersMap, []). -spec list_applications(aws_client:aws_client(), map(), map(), proplists:proplist()) -> {ok, list_applications_output(), tuple()} | {error, any()} | {error, list_applications_errors(), tuple()}. list_applications(Client, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/applications"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary} | Options2], Headers = [], Query0_ = [ {<<"MaxResults">>, maps:get(<<"MaxResults">>, QueryMap, undefined)}, {<<"NextToken">>, maps:get(<<"NextToken">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves a list of all Amazon GameLift Streams stream groups that %% are associated with the Amazon Web Services account in use. %% %% This operation returns stream groups in all statuses, in no particular %% order. You can paginate the results as needed. -spec list_stream_groups(aws_client:aws_client()) -> {ok, list_stream_groups_output(), tuple()} | {error, any()} | {error, list_stream_groups_errors(), tuple()}. list_stream_groups(Client) when is_map(Client) -> list_stream_groups(Client, #{}, #{}). -spec list_stream_groups(aws_client:aws_client(), map(), map()) -> {ok, list_stream_groups_output(), tuple()} | {error, any()} | {error, list_stream_groups_errors(), tuple()}. list_stream_groups(Client, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_stream_groups(Client, QueryMap, HeadersMap, []). -spec list_stream_groups(aws_client:aws_client(), map(), map(), proplists:proplist()) -> {ok, list_stream_groups_output(), tuple()} | {error, any()} | {error, list_stream_groups_errors(), tuple()}. list_stream_groups(Client, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/streamgroups"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary} | Options2], Headers = [], Query0_ = [ {<<"MaxResults">>, maps:get(<<"MaxResults">>, QueryMap, undefined)}, {<<"NextToken">>, maps:get(<<"NextToken">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves a list of Amazon GameLift Streams stream sessions that a %% stream group is hosting. %% %% To retrieve stream sessions, specify the stream group, and optionally %% filter by stream session status. You can paginate the results as needed. %% %% This operation returns the requested stream sessions in no particular %% order. -spec list_stream_sessions(aws_client:aws_client(), binary() | list()) -> {ok, list_stream_sessions_output(), tuple()} | {error, any()} | {error, list_stream_sessions_errors(), tuple()}. list_stream_sessions(Client, Identifier) when is_map(Client) -> list_stream_sessions(Client, Identifier, #{}, #{}). -spec list_stream_sessions(aws_client:aws_client(), binary() | list(), map(), map()) -> {ok, list_stream_sessions_output(), tuple()} | {error, any()} | {error, list_stream_sessions_errors(), tuple()}. list_stream_sessions(Client, Identifier, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_stream_sessions(Client, Identifier, QueryMap, HeadersMap, []). -spec list_stream_sessions(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> {ok, list_stream_sessions_output(), tuple()} | {error, any()} | {error, list_stream_sessions_errors(), tuple()}. list_stream_sessions(Client, Identifier, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/streamsessions"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary} | Options2], Headers = [], Query0_ = [ {<<"ExportFilesStatus">>, maps:get(<<"ExportFilesStatus">>, QueryMap, undefined)}, {<<"MaxResults">>, maps:get(<<"MaxResults">>, QueryMap, undefined)}, {<<"NextToken">>, maps:get(<<"NextToken">>, QueryMap, undefined)}, {<<"Status">>, maps:get(<<"Status">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves a list of Amazon GameLift Streams stream sessions that this %% user account has access to. %% %% In the returned list of stream sessions, the `ExportFilesMetadata' %% property only shows the `Status' value. To get the `OutpurUri' and %% `StatusReason' values, use GetStreamSession: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_GetStreamSession.html. %% %% We don't recommend using this operation to regularly check stream %% session statuses because it's costly. Instead, to check status updates %% for a specific stream session, use GetStreamSession: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_GetStreamSession.html. -spec list_stream_sessions_by_account(aws_client:aws_client()) -> {ok, list_stream_sessions_by_account_output(), tuple()} | {error, any()} | {error, list_stream_sessions_by_account_errors(), tuple()}. list_stream_sessions_by_account(Client) when is_map(Client) -> list_stream_sessions_by_account(Client, #{}, #{}). -spec list_stream_sessions_by_account(aws_client:aws_client(), map(), map()) -> {ok, list_stream_sessions_by_account_output(), tuple()} | {error, any()} | {error, list_stream_sessions_by_account_errors(), tuple()}. list_stream_sessions_by_account(Client, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_stream_sessions_by_account(Client, QueryMap, HeadersMap, []). -spec list_stream_sessions_by_account(aws_client:aws_client(), map(), map(), proplists:proplist()) -> {ok, list_stream_sessions_by_account_output(), tuple()} | {error, any()} | {error, list_stream_sessions_by_account_errors(), tuple()}. list_stream_sessions_by_account(Client, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/streamsessions"], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary} | Options2], Headers = [], Query0_ = [ {<<"ExportFilesStatus">>, maps:get(<<"ExportFilesStatus">>, QueryMap, undefined)}, {<<"MaxResults">>, maps:get(<<"MaxResults">>, QueryMap, undefined)}, {<<"NextToken">>, maps:get(<<"NextToken">>, QueryMap, undefined)}, {<<"Status">>, maps:get(<<"Status">>, QueryMap, undefined)} ], Query_ = [H || {_, V} = H <- Query0_, V =/= undefined], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Retrieves all tags assigned to a Amazon GameLift Streams resource. %% %% To list tags for a resource, specify the ARN value for the resource. %% %% Learn more %% %% Tagging Amazon Web Services Resources: %% https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html in the %% Amazon Web Services General Reference %% %% Amazon Web Services Tagging Strategies: %% http://aws.amazon.com/answers/account-management/aws-tagging-strategies/ -spec list_tags_for_resource(aws_client:aws_client(), binary() | list()) -> {ok, list_tags_for_resource_response(), tuple()} | {error, any()} | {error, list_tags_for_resource_errors(), tuple()}. list_tags_for_resource(Client, ResourceArn) when is_map(Client) -> list_tags_for_resource(Client, ResourceArn, #{}, #{}). -spec list_tags_for_resource(aws_client:aws_client(), binary() | list(), map(), map()) -> {ok, list_tags_for_resource_response(), tuple()} | {error, any()} | {error, list_tags_for_resource_errors(), tuple()}. list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap) when is_map(Client), is_map(QueryMap), is_map(HeadersMap) -> list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap, []). -spec list_tags_for_resource(aws_client:aws_client(), binary() | list(), map(), map(), proplists:proplist()) -> {ok, list_tags_for_resource_response(), tuple()} | {error, any()} | {error, list_tags_for_resource_errors(), tuple()}. list_tags_for_resource(Client, ResourceArn, QueryMap, HeadersMap, Options0) when is_map(Client), is_map(QueryMap), is_map(HeadersMap), is_list(Options0) -> Path = ["/tags/", aws_util:encode_uri(ResourceArn), ""], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary} | Options2], Headers = [], Query_ = [], request(Client, get, Path, Query_, Headers, undefined, Options, SuccessStatusCode). %% @doc Removes a set of remote locations from this stream group. %% %% To remove a location, the stream group must be in `ACTIVE' status. %% When you remove a location, Amazon GameLift Streams releases allocated %% compute resources in that location. Stream sessions can no longer start %% from removed locations in a stream group. Amazon GameLift Streams also %% deletes the content files of all associated applications that were in %% Amazon GameLift Streams's internal Amazon S3 bucket at this location. %% %% You cannot remove the Amazon Web Services Region location where you %% initially created this stream group, known as the primary location. %% However, you can set the stream capacity to zero to avoid incurring costs %% for allocated compute resources in that location. -spec remove_stream_group_locations(aws_client:aws_client(), binary() | list(), remove_stream_group_locations_input()) -> {ok, undefined, tuple()} | {error, any()} | {error, remove_stream_group_locations_errors(), tuple()}. remove_stream_group_locations(Client, Identifier, Input) -> remove_stream_group_locations(Client, Identifier, Input, []). -spec remove_stream_group_locations(aws_client:aws_client(), binary() | list(), remove_stream_group_locations_input(), proplists:proplist()) -> {ok, undefined, tuple()} | {error, any()} | {error, remove_stream_group_locations_errors(), tuple()}. remove_stream_group_locations(Client, Identifier, Input0, Options0) -> Method = delete, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/locations"], SuccessStatusCode = 204, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, QueryMapping = [ {<<"locations">>, <<"Locations">>} ], {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc This action initiates a new stream session and outputs connection %% information that clients can use to access the stream. %% %% A stream session refers to an instance of a stream that Amazon GameLift %% Streams transmits from the server to the end-user. A stream session runs %% on a compute resource that a stream group has allocated. The start stream %% session process works as follows: %% %% Prerequisites: %% %% You must have a stream group in `ACTIVE' status %% %% You must have idle or on-demand capacity in a stream group in the location %% you want to stream from %% %% You must have at least one application associated to the stream group (use %% AssociateApplications: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_AssociateApplications.html %% if needed) %% %% Start stream request: %% %% Your backend server calls StartStreamSession to initiate connection %% %% Amazon GameLift Streams creates the stream session resource, assigns an %% Amazon Resource Name (ARN) value, and begins searching for available %% stream capacity to run the stream %% %% Session transitions to `ACTIVATING' status %% %% Placement completion: %% %% If Amazon GameLift Streams is successful in finding capacity for the %% stream, the stream session status changes to `ACTIVE' status and %% StartStreamSession returns stream connection information %% %% If Amazon GameLift Streams was not successful in finding capacity within %% the placement timeout period (defined according to the capacity type and %% platform type), the stream session status changes to `ERROR' status %% and StartStreamSession returns a `StatusReason' of %% `placementTimeout' %% %% Connection completion: %% %% Provide the new connection information to the requesting client %% %% Client must establish connection within `ConnectionTimeoutSeconds' %% (specified in StartStreamSession parameters) %% %% Session terminates automatically if client fails to connect in time %% %% For more information about the stream session lifecycle, see Stream %% sessions: %% https://docs.aws.amazon.com/gameliftstreams/latest/developerguide/stream-sessions.html %% in the Amazon GameLift Streams Developer Guide. %% %% Timeouts to be aware of that affect a stream session: %% %% Placement timeout: The amount of time that Amazon GameLift Streams has to %% find capacity for a stream request. Placement timeout varies based on the %% capacity type used to fulfill your stream request: %% %% Always-on capacity: 75 seconds %% %% On-demand capacity: %% %% Linux/Proton runtimes: 90 seconds %% %% Windows runtime: 10 minutes %% %% Connection timeout: The amount of time that Amazon GameLift Streams waits %% for a client to connect to a stream session in `ACTIVE' status, or %% reconnect to a stream session in `PENDING_CLIENT_RECONNECTION' status, %% the latter of which occurs when a client disconnects or loses connection %% from a stream session. If no client connects before the timeout, Amazon %% GameLift Streams terminates the stream session. This value is specified by %% `ConnectionTimeoutSeconds' in the `StartStreamSession' parameters. %% %% Maximum session length: A stream session will be terminated after this %% amount of time has elapsed since it started, regardless of any existing %% client connections. This value is specified by `SessionLengthSeconds' %% in the `StartStreamSession' parameters. %% %% To start a new stream session, specify a stream group ID and application %% ID, along with the transport protocol and signal request to use with the %% stream session. %% %% For stream groups that have multiple locations, provide a set of locations %% ordered by priority using a `Locations' parameter. Amazon GameLift %% Streams will start a single stream session in the next available location. %% An application must be finished replicating to a remote location before %% the remote location can host a stream. %% %% To reconnect to a stream session after a client disconnects or loses %% connection, use CreateStreamSessionConnection: %% https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_CreateStreamSessionConnection.html. -spec start_stream_session(aws_client:aws_client(), binary() | list(), start_stream_session_input()) -> {ok, start_stream_session_output(), tuple()} | {error, any()} | {error, start_stream_session_errors(), tuple()}. start_stream_session(Client, Identifier, Input) -> start_stream_session(Client, Identifier, Input, []). -spec start_stream_session(aws_client:aws_client(), binary() | list(), start_stream_session_input(), proplists:proplist()) -> {ok, start_stream_session_output(), tuple()} | {error, any()} | {error, start_stream_session_errors(), tuple()}. start_stream_session(Client, Identifier, Input0, Options0) -> Method = post, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/streamsessions"], SuccessStatusCode = 201, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Assigns one or more tags to a Amazon GameLift Streams resource. %% %% Use tags to organize Amazon Web Services resources for a range of %% purposes. You can assign tags to the following Amazon GameLift Streams %% resource types: %% %% Application %% %% StreamGroup %% %% Learn more %% %% Tagging Amazon Web Services Resources: %% https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html in the %% Amazon Web Services General Reference %% %% Amazon Web Services Tagging Strategies: %% http://aws.amazon.com/answers/account-management/aws-tagging-strategies/ -spec tag_resource(aws_client:aws_client(), binary() | list(), tag_resource_request()) -> {ok, tag_resource_response(), tuple()} | {error, any()} | {error, tag_resource_errors(), tuple()}. tag_resource(Client, ResourceArn, Input) -> tag_resource(Client, ResourceArn, Input, []). -spec tag_resource(aws_client:aws_client(), binary() | list(), tag_resource_request(), proplists:proplist()) -> {ok, tag_resource_response(), tuple()} | {error, any()} | {error, tag_resource_errors(), tuple()}. tag_resource(Client, ResourceArn, Input0, Options0) -> Method = post, Path = ["/tags/", aws_util:encode_uri(ResourceArn), ""], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Permanently terminates an active stream session. %% %% When called, the stream session status changes to `TERMINATING'. You %% can terminate a stream session in any status except `ACTIVATING'. If %% the stream session is in `ACTIVATING' status, an exception is thrown. -spec terminate_stream_session(aws_client:aws_client(), binary() | list(), binary() | list(), terminate_stream_session_input()) -> {ok, undefined, tuple()} | {error, any()} | {error, terminate_stream_session_errors(), tuple()}. terminate_stream_session(Client, Identifier, StreamSessionIdentifier, Input) -> terminate_stream_session(Client, Identifier, StreamSessionIdentifier, Input, []). -spec terminate_stream_session(aws_client:aws_client(), binary() | list(), binary() | list(), terminate_stream_session_input(), proplists:proplist()) -> {ok, undefined, tuple()} | {error, any()} | {error, terminate_stream_session_errors(), tuple()}. terminate_stream_session(Client, Identifier, StreamSessionIdentifier, Input0, Options0) -> Method = delete, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), "/streamsessions/", aws_util:encode_uri(StreamSessionIdentifier), ""], SuccessStatusCode = 204, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Removes one or more tags from a Amazon GameLift Streams resource. %% %% To remove tags, specify the Amazon GameLift Streams resource and a list of %% one or more tags to remove. -spec untag_resource(aws_client:aws_client(), binary() | list(), untag_resource_request()) -> {ok, untag_resource_response(), tuple()} | {error, any()} | {error, untag_resource_errors(), tuple()}. untag_resource(Client, ResourceArn, Input) -> untag_resource(Client, ResourceArn, Input, []). -spec untag_resource(aws_client:aws_client(), binary() | list(), untag_resource_request(), proplists:proplist()) -> {ok, untag_resource_response(), tuple()} | {error, any()} | {error, untag_resource_errors(), tuple()}. untag_resource(Client, ResourceArn, Input0, Options0) -> Method = delete, Path = ["/tags/", aws_util:encode_uri(ResourceArn), ""], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, QueryMapping = [ {<<"tagKeys">>, <<"TagKeys">>} ], {Query_, Input} = aws_request:build_headers(QueryMapping, Input2), request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Updates the mutable configuration settings for a Amazon GameLift %% Streams application resource. %% %% You can change the `Description', `ApplicationLogOutputUri', and %% `ApplicationLogPaths'. %% %% To update application settings, specify the application ID and provide the %% new values. If the operation is successful, it returns the complete %% updated set of settings for the application. -spec update_application(aws_client:aws_client(), binary() | list(), update_application_input()) -> {ok, update_application_output(), tuple()} | {error, any()} | {error, update_application_errors(), tuple()}. update_application(Client, Identifier, Input) -> update_application(Client, Identifier, Input, []). -spec update_application(aws_client:aws_client(), binary() | list(), update_application_input(), proplists:proplist()) -> {ok, update_application_output(), tuple()} | {error, any()} | {error, update_application_errors(), tuple()}. update_application(Client, Identifier, Input0, Options0) -> Method = patch, Path = ["/applications/", aws_util:encode_uri(Identifier), ""], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %% @doc Updates the configuration settings for an Amazon GameLift Streams %% stream group resource. %% %% To update a stream group, it must be in `ACTIVE' status. You can %% change the description, the set of locations, and the requested capacity %% of a stream group per location. If you want to change the stream class, %% create a new stream group. %% %% Stream capacity represents the number of concurrent streams that can be %% active at a time. You set stream capacity per location, per stream group. %% The following capacity settings are available: %% %% Always-on capacity: This setting, if non-zero, indicates minimum streaming %% capacity which is allocated to you and is never released back to the %% service. You pay for this base level of capacity at all times, whether %% used or idle. %% %% Maximum capacity: This indicates the maximum capacity that the service can %% allocate for you. Newly created streams may take a few minutes to start. %% Capacity is released back to the service when idle. You pay for capacity %% that is allocated to you until it is released. %% %% Target-idle capacity: This indicates idle capacity which the service %% pre-allocates and holds for you in anticipation of future activity. This %% helps to insulate your users from capacity-allocation delays. You pay for %% capacity which is held in this intentional idle state. %% %% Values for capacity must be whole number multiples of the tenancy value of %% the stream group's stream class. %% %% To update a stream group, specify the stream group's Amazon Resource %% Name (ARN) and provide the new values. If the request is successful, %% Amazon GameLift Streams returns the complete updated metadata for the %% stream group. Expired stream groups cannot be updated. -spec update_stream_group(aws_client:aws_client(), binary() | list(), update_stream_group_input()) -> {ok, update_stream_group_output(), tuple()} | {error, any()} | {error, update_stream_group_errors(), tuple()}. update_stream_group(Client, Identifier, Input) -> update_stream_group(Client, Identifier, Input, []). -spec update_stream_group(aws_client:aws_client(), binary() | list(), update_stream_group_input(), proplists:proplist()) -> {ok, update_stream_group_output(), tuple()} | {error, any()} | {error, update_stream_group_errors(), tuple()}. update_stream_group(Client, Identifier, Input0, Options0) -> Method = patch, Path = ["/streamgroups/", aws_util:encode_uri(Identifier), ""], SuccessStatusCode = 200, {SendBodyAsBinary, Options1} = proplists_take(send_body_as_binary, Options0, false), {ReceiveBodyAsBinary, Options2} = proplists_take(receive_body_as_binary, Options1, false), Options = [{send_body_as_binary, SendBodyAsBinary}, {receive_body_as_binary, ReceiveBodyAsBinary}, {append_sha256_content_hash, false} | Options2], Headers = [], Input1 = Input0, CustomHeaders = [], Input2 = Input1, Query_ = [], Input = Input2, request(Client, Method, Path, Query_, CustomHeaders ++ Headers, Input, Options, SuccessStatusCode). %%==================================================================== %% Internal functions %%==================================================================== -spec proplists_take(any(), proplists:proplist(), any()) -> {any(), proplists:proplist()}. proplists_take(Key, Proplist, Default) -> Value = proplists:get_value(Key, Proplist, Default), {Value, proplists:delete(Key, Proplist)}. -spec request(aws_client:aws_client(), atom(), iolist(), list(), list(), map() | undefined, list(), pos_integer() | undefined) -> {ok, {integer(), list()}} | {ok, Result, {integer(), list(), hackney:client()}} | {error, Error, {integer(), list(), hackney:client()}} | {error, term()} when Result :: map(), Error :: map(). request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusCode) -> RequestFun = fun() -> do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusCode) end, aws_request:request(RequestFun, Options). do_request(Client, Method, Path, Query, Headers0, Input, Options, SuccessStatusCode) -> Client1 = Client#{service => <<"gameliftstreams">>}, DefaultHost = build_host(<<"gameliftstreams">>, Client1), URL0 = build_url(DefaultHost, Path, Client1), PathBin = erlang:iolist_to_binary(Path), {URL1, Host} = aws_util:apply_endpoint_url_override(URL0, DefaultHost, PathBin, <<"AWS_ENDPOINT_URL_GAMELIFTSTREAMS">>), URL = aws_request:add_query(URL1, Query), AdditionalHeaders1 = [ {<<"Host">>, Host} , {<<"Content-Type">>, <<"application/x-amz-json-1.1">>} ], Payload = case proplists:get_value(send_body_as_binary, Options) of true when is_list(Input) -> proplists:get_value(<<"Body">>, Input, <<"">>); true when Input =:= undefined -> <<"">>; true -> maps:get(<<"Body">>, Input, <<"">>); false -> encode_payload(Input) end, AdditionalHeaders = case proplists:get_value(append_sha256_content_hash, Options, false) of true -> add_checksum_hash_header(AdditionalHeaders1, Payload); false -> AdditionalHeaders1 end, Headers1 = aws_request:add_headers(AdditionalHeaders, Headers0), MethodBin = aws_request:method_to_binary(Method), SignedHeaders = aws_request:sign_request(Client1, MethodBin, URL, Headers1, Payload), Response = hackney:request(Method, URL, SignedHeaders, Payload, Options), DecodeBody = not proplists:get_value(receive_body_as_binary, Options), handle_response(Response, SuccessStatusCode, DecodeBody). add_checksum_hash_header(Headers, Body) -> [ {<<"X-Amz-CheckSum-SHA256">>, base64:encode(crypto:hash(sha256, Body))} | Headers ]. handle_response({ok, StatusCode, ResponseHeaders}, SuccessStatusCode, _DecodeBody) when StatusCode =:= 200; StatusCode =:= 202; StatusCode =:= 204; StatusCode =:= 206; StatusCode =:= SuccessStatusCode -> {ok, {StatusCode, ResponseHeaders}}; handle_response({ok, StatusCode, ResponseHeaders}, _, _DecodeBody) -> {error, {StatusCode, ResponseHeaders}}; handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, DecodeBody) when StatusCode =:= 200; StatusCode =:= 202; StatusCode =:= 204; StatusCode =:= 206; StatusCode =:= SuccessStatusCode -> case hackney:body(Client) of {ok, <<>>} when StatusCode =:= 200; StatusCode =:= SuccessStatusCode -> {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of true -> try jsx:decode(Body) catch Error:Reason:Stack -> erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} end; handle_response({ok, StatusCode, _ResponseHeaders, _Client}, _, _DecodeBody) when StatusCode =:= 503 -> %% Retriable error if retries are enabled {error, service_unavailable}; handle_response({ok, StatusCode, ResponseHeaders, Client}, _, _DecodeBody) -> {ok, Body} = hackney:body(Client), try DecodedError = jsx:decode(Body), {error, DecodedError, {StatusCode, ResponseHeaders, Client}} catch Error:Reason:Stack -> erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) end; handle_response({error, Reason}, _, _DecodeBody) -> {error, Reason}. build_host(_EndpointPrefix, #{region := <<"local">>, endpoint := Endpoint}) -> Endpoint; build_host(_EndpointPrefix, #{region := <<"local">>}) -> <<"localhost">>; build_host(EndpointPrefix, #{region := Region, endpoint := Endpoint}) -> aws_util:binary_join([EndpointPrefix, Region, Endpoint], <<".">>). build_url(Host, Path0, Client) -> Proto = aws_client:proto(Client), Path = erlang:iolist_to_binary(Path0), Port = aws_client:port(Client), aws_util:binary_join([Proto, <<"://">>, Host, <<":">>, Port, Path], <<"">>). -spec encode_payload(undefined | map()) -> binary(). encode_payload(undefined) -> <<>>; encode_payload(Input) -> jsx:encode(Input).