aws-sdk-tnb 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,134 @@
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::Tnb
11
+
12
+ # When Tnb returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::Tnb::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all Tnb errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::Tnb::Errors::ServiceError
20
+ # # rescues all Tnb 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
+ # * {InternalServerException}
32
+ # * {ResourceNotFoundException}
33
+ # * {ServiceQuotaExceededException}
34
+ # * {ThrottlingException}
35
+ # * {ValidationException}
36
+ #
37
+ # Additionally, error classes are dynamically generated for service errors based on the error code
38
+ # if they are not defined above.
39
+ module Errors
40
+
41
+ extend Aws::Errors::DynamicErrors
42
+
43
+ class AccessDeniedException < ServiceError
44
+
45
+ # @param [Seahorse::Client::RequestContext] context
46
+ # @param [String] message
47
+ # @param [Aws::Tnb::Types::AccessDeniedException] data
48
+ def initialize(context, message, data = Aws::EmptyStructure.new)
49
+ super(context, message, data)
50
+ end
51
+
52
+ # @return [String]
53
+ def message
54
+ @message || @data[:message]
55
+ end
56
+ end
57
+
58
+ class InternalServerException < ServiceError
59
+
60
+ # @param [Seahorse::Client::RequestContext] context
61
+ # @param [String] message
62
+ # @param [Aws::Tnb::Types::InternalServerException] data
63
+ def initialize(context, message, data = Aws::EmptyStructure.new)
64
+ super(context, message, data)
65
+ end
66
+
67
+ # @return [String]
68
+ def message
69
+ @message || @data[:message]
70
+ end
71
+ end
72
+
73
+ class ResourceNotFoundException < ServiceError
74
+
75
+ # @param [Seahorse::Client::RequestContext] context
76
+ # @param [String] message
77
+ # @param [Aws::Tnb::Types::ResourceNotFoundException] data
78
+ def initialize(context, message, data = Aws::EmptyStructure.new)
79
+ super(context, message, data)
80
+ end
81
+
82
+ # @return [String]
83
+ def message
84
+ @message || @data[:message]
85
+ end
86
+ end
87
+
88
+ class ServiceQuotaExceededException < ServiceError
89
+
90
+ # @param [Seahorse::Client::RequestContext] context
91
+ # @param [String] message
92
+ # @param [Aws::Tnb::Types::ServiceQuotaExceededException] data
93
+ def initialize(context, message, data = Aws::EmptyStructure.new)
94
+ super(context, message, data)
95
+ end
96
+
97
+ # @return [String]
98
+ def message
99
+ @message || @data[:message]
100
+ end
101
+ end
102
+
103
+ class ThrottlingException < ServiceError
104
+
105
+ # @param [Seahorse::Client::RequestContext] context
106
+ # @param [String] message
107
+ # @param [Aws::Tnb::Types::ThrottlingException] data
108
+ def initialize(context, message, data = Aws::EmptyStructure.new)
109
+ super(context, message, data)
110
+ end
111
+
112
+ # @return [String]
113
+ def message
114
+ @message || @data[:message]
115
+ end
116
+ end
117
+
118
+ class ValidationException < ServiceError
119
+
120
+ # @param [Seahorse::Client::RequestContext] context
121
+ # @param [String] message
122
+ # @param [Aws::Tnb::Types::ValidationException] data
123
+ def initialize(context, message, data = Aws::EmptyStructure.new)
124
+ super(context, message, data)
125
+ end
126
+
127
+ # @return [String]
128
+ def message
129
+ @message || @data[:message]
130
+ end
131
+ end
132
+
133
+ end
134
+ end
@@ -0,0 +1,134 @@
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::Tnb
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Tnb::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::Tnb::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Tnb::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 :cancel_sol_network_operation
60
+ Aws::Tnb::Endpoints::CancelSolNetworkOperation.build(context)
61
+ when :create_sol_function_package
62
+ Aws::Tnb::Endpoints::CreateSolFunctionPackage.build(context)
63
+ when :create_sol_network_instance
64
+ Aws::Tnb::Endpoints::CreateSolNetworkInstance.build(context)
65
+ when :create_sol_network_package
66
+ Aws::Tnb::Endpoints::CreateSolNetworkPackage.build(context)
67
+ when :delete_sol_function_package
68
+ Aws::Tnb::Endpoints::DeleteSolFunctionPackage.build(context)
69
+ when :delete_sol_network_instance
70
+ Aws::Tnb::Endpoints::DeleteSolNetworkInstance.build(context)
71
+ when :delete_sol_network_package
72
+ Aws::Tnb::Endpoints::DeleteSolNetworkPackage.build(context)
73
+ when :get_sol_function_instance
74
+ Aws::Tnb::Endpoints::GetSolFunctionInstance.build(context)
75
+ when :get_sol_function_package
76
+ Aws::Tnb::Endpoints::GetSolFunctionPackage.build(context)
77
+ when :get_sol_function_package_content
78
+ Aws::Tnb::Endpoints::GetSolFunctionPackageContent.build(context)
79
+ when :get_sol_function_package_descriptor
80
+ Aws::Tnb::Endpoints::GetSolFunctionPackageDescriptor.build(context)
81
+ when :get_sol_network_instance
82
+ Aws::Tnb::Endpoints::GetSolNetworkInstance.build(context)
83
+ when :get_sol_network_operation
84
+ Aws::Tnb::Endpoints::GetSolNetworkOperation.build(context)
85
+ when :get_sol_network_package
86
+ Aws::Tnb::Endpoints::GetSolNetworkPackage.build(context)
87
+ when :get_sol_network_package_content
88
+ Aws::Tnb::Endpoints::GetSolNetworkPackageContent.build(context)
89
+ when :get_sol_network_package_descriptor
90
+ Aws::Tnb::Endpoints::GetSolNetworkPackageDescriptor.build(context)
91
+ when :instantiate_sol_network_instance
92
+ Aws::Tnb::Endpoints::InstantiateSolNetworkInstance.build(context)
93
+ when :list_sol_function_instances
94
+ Aws::Tnb::Endpoints::ListSolFunctionInstances.build(context)
95
+ when :list_sol_function_packages
96
+ Aws::Tnb::Endpoints::ListSolFunctionPackages.build(context)
97
+ when :list_sol_network_instances
98
+ Aws::Tnb::Endpoints::ListSolNetworkInstances.build(context)
99
+ when :list_sol_network_operations
100
+ Aws::Tnb::Endpoints::ListSolNetworkOperations.build(context)
101
+ when :list_sol_network_packages
102
+ Aws::Tnb::Endpoints::ListSolNetworkPackages.build(context)
103
+ when :list_tags_for_resource
104
+ Aws::Tnb::Endpoints::ListTagsForResource.build(context)
105
+ when :put_sol_function_package_content
106
+ Aws::Tnb::Endpoints::PutSolFunctionPackageContent.build(context)
107
+ when :put_sol_network_package_content
108
+ Aws::Tnb::Endpoints::PutSolNetworkPackageContent.build(context)
109
+ when :tag_resource
110
+ Aws::Tnb::Endpoints::TagResource.build(context)
111
+ when :terminate_sol_network_instance
112
+ Aws::Tnb::Endpoints::TerminateSolNetworkInstance.build(context)
113
+ when :untag_resource
114
+ Aws::Tnb::Endpoints::UntagResource.build(context)
115
+ when :update_sol_function_package
116
+ Aws::Tnb::Endpoints::UpdateSolFunctionPackage.build(context)
117
+ when :update_sol_network_instance
118
+ Aws::Tnb::Endpoints::UpdateSolNetworkInstance.build(context)
119
+ when :update_sol_network_package
120
+ Aws::Tnb::Endpoints::UpdateSolNetworkPackage.build(context)
121
+ when :validate_sol_function_package_content
122
+ Aws::Tnb::Endpoints::ValidateSolFunctionPackageContent.build(context)
123
+ when :validate_sol_network_package_content
124
+ Aws::Tnb::Endpoints::ValidateSolNetworkPackageContent.build(context)
125
+ end
126
+ end
127
+ end
128
+
129
+ def add_handlers(handlers, _config)
130
+ handlers.add(Handler, step: :build, priority: 75)
131
+ end
132
+ end
133
+ end
134
+ 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::Tnb
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