aws-sdk-inspectorscan 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,30 @@
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::InspectorScan
12
+ # @api private
13
+ module Endpoints
14
+
15
+ class ScanSbom
16
+ def self.build(context)
17
+ unless context.config.regional_endpoint
18
+ endpoint = context.config.endpoint.to_s
19
+ end
20
+ Aws::InspectorScan::EndpointParameters.new(
21
+ region: context.config.region,
22
+ use_dual_stack: context.config.use_dualstack_endpoint,
23
+ use_fips: context.config.use_fips_endpoint,
24
+ endpoint: endpoint,
25
+ )
26
+ end
27
+ end
28
+
29
+ end
30
+ end
@@ -0,0 +1,139 @@
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::InspectorScan
11
+
12
+ # When InspectorScan returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::InspectorScan::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all InspectorScan errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::InspectorScan::Errors::ServiceError
20
+ # # rescues all InspectorScan 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
+ # * {ThrottlingException}
33
+ # * {ValidationException}
34
+ #
35
+ # Additionally, error classes are dynamically generated for service errors based on the error code
36
+ # if they are not defined above.
37
+ module Errors
38
+
39
+ extend Aws::Errors::DynamicErrors
40
+
41
+ class AccessDeniedException < ServiceError
42
+
43
+ # @param [Seahorse::Client::RequestContext] context
44
+ # @param [String] message
45
+ # @param [Aws::InspectorScan::Types::AccessDeniedException] data
46
+ def initialize(context, message, data = Aws::EmptyStructure.new)
47
+ super(context, message, data)
48
+ end
49
+
50
+ # @return [String]
51
+ def message
52
+ @message || @data[:message]
53
+ end
54
+ end
55
+
56
+ class InternalServerException < ServiceError
57
+
58
+ # @param [Seahorse::Client::RequestContext] context
59
+ # @param [String] message
60
+ # @param [Aws::InspectorScan::Types::InternalServerException] data
61
+ def initialize(context, message, data = Aws::EmptyStructure.new)
62
+ super(context, message, data)
63
+ end
64
+
65
+ # @return [String]
66
+ def message
67
+ @message || @data[:message]
68
+ end
69
+
70
+ # @return [String]
71
+ def reason
72
+ @data[:reason]
73
+ end
74
+
75
+ # @return [String]
76
+ def retry_after_seconds
77
+ @data[:retry_after_seconds]
78
+ end
79
+
80
+ def retryable?
81
+ true
82
+ end
83
+ end
84
+
85
+ class ThrottlingException < ServiceError
86
+
87
+ # @param [Seahorse::Client::RequestContext] context
88
+ # @param [String] message
89
+ # @param [Aws::InspectorScan::Types::ThrottlingException] data
90
+ def initialize(context, message, data = Aws::EmptyStructure.new)
91
+ super(context, message, data)
92
+ end
93
+
94
+ # @return [String]
95
+ def message
96
+ @message || @data[:message]
97
+ end
98
+
99
+ # @return [String]
100
+ def retry_after_seconds
101
+ @data[:retry_after_seconds]
102
+ end
103
+
104
+ def retryable?
105
+ true
106
+ end
107
+
108
+ def throttling?
109
+ true
110
+ end
111
+ end
112
+
113
+ class ValidationException < ServiceError
114
+
115
+ # @param [Seahorse::Client::RequestContext] context
116
+ # @param [String] message
117
+ # @param [Aws::InspectorScan::Types::ValidationException] data
118
+ def initialize(context, message, data = Aws::EmptyStructure.new)
119
+ super(context, message, data)
120
+ end
121
+
122
+ # @return [String]
123
+ def message
124
+ @message || @data[:message]
125
+ end
126
+
127
+ # @return [String]
128
+ def reason
129
+ @data[:reason]
130
+ end
131
+
132
+ # @return [String]
133
+ def fields
134
+ @data[:fields]
135
+ end
136
+ end
137
+
138
+ end
139
+ end
@@ -0,0 +1,70 @@
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::InspectorScan
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::InspectorScan::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::InspectorScan::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::InspectorScan::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 :scan_sbom
60
+ Aws::InspectorScan::Endpoints::ScanSbom.build(context)
61
+ end
62
+ end
63
+ end
64
+
65
+ def add_handlers(handlers, _config)
66
+ handlers.add(Handler, step: :build, priority: 75)
67
+ end
68
+ end
69
+ end
70
+ 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::InspectorScan
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
@@ -0,0 +1,143 @@
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::InspectorScan
11
+ module Types
12
+
13
+ # You do not have sufficient access to perform this action.
14
+ #
15
+ # @!attribute [rw] message
16
+ # @return [String]
17
+ #
18
+ # @see http://docs.aws.amazon.com/goto/WebAPI/inspector-scan-2023-08-08/AccessDeniedException AWS API Documentation
19
+ #
20
+ class AccessDeniedException < Struct.new(
21
+ :message)
22
+ SENSITIVE = []
23
+ include Aws::Structure
24
+ end
25
+
26
+ # The request processing has failed because of an unknown error,
27
+ # exception or failure.
28
+ #
29
+ # @!attribute [rw] message
30
+ # @return [String]
31
+ #
32
+ # @!attribute [rw] reason
33
+ # The reason for the validation failure.
34
+ # @return [String]
35
+ #
36
+ # @!attribute [rw] retry_after_seconds
37
+ # The number of seconds to wait before retrying the request.
38
+ # @return [Integer]
39
+ #
40
+ # @see http://docs.aws.amazon.com/goto/WebAPI/inspector-scan-2023-08-08/InternalServerException AWS API Documentation
41
+ #
42
+ class InternalServerException < Struct.new(
43
+ :message,
44
+ :reason,
45
+ :retry_after_seconds)
46
+ SENSITIVE = []
47
+ include Aws::Structure
48
+ end
49
+
50
+ # @!attribute [rw] sbom
51
+ # The JSON file for the SBOM you want to scan. The SBOM must be in
52
+ # CycloneDX 1.5 format.
53
+ # @return [Hash,Array,String,Numeric,Boolean]
54
+ #
55
+ # @!attribute [rw] output_format
56
+ # The output format for the vulnerability report.
57
+ # @return [String]
58
+ #
59
+ # @see http://docs.aws.amazon.com/goto/WebAPI/inspector-scan-2023-08-08/ScanSbomRequest AWS API Documentation
60
+ #
61
+ class ScanSbomRequest < Struct.new(
62
+ :sbom,
63
+ :output_format)
64
+ SENSITIVE = []
65
+ include Aws::Structure
66
+ end
67
+
68
+ # @!attribute [rw] sbom
69
+ # The vulnerability report for the scanned SBOM.
70
+ # @return [Hash,Array,String,Numeric,Boolean]
71
+ #
72
+ # @see http://docs.aws.amazon.com/goto/WebAPI/inspector-scan-2023-08-08/ScanSbomResponse AWS API Documentation
73
+ #
74
+ class ScanSbomResponse < Struct.new(
75
+ :sbom)
76
+ SENSITIVE = []
77
+ include Aws::Structure
78
+ end
79
+
80
+ # The request was denied due to request throttling.
81
+ #
82
+ # @!attribute [rw] message
83
+ # @return [String]
84
+ #
85
+ # @!attribute [rw] retry_after_seconds
86
+ # The number of seconds to wait before retrying the request.
87
+ # @return [Integer]
88
+ #
89
+ # @see http://docs.aws.amazon.com/goto/WebAPI/inspector-scan-2023-08-08/ThrottlingException AWS API Documentation
90
+ #
91
+ class ThrottlingException < Struct.new(
92
+ :message,
93
+ :retry_after_seconds)
94
+ SENSITIVE = []
95
+ include Aws::Structure
96
+ end
97
+
98
+ # The request has failed validation due to missing required fields or
99
+ # having invalid inputs.
100
+ #
101
+ # @!attribute [rw] message
102
+ # @return [String]
103
+ #
104
+ # @!attribute [rw] reason
105
+ # The reason for the validation failure.
106
+ # @return [String]
107
+ #
108
+ # @!attribute [rw] fields
109
+ # The fields that failed validation.
110
+ # @return [Array<Types::ValidationExceptionField>]
111
+ #
112
+ # @see http://docs.aws.amazon.com/goto/WebAPI/inspector-scan-2023-08-08/ValidationException AWS API Documentation
113
+ #
114
+ class ValidationException < Struct.new(
115
+ :message,
116
+ :reason,
117
+ :fields)
118
+ SENSITIVE = []
119
+ include Aws::Structure
120
+ end
121
+
122
+ # The request has failed validation due to missing required fields or
123
+ # having invalid inputs.
124
+ #
125
+ # @!attribute [rw] name
126
+ # The name of the validation exception.
127
+ # @return [String]
128
+ #
129
+ # @!attribute [rw] message
130
+ # The validation exception message.
131
+ # @return [String]
132
+ #
133
+ # @see http://docs.aws.amazon.com/goto/WebAPI/inspector-scan-2023-08-08/ValidationExceptionField AWS API Documentation
134
+ #
135
+ class ValidationExceptionField < Struct.new(
136
+ :name,
137
+ :message)
138
+ SENSITIVE = []
139
+ include Aws::Structure
140
+ end
141
+
142
+ end
143
+ end
@@ -0,0 +1,57 @@
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
+ require 'aws-sdk-core'
12
+ require 'aws-sigv4'
13
+
14
+ require_relative 'aws-sdk-inspectorscan/types'
15
+ require_relative 'aws-sdk-inspectorscan/client_api'
16
+ require_relative 'aws-sdk-inspectorscan/plugins/endpoints.rb'
17
+ require_relative 'aws-sdk-inspectorscan/client'
18
+ require_relative 'aws-sdk-inspectorscan/errors'
19
+ require_relative 'aws-sdk-inspectorscan/resource'
20
+ require_relative 'aws-sdk-inspectorscan/endpoint_parameters'
21
+ require_relative 'aws-sdk-inspectorscan/endpoint_provider'
22
+ require_relative 'aws-sdk-inspectorscan/endpoints'
23
+ require_relative 'aws-sdk-inspectorscan/customizations'
24
+
25
+ # This module provides support for Inspector Scan. This module is available in the
26
+ # `aws-sdk-inspectorscan` gem.
27
+ #
28
+ # # Client
29
+ #
30
+ # The {Client} class provides one method for each API operation. Operation
31
+ # methods each accept a hash of request parameters and return a response
32
+ # structure.
33
+ #
34
+ # inspector_scan = Aws::InspectorScan::Client.new
35
+ # resp = inspector_scan.scan_sbom(params)
36
+ #
37
+ # See {Client} for more information.
38
+ #
39
+ # # Errors
40
+ #
41
+ # Errors returned from Inspector Scan are defined in the
42
+ # {Errors} module and all extend {Errors::ServiceError}.
43
+ #
44
+ # begin
45
+ # # do stuff
46
+ # rescue Aws::InspectorScan::Errors::ServiceError
47
+ # # rescues all Inspector Scan API errors
48
+ # end
49
+ #
50
+ # See {Errors} for more information.
51
+ #
52
+ # @!group service
53
+ module Aws::InspectorScan
54
+
55
+ GEM_VERSION = '1.0.0'
56
+
57
+ end
metadata ADDED
@@ -0,0 +1,94 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aws-sdk-inspectorscan
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Amazon Web Services
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-11-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.184.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.184.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: aws-sigv4
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.1'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '1.1'
47
+ description: Official AWS Ruby gem for Inspector Scan (inspector-scan). This gem is
48
+ part of the AWS SDK for Ruby.
49
+ email:
50
+ - aws-dr-rubygems@amazon.com
51
+ executables: []
52
+ extensions: []
53
+ extra_rdoc_files: []
54
+ files:
55
+ - CHANGELOG.md
56
+ - LICENSE.txt
57
+ - VERSION
58
+ - lib/aws-sdk-inspectorscan.rb
59
+ - lib/aws-sdk-inspectorscan/client.rb
60
+ - lib/aws-sdk-inspectorscan/client_api.rb
61
+ - lib/aws-sdk-inspectorscan/customizations.rb
62
+ - lib/aws-sdk-inspectorscan/endpoint_parameters.rb
63
+ - lib/aws-sdk-inspectorscan/endpoint_provider.rb
64
+ - lib/aws-sdk-inspectorscan/endpoints.rb
65
+ - lib/aws-sdk-inspectorscan/errors.rb
66
+ - lib/aws-sdk-inspectorscan/plugins/endpoints.rb
67
+ - lib/aws-sdk-inspectorscan/resource.rb
68
+ - lib/aws-sdk-inspectorscan/types.rb
69
+ homepage: https://github.com/aws/aws-sdk-ruby
70
+ licenses:
71
+ - Apache-2.0
72
+ metadata:
73
+ source_code_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-inspectorscan
74
+ changelog_uri: https://github.com/aws/aws-sdk-ruby/tree/version-3/gems/aws-sdk-inspectorscan/CHANGELOG.md
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '2.3'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubygems_version: 3.1.6
91
+ signing_key:
92
+ specification_version: 4
93
+ summary: AWS SDK for Ruby - inspector-scan
94
+ test_files: []