aws-sdk-ivsrealtime 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,150 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::IVSRealTime
11
+
12
+ # When IVSRealTime returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::IVSRealTime::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all IVSRealTime errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::IVSRealTime::Errors::ServiceError
20
+ # # rescues all IVSRealTime API errors
21
+ # end
22
+ #
23
+ #
24
+ # ## Request Context
25
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
26
+ # information about the request that generated the error.
27
+ # See {Seahorse::Client::RequestContext} for more information.
28
+ #
29
+ # ## Error Classes
30
+ # * {AccessDeniedException}
31
+ # * {ConflictException}
32
+ # * {InternalServerException}
33
+ # * {PendingVerification}
34
+ # * {ResourceNotFoundException}
35
+ # * {ServiceQuotaExceededException}
36
+ # * {ValidationException}
37
+ #
38
+ # Additionally, error classes are dynamically generated for service errors based on the error code
39
+ # if they are not defined above.
40
+ module Errors
41
+
42
+ extend Aws::Errors::DynamicErrors
43
+
44
+ class AccessDeniedException < ServiceError
45
+
46
+ # @param [Seahorse::Client::RequestContext] context
47
+ # @param [String] message
48
+ # @param [Aws::IVSRealTime::Types::AccessDeniedException] data
49
+ def initialize(context, message, data = Aws::EmptyStructure.new)
50
+ super(context, message, data)
51
+ end
52
+
53
+ # @return [String]
54
+ def exception_message
55
+ @data[:exception_message]
56
+ end
57
+ end
58
+
59
+ class ConflictException < ServiceError
60
+
61
+ # @param [Seahorse::Client::RequestContext] context
62
+ # @param [String] message
63
+ # @param [Aws::IVSRealTime::Types::ConflictException] data
64
+ def initialize(context, message, data = Aws::EmptyStructure.new)
65
+ super(context, message, data)
66
+ end
67
+
68
+ # @return [String]
69
+ def exception_message
70
+ @data[:exception_message]
71
+ end
72
+ end
73
+
74
+ class InternalServerException < ServiceError
75
+
76
+ # @param [Seahorse::Client::RequestContext] context
77
+ # @param [String] message
78
+ # @param [Aws::IVSRealTime::Types::InternalServerException] data
79
+ def initialize(context, message, data = Aws::EmptyStructure.new)
80
+ super(context, message, data)
81
+ end
82
+
83
+ # @return [String]
84
+ def exception_message
85
+ @data[:exception_message]
86
+ end
87
+ end
88
+
89
+ class PendingVerification < ServiceError
90
+
91
+ # @param [Seahorse::Client::RequestContext] context
92
+ # @param [String] message
93
+ # @param [Aws::IVSRealTime::Types::PendingVerification] data
94
+ def initialize(context, message, data = Aws::EmptyStructure.new)
95
+ super(context, message, data)
96
+ end
97
+
98
+ # @return [String]
99
+ def exception_message
100
+ @data[:exception_message]
101
+ end
102
+ end
103
+
104
+ class ResourceNotFoundException < ServiceError
105
+
106
+ # @param [Seahorse::Client::RequestContext] context
107
+ # @param [String] message
108
+ # @param [Aws::IVSRealTime::Types::ResourceNotFoundException] data
109
+ def initialize(context, message, data = Aws::EmptyStructure.new)
110
+ super(context, message, data)
111
+ end
112
+
113
+ # @return [String]
114
+ def exception_message
115
+ @data[:exception_message]
116
+ end
117
+ end
118
+
119
+ class ServiceQuotaExceededException < ServiceError
120
+
121
+ # @param [Seahorse::Client::RequestContext] context
122
+ # @param [String] message
123
+ # @param [Aws::IVSRealTime::Types::ServiceQuotaExceededException] data
124
+ def initialize(context, message, data = Aws::EmptyStructure.new)
125
+ super(context, message, data)
126
+ end
127
+
128
+ # @return [String]
129
+ def exception_message
130
+ @data[:exception_message]
131
+ end
132
+ end
133
+
134
+ class ValidationException < ServiceError
135
+
136
+ # @param [Seahorse::Client::RequestContext] context
137
+ # @param [String] message
138
+ # @param [Aws::IVSRealTime::Types::ValidationException] data
139
+ def initialize(context, message, data = Aws::EmptyStructure.new)
140
+ super(context, message, data)
141
+ end
142
+
143
+ # @return [String]
144
+ def exception_message
145
+ @data[:exception_message]
146
+ end
147
+ end
148
+
149
+ end
150
+ end
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::IVSRealTime
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::IVSRealTime::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::IVSRealTime::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::IVSRealTime::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
29
+ unless context[:discovered_endpoint]
30
+ params = parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :create_participant_token
60
+ Aws::IVSRealTime::Endpoints::CreateParticipantToken.build(context)
61
+ when :create_stage
62
+ Aws::IVSRealTime::Endpoints::CreateStage.build(context)
63
+ when :delete_stage
64
+ Aws::IVSRealTime::Endpoints::DeleteStage.build(context)
65
+ when :disconnect_participant
66
+ Aws::IVSRealTime::Endpoints::DisconnectParticipant.build(context)
67
+ when :get_stage
68
+ Aws::IVSRealTime::Endpoints::GetStage.build(context)
69
+ when :list_stages
70
+ Aws::IVSRealTime::Endpoints::ListStages.build(context)
71
+ when :list_tags_for_resource
72
+ Aws::IVSRealTime::Endpoints::ListTagsForResource.build(context)
73
+ when :tag_resource
74
+ Aws::IVSRealTime::Endpoints::TagResource.build(context)
75
+ when :untag_resource
76
+ Aws::IVSRealTime::Endpoints::UntagResource.build(context)
77
+ when :update_stage
78
+ Aws::IVSRealTime::Endpoints::UpdateStage.build(context)
79
+ end
80
+ end
81
+ end
82
+
83
+ def add_handlers(handlers, _config)
84
+ handlers.add(Handler, step: :build, priority: 75)
85
+ end
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::IVSRealTime
11
+
12
+ class Resource
13
+
14
+ # @param options ({})
15
+ # @option options [Client] :client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Client.new(options)
18
+ end
19
+
20
+ # @return [Client]
21
+ def client
22
+ @client
23
+ end
24
+
25
+ end
26
+ end