aws-sdk-devopsguru 1.26.0 → 1.28.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,130 @@
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::DevOpsGuru
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::DevOpsGuru::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::DevOpsGuru::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::DevOpsGuru::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 :add_notification_channel
60
+ Aws::DevOpsGuru::Endpoints::AddNotificationChannel.build(context)
61
+ when :delete_insight
62
+ Aws::DevOpsGuru::Endpoints::DeleteInsight.build(context)
63
+ when :describe_account_health
64
+ Aws::DevOpsGuru::Endpoints::DescribeAccountHealth.build(context)
65
+ when :describe_account_overview
66
+ Aws::DevOpsGuru::Endpoints::DescribeAccountOverview.build(context)
67
+ when :describe_anomaly
68
+ Aws::DevOpsGuru::Endpoints::DescribeAnomaly.build(context)
69
+ when :describe_event_sources_config
70
+ Aws::DevOpsGuru::Endpoints::DescribeEventSourcesConfig.build(context)
71
+ when :describe_feedback
72
+ Aws::DevOpsGuru::Endpoints::DescribeFeedback.build(context)
73
+ when :describe_insight
74
+ Aws::DevOpsGuru::Endpoints::DescribeInsight.build(context)
75
+ when :describe_organization_health
76
+ Aws::DevOpsGuru::Endpoints::DescribeOrganizationHealth.build(context)
77
+ when :describe_organization_overview
78
+ Aws::DevOpsGuru::Endpoints::DescribeOrganizationOverview.build(context)
79
+ when :describe_organization_resource_collection_health
80
+ Aws::DevOpsGuru::Endpoints::DescribeOrganizationResourceCollectionHealth.build(context)
81
+ when :describe_resource_collection_health
82
+ Aws::DevOpsGuru::Endpoints::DescribeResourceCollectionHealth.build(context)
83
+ when :describe_service_integration
84
+ Aws::DevOpsGuru::Endpoints::DescribeServiceIntegration.build(context)
85
+ when :get_cost_estimation
86
+ Aws::DevOpsGuru::Endpoints::GetCostEstimation.build(context)
87
+ when :get_resource_collection
88
+ Aws::DevOpsGuru::Endpoints::GetResourceCollection.build(context)
89
+ when :list_anomalies_for_insight
90
+ Aws::DevOpsGuru::Endpoints::ListAnomaliesForInsight.build(context)
91
+ when :list_anomalous_log_groups
92
+ Aws::DevOpsGuru::Endpoints::ListAnomalousLogGroups.build(context)
93
+ when :list_events
94
+ Aws::DevOpsGuru::Endpoints::ListEvents.build(context)
95
+ when :list_insights
96
+ Aws::DevOpsGuru::Endpoints::ListInsights.build(context)
97
+ when :list_monitored_resources
98
+ Aws::DevOpsGuru::Endpoints::ListMonitoredResources.build(context)
99
+ when :list_notification_channels
100
+ Aws::DevOpsGuru::Endpoints::ListNotificationChannels.build(context)
101
+ when :list_organization_insights
102
+ Aws::DevOpsGuru::Endpoints::ListOrganizationInsights.build(context)
103
+ when :list_recommendations
104
+ Aws::DevOpsGuru::Endpoints::ListRecommendations.build(context)
105
+ when :put_feedback
106
+ Aws::DevOpsGuru::Endpoints::PutFeedback.build(context)
107
+ when :remove_notification_channel
108
+ Aws::DevOpsGuru::Endpoints::RemoveNotificationChannel.build(context)
109
+ when :search_insights
110
+ Aws::DevOpsGuru::Endpoints::SearchInsights.build(context)
111
+ when :search_organization_insights
112
+ Aws::DevOpsGuru::Endpoints::SearchOrganizationInsights.build(context)
113
+ when :start_cost_estimation
114
+ Aws::DevOpsGuru::Endpoints::StartCostEstimation.build(context)
115
+ when :update_event_sources_config
116
+ Aws::DevOpsGuru::Endpoints::UpdateEventSourcesConfig.build(context)
117
+ when :update_resource_collection
118
+ Aws::DevOpsGuru::Endpoints::UpdateResourceCollection.build(context)
119
+ when :update_service_integration
120
+ Aws::DevOpsGuru::Endpoints::UpdateServiceIntegration.build(context)
121
+ end
122
+ end
123
+ end
124
+
125
+ def add_handlers(handlers, _config)
126
+ handlers.add(Handler, step: :build, priority: 75)
127
+ end
128
+ end
129
+ end
130
+ end