aws-sdk-apptest 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,118 @@
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::AppTest
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::AppTest::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
+ 'object that responds to `#resolve_endpoint(parameters)` '\
20
+ 'where `parameters` is a Struct similar to '\
21
+ '`Aws::AppTest::EndpointParameters`'
22
+ ) do |cfg|
23
+ Aws::AppTest::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
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
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ @handler.call(context)
44
+ end
45
+
46
+ private
47
+
48
+ def apply_endpoint_headers(context, headers)
49
+ headers.each do |key, values|
50
+ value = values
51
+ .compact
52
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
53
+ .join(',')
54
+
55
+ context.http_request.headers[key] = value
56
+ end
57
+ end
58
+
59
+ def parameters_for_operation(context)
60
+ case context.operation_name
61
+ when :create_test_case
62
+ Aws::AppTest::Endpoints::CreateTestCase.build(context)
63
+ when :create_test_configuration
64
+ Aws::AppTest::Endpoints::CreateTestConfiguration.build(context)
65
+ when :create_test_suite
66
+ Aws::AppTest::Endpoints::CreateTestSuite.build(context)
67
+ when :delete_test_case
68
+ Aws::AppTest::Endpoints::DeleteTestCase.build(context)
69
+ when :delete_test_configuration
70
+ Aws::AppTest::Endpoints::DeleteTestConfiguration.build(context)
71
+ when :delete_test_run
72
+ Aws::AppTest::Endpoints::DeleteTestRun.build(context)
73
+ when :delete_test_suite
74
+ Aws::AppTest::Endpoints::DeleteTestSuite.build(context)
75
+ when :get_test_case
76
+ Aws::AppTest::Endpoints::GetTestCase.build(context)
77
+ when :get_test_configuration
78
+ Aws::AppTest::Endpoints::GetTestConfiguration.build(context)
79
+ when :get_test_run_step
80
+ Aws::AppTest::Endpoints::GetTestRunStep.build(context)
81
+ when :get_test_suite
82
+ Aws::AppTest::Endpoints::GetTestSuite.build(context)
83
+ when :list_tags_for_resource
84
+ Aws::AppTest::Endpoints::ListTagsForResource.build(context)
85
+ when :list_test_cases
86
+ Aws::AppTest::Endpoints::ListTestCases.build(context)
87
+ when :list_test_configurations
88
+ Aws::AppTest::Endpoints::ListTestConfigurations.build(context)
89
+ when :list_test_run_steps
90
+ Aws::AppTest::Endpoints::ListTestRunSteps.build(context)
91
+ when :list_test_run_test_cases
92
+ Aws::AppTest::Endpoints::ListTestRunTestCases.build(context)
93
+ when :list_test_runs
94
+ Aws::AppTest::Endpoints::ListTestRuns.build(context)
95
+ when :list_test_suites
96
+ Aws::AppTest::Endpoints::ListTestSuites.build(context)
97
+ when :start_test_run
98
+ Aws::AppTest::Endpoints::StartTestRun.build(context)
99
+ when :tag_resource
100
+ Aws::AppTest::Endpoints::TagResource.build(context)
101
+ when :untag_resource
102
+ Aws::AppTest::Endpoints::UntagResource.build(context)
103
+ when :update_test_case
104
+ Aws::AppTest::Endpoints::UpdateTestCase.build(context)
105
+ when :update_test_configuration
106
+ Aws::AppTest::Endpoints::UpdateTestConfiguration.build(context)
107
+ when :update_test_suite
108
+ Aws::AppTest::Endpoints::UpdateTestSuite.build(context)
109
+ end
110
+ end
111
+ end
112
+
113
+ def add_handlers(handlers, _config)
114
+ handlers.add(Handler, step: :build, priority: 75)
115
+ end
116
+ end
117
+ end
118
+ 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::AppTest
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