aws-sdk-fsx 1.60.0 → 1.62.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,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
+
11
+ module Aws::FSx
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::FSx::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::FSx::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::FSx::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 :associate_file_system_aliases
60
+ Aws::FSx::Endpoints::AssociateFileSystemAliases.build(context)
61
+ when :cancel_data_repository_task
62
+ Aws::FSx::Endpoints::CancelDataRepositoryTask.build(context)
63
+ when :copy_backup
64
+ Aws::FSx::Endpoints::CopyBackup.build(context)
65
+ when :create_backup
66
+ Aws::FSx::Endpoints::CreateBackup.build(context)
67
+ when :create_data_repository_association
68
+ Aws::FSx::Endpoints::CreateDataRepositoryAssociation.build(context)
69
+ when :create_data_repository_task
70
+ Aws::FSx::Endpoints::CreateDataRepositoryTask.build(context)
71
+ when :create_file_cache
72
+ Aws::FSx::Endpoints::CreateFileCache.build(context)
73
+ when :create_file_system
74
+ Aws::FSx::Endpoints::CreateFileSystem.build(context)
75
+ when :create_file_system_from_backup
76
+ Aws::FSx::Endpoints::CreateFileSystemFromBackup.build(context)
77
+ when :create_snapshot
78
+ Aws::FSx::Endpoints::CreateSnapshot.build(context)
79
+ when :create_storage_virtual_machine
80
+ Aws::FSx::Endpoints::CreateStorageVirtualMachine.build(context)
81
+ when :create_volume
82
+ Aws::FSx::Endpoints::CreateVolume.build(context)
83
+ when :create_volume_from_backup
84
+ Aws::FSx::Endpoints::CreateVolumeFromBackup.build(context)
85
+ when :delete_backup
86
+ Aws::FSx::Endpoints::DeleteBackup.build(context)
87
+ when :delete_data_repository_association
88
+ Aws::FSx::Endpoints::DeleteDataRepositoryAssociation.build(context)
89
+ when :delete_file_cache
90
+ Aws::FSx::Endpoints::DeleteFileCache.build(context)
91
+ when :delete_file_system
92
+ Aws::FSx::Endpoints::DeleteFileSystem.build(context)
93
+ when :delete_snapshot
94
+ Aws::FSx::Endpoints::DeleteSnapshot.build(context)
95
+ when :delete_storage_virtual_machine
96
+ Aws::FSx::Endpoints::DeleteStorageVirtualMachine.build(context)
97
+ when :delete_volume
98
+ Aws::FSx::Endpoints::DeleteVolume.build(context)
99
+ when :describe_backups
100
+ Aws::FSx::Endpoints::DescribeBackups.build(context)
101
+ when :describe_data_repository_associations
102
+ Aws::FSx::Endpoints::DescribeDataRepositoryAssociations.build(context)
103
+ when :describe_data_repository_tasks
104
+ Aws::FSx::Endpoints::DescribeDataRepositoryTasks.build(context)
105
+ when :describe_file_caches
106
+ Aws::FSx::Endpoints::DescribeFileCaches.build(context)
107
+ when :describe_file_system_aliases
108
+ Aws::FSx::Endpoints::DescribeFileSystemAliases.build(context)
109
+ when :describe_file_systems
110
+ Aws::FSx::Endpoints::DescribeFileSystems.build(context)
111
+ when :describe_snapshots
112
+ Aws::FSx::Endpoints::DescribeSnapshots.build(context)
113
+ when :describe_storage_virtual_machines
114
+ Aws::FSx::Endpoints::DescribeStorageVirtualMachines.build(context)
115
+ when :describe_volumes
116
+ Aws::FSx::Endpoints::DescribeVolumes.build(context)
117
+ when :disassociate_file_system_aliases
118
+ Aws::FSx::Endpoints::DisassociateFileSystemAliases.build(context)
119
+ when :list_tags_for_resource
120
+ Aws::FSx::Endpoints::ListTagsForResource.build(context)
121
+ when :release_file_system_nfs_v3_locks
122
+ Aws::FSx::Endpoints::ReleaseFileSystemNfsV3Locks.build(context)
123
+ when :restore_volume_from_snapshot
124
+ Aws::FSx::Endpoints::RestoreVolumeFromSnapshot.build(context)
125
+ when :tag_resource
126
+ Aws::FSx::Endpoints::TagResource.build(context)
127
+ when :untag_resource
128
+ Aws::FSx::Endpoints::UntagResource.build(context)
129
+ when :update_data_repository_association
130
+ Aws::FSx::Endpoints::UpdateDataRepositoryAssociation.build(context)
131
+ when :update_file_cache
132
+ Aws::FSx::Endpoints::UpdateFileCache.build(context)
133
+ when :update_file_system
134
+ Aws::FSx::Endpoints::UpdateFileSystem.build(context)
135
+ when :update_snapshot
136
+ Aws::FSx::Endpoints::UpdateSnapshot.build(context)
137
+ when :update_storage_virtual_machine
138
+ Aws::FSx::Endpoints::UpdateStorageVirtualMachine.build(context)
139
+ when :update_volume
140
+ Aws::FSx::Endpoints::UpdateVolume.build(context)
141
+ end
142
+ end
143
+ end
144
+
145
+ def add_handlers(handlers, _config)
146
+ handlers.add(Handler, step: :build, priority: 75)
147
+ end
148
+ end
149
+ end
150
+ end