aws-sdk-sesv2 1.66.0 → 1.68.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,11 +30,17 @@ module Aws::SESV2
30
30
  #
31
31
  # @return [String]
32
32
  #
33
+ # @!attribute endpoint_id
34
+ # Operation parameter for EndpointId
35
+ #
36
+ # @return [String]
37
+ #
33
38
  EndpointParameters = Struct.new(
34
39
  :region,
35
40
  :use_dual_stack,
36
41
  :use_fips,
37
42
  :endpoint,
43
+ :endpoint_id,
38
44
  ) do
39
45
  include Aws::Structure
40
46
 
@@ -45,6 +51,7 @@ module Aws::SESV2
45
51
  'UseDualStack' => :use_dual_stack,
46
52
  'UseFIPS' => :use_fips,
47
53
  'Endpoint' => :endpoint,
54
+ 'EndpointId' => :endpoint_id,
48
55
  }.freeze
49
56
  end
50
57
 
@@ -55,6 +62,7 @@ module Aws::SESV2
55
62
  self[:use_fips] = options[:use_fips]
56
63
  self[:use_fips] = false if self[:use_fips].nil?
57
64
  self[:endpoint] = options[:endpoint]
65
+ self[:endpoint_id] = options[:endpoint_id]
58
66
  end
59
67
 
60
68
  def self.create(config, options={})
@@ -14,6 +14,25 @@ module Aws::SESV2
14
14
  use_dual_stack = parameters.use_dual_stack
15
15
  use_fips = parameters.use_fips
16
16
  endpoint = parameters.endpoint
17
+ endpoint_id = parameters.endpoint_id
18
+ if Aws::Endpoints::Matchers.set?(endpoint_id) && Aws::Endpoints::Matchers.set?(region) && (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
19
+ if Aws::Endpoints::Matchers.valid_host_label?(endpoint_id, true)
20
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, false)
21
+ if Aws::Endpoints::Matchers.set?(endpoint)
22
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4a", "signingName"=>"ses", "signingRegionSet"=>["*"]}]})
23
+ end
24
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
25
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
26
+ return Aws::Endpoints::Endpoint.new(url: "https://#{endpoint_id}.endpoints.email.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4a", "signingName"=>"ses", "signingRegionSet"=>["*"]}]})
27
+ end
28
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
29
+ end
30
+ return Aws::Endpoints::Endpoint.new(url: "https://#{endpoint_id}.endpoints.email.#{partition_result['dnsSuffix']}", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4a", "signingName"=>"ses", "signingRegionSet"=>["*"]}]})
31
+ end
32
+ raise ArgumentError, "Invalid Configuration: FIPS is not supported with multi-region endpoints"
33
+ end
34
+ raise ArgumentError, "EndpointId must be a valid host label"
35
+ end
17
36
  if Aws::Endpoints::Matchers.set?(endpoint)
18
37
  if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
19
38
  raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
@@ -12,9 +12,34 @@ module Aws::SESV2
12
12
  # @api private
13
13
  module Endpoints
14
14
 
15
+ class SendBulkEmail
16
+ def self.build(context)
17
+ Aws::SESV2::EndpointParameters.create(
18
+ context.config,
19
+ endpoint_id: context.params[:endpoint_id],
20
+ )
21
+ end
22
+ end
23
+
24
+ class SendEmail
25
+ def self.build(context)
26
+ Aws::SESV2::EndpointParameters.create(
27
+ context.config,
28
+ endpoint_id: context.params[:endpoint_id],
29
+ )
30
+ end
31
+ end
32
+
15
33
 
16
34
  def self.parameters_for_operation(context)
17
- Aws::SESV2::EndpointParameters.create(context.config)
35
+ case context.operation_name
36
+ when :send_bulk_email
37
+ SendBulkEmail.build(context)
38
+ when :send_email
39
+ SendEmail.build(context)
40
+ else
41
+ Aws::SESV2::EndpointParameters.create(context.config)
42
+ end
18
43
  end
19
44
  end
20
45
  end