aws-sdk-neptunegraph 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,113 @@
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::NeptuneGraph
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::NeptuneGraph::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::NeptuneGraph::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::NeptuneGraph::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ unless context[:discovered_endpoint]
29
+ params = parameters_for_operation(context)
30
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
31
+
32
+ context.http_request.endpoint = endpoint.url
33
+ apply_endpoint_headers(context, endpoint.headers)
34
+
35
+ context[:endpoint_params] = params
36
+ context[:endpoint_properties] = endpoint.properties
37
+ end
38
+
39
+ context[:auth_scheme] =
40
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
41
+
42
+ @handler.call(context)
43
+ end
44
+
45
+ private
46
+
47
+ def apply_endpoint_headers(context, headers)
48
+ headers.each do |key, values|
49
+ value = values
50
+ .compact
51
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
52
+ .join(',')
53
+
54
+ context.http_request.headers[key] = value
55
+ end
56
+ end
57
+
58
+ def parameters_for_operation(context)
59
+ case context.operation_name
60
+ when :cancel_import_task
61
+ Aws::NeptuneGraph::Endpoints::CancelImportTask.build(context)
62
+ when :create_graph
63
+ Aws::NeptuneGraph::Endpoints::CreateGraph.build(context)
64
+ when :create_graph_snapshot
65
+ Aws::NeptuneGraph::Endpoints::CreateGraphSnapshot.build(context)
66
+ when :create_graph_using_import_task
67
+ Aws::NeptuneGraph::Endpoints::CreateGraphUsingImportTask.build(context)
68
+ when :create_private_graph_endpoint
69
+ Aws::NeptuneGraph::Endpoints::CreatePrivateGraphEndpoint.build(context)
70
+ when :delete_graph
71
+ Aws::NeptuneGraph::Endpoints::DeleteGraph.build(context)
72
+ when :delete_graph_snapshot
73
+ Aws::NeptuneGraph::Endpoints::DeleteGraphSnapshot.build(context)
74
+ when :delete_private_graph_endpoint
75
+ Aws::NeptuneGraph::Endpoints::DeletePrivateGraphEndpoint.build(context)
76
+ when :get_graph
77
+ Aws::NeptuneGraph::Endpoints::GetGraph.build(context)
78
+ when :get_graph_snapshot
79
+ Aws::NeptuneGraph::Endpoints::GetGraphSnapshot.build(context)
80
+ when :get_import_task
81
+ Aws::NeptuneGraph::Endpoints::GetImportTask.build(context)
82
+ when :get_private_graph_endpoint
83
+ Aws::NeptuneGraph::Endpoints::GetPrivateGraphEndpoint.build(context)
84
+ when :list_graph_snapshots
85
+ Aws::NeptuneGraph::Endpoints::ListGraphSnapshots.build(context)
86
+ when :list_graphs
87
+ Aws::NeptuneGraph::Endpoints::ListGraphs.build(context)
88
+ when :list_import_tasks
89
+ Aws::NeptuneGraph::Endpoints::ListImportTasks.build(context)
90
+ when :list_private_graph_endpoints
91
+ Aws::NeptuneGraph::Endpoints::ListPrivateGraphEndpoints.build(context)
92
+ when :list_tags_for_resource
93
+ Aws::NeptuneGraph::Endpoints::ListTagsForResource.build(context)
94
+ when :reset_graph
95
+ Aws::NeptuneGraph::Endpoints::ResetGraph.build(context)
96
+ when :restore_graph_from_snapshot
97
+ Aws::NeptuneGraph::Endpoints::RestoreGraphFromSnapshot.build(context)
98
+ when :tag_resource
99
+ Aws::NeptuneGraph::Endpoints::TagResource.build(context)
100
+ when :untag_resource
101
+ Aws::NeptuneGraph::Endpoints::UntagResource.build(context)
102
+ when :update_graph
103
+ Aws::NeptuneGraph::Endpoints::UpdateGraph.build(context)
104
+ end
105
+ end
106
+ end
107
+
108
+ def add_handlers(handlers, _config)
109
+ handlers.add(Handler, step: :build, priority: 75)
110
+ end
111
+ end
112
+ end
113
+ 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::NeptuneGraph
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