aws-sdk-codecatalyst 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,116 @@
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::CodeCatalyst
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::CodeCatalyst::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::CodeCatalyst::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::CodeCatalyst::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 :create_access_token
60
+ Aws::CodeCatalyst::Endpoints::CreateAccessToken.build(context)
61
+ when :create_dev_environment
62
+ Aws::CodeCatalyst::Endpoints::CreateDevEnvironment.build(context)
63
+ when :create_project
64
+ Aws::CodeCatalyst::Endpoints::CreateProject.build(context)
65
+ when :create_source_repository_branch
66
+ Aws::CodeCatalyst::Endpoints::CreateSourceRepositoryBranch.build(context)
67
+ when :delete_access_token
68
+ Aws::CodeCatalyst::Endpoints::DeleteAccessToken.build(context)
69
+ when :delete_dev_environment
70
+ Aws::CodeCatalyst::Endpoints::DeleteDevEnvironment.build(context)
71
+ when :get_dev_environment
72
+ Aws::CodeCatalyst::Endpoints::GetDevEnvironment.build(context)
73
+ when :get_project
74
+ Aws::CodeCatalyst::Endpoints::GetProject.build(context)
75
+ when :get_source_repository_clone_urls
76
+ Aws::CodeCatalyst::Endpoints::GetSourceRepositoryCloneUrls.build(context)
77
+ when :get_space
78
+ Aws::CodeCatalyst::Endpoints::GetSpace.build(context)
79
+ when :get_subscription
80
+ Aws::CodeCatalyst::Endpoints::GetSubscription.build(context)
81
+ when :get_user_details
82
+ Aws::CodeCatalyst::Endpoints::GetUserDetails.build(context)
83
+ when :list_access_tokens
84
+ Aws::CodeCatalyst::Endpoints::ListAccessTokens.build(context)
85
+ when :list_dev_environments
86
+ Aws::CodeCatalyst::Endpoints::ListDevEnvironments.build(context)
87
+ when :list_event_logs
88
+ Aws::CodeCatalyst::Endpoints::ListEventLogs.build(context)
89
+ when :list_projects
90
+ Aws::CodeCatalyst::Endpoints::ListProjects.build(context)
91
+ when :list_source_repositories
92
+ Aws::CodeCatalyst::Endpoints::ListSourceRepositories.build(context)
93
+ when :list_source_repository_branches
94
+ Aws::CodeCatalyst::Endpoints::ListSourceRepositoryBranches.build(context)
95
+ when :list_spaces
96
+ Aws::CodeCatalyst::Endpoints::ListSpaces.build(context)
97
+ when :start_dev_environment
98
+ Aws::CodeCatalyst::Endpoints::StartDevEnvironment.build(context)
99
+ when :start_dev_environment_session
100
+ Aws::CodeCatalyst::Endpoints::StartDevEnvironmentSession.build(context)
101
+ when :stop_dev_environment
102
+ Aws::CodeCatalyst::Endpoints::StopDevEnvironment.build(context)
103
+ when :update_dev_environment
104
+ Aws::CodeCatalyst::Endpoints::UpdateDevEnvironment.build(context)
105
+ when :verify_session
106
+ Aws::CodeCatalyst::Endpoints::VerifySession.build(context)
107
+ end
108
+ end
109
+ end
110
+
111
+ def add_handlers(handlers, _config)
112
+ handlers.add(Handler, step: :build, priority: 75)
113
+ end
114
+ end
115
+ end
116
+ 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::CodeCatalyst
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