aws-sdk-wafv2 1.47.0 → 1.49.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.
@@ -50,9 +50,6 @@ module Aws::WAFV2
50
50
 
51
51
  def initialize(options = {})
52
52
  self[:region] = options[:region]
53
- if self[:region].nil?
54
- raise ArgumentError, "Missing required EndpointParameter: :region"
55
- end
56
53
  self[:use_dual_stack] = options[:use_dual_stack]
57
54
  self[:use_dual_stack] = false if self[:use_dual_stack].nil?
58
55
  if self[:use_dual_stack].nil?
@@ -14,36 +14,117 @@ module Aws::WAFV2
14
14
  use_dual_stack = parameters.use_dual_stack
15
15
  use_fips = parameters.use_fips
16
16
  endpoint = parameters.endpoint
17
- if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
18
- if Aws::Endpoints::Matchers.set?(endpoint)
17
+ if Aws::Endpoints::Matchers.set?(endpoint)
18
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
19
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
20
+ end
21
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
22
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
23
+ end
24
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
25
+ end
26
+ if Aws::Endpoints::Matchers.set?(region)
27
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
28
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
29
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
30
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
31
+ end
32
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
33
+ end
19
34
  if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
20
- raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
35
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
36
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
37
+ end
38
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
21
39
  end
22
40
  if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
23
- raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
41
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
42
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
43
+ end
44
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
24
45
  end
25
- return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
26
- end
27
- if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
28
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
29
- return Aws::Endpoints::Endpoint.new(url: "https://wafv2-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
46
+ if Aws::Endpoints::Matchers.string_equals?(region, "af-south-1")
47
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.af-south-1.amazonaws.com", headers: {}, properties: {})
30
48
  end
31
- raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
32
- end
33
- if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
34
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
35
- return Aws::Endpoints::Endpoint.new(url: "https://wafv2-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
49
+ if Aws::Endpoints::Matchers.string_equals?(region, "ap-east-1")
50
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ap-east-1.amazonaws.com", headers: {}, properties: {})
36
51
  end
37
- raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
38
- end
39
- if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
40
- if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
41
- return Aws::Endpoints::Endpoint.new(url: "https://wafv2.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
52
+ if Aws::Endpoints::Matchers.string_equals?(region, "ap-northeast-1")
53
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ap-northeast-1.amazonaws.com", headers: {}, properties: {})
54
+ end
55
+ if Aws::Endpoints::Matchers.string_equals?(region, "ap-northeast-2")
56
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ap-northeast-2.amazonaws.com", headers: {}, properties: {})
57
+ end
58
+ if Aws::Endpoints::Matchers.string_equals?(region, "ap-northeast-3")
59
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ap-northeast-3.amazonaws.com", headers: {}, properties: {})
60
+ end
61
+ if Aws::Endpoints::Matchers.string_equals?(region, "ap-south-1")
62
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ap-south-1.amazonaws.com", headers: {}, properties: {})
63
+ end
64
+ if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-1")
65
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ap-southeast-1.amazonaws.com", headers: {}, properties: {})
66
+ end
67
+ if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-2")
68
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ap-southeast-2.amazonaws.com", headers: {}, properties: {})
69
+ end
70
+ if Aws::Endpoints::Matchers.string_equals?(region, "ap-southeast-3")
71
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ap-southeast-3.amazonaws.com", headers: {}, properties: {})
72
+ end
73
+ if Aws::Endpoints::Matchers.string_equals?(region, "ca-central-1")
74
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.ca-central-1.amazonaws.com", headers: {}, properties: {})
75
+ end
76
+ if Aws::Endpoints::Matchers.string_equals?(region, "eu-central-1")
77
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.eu-central-1.amazonaws.com", headers: {}, properties: {})
78
+ end
79
+ if Aws::Endpoints::Matchers.string_equals?(region, "eu-north-1")
80
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.eu-north-1.amazonaws.com", headers: {}, properties: {})
81
+ end
82
+ if Aws::Endpoints::Matchers.string_equals?(region, "eu-south-1")
83
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.eu-south-1.amazonaws.com", headers: {}, properties: {})
84
+ end
85
+ if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-1")
86
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.eu-west-1.amazonaws.com", headers: {}, properties: {})
87
+ end
88
+ if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-2")
89
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.eu-west-2.amazonaws.com", headers: {}, properties: {})
90
+ end
91
+ if Aws::Endpoints::Matchers.string_equals?(region, "eu-west-3")
92
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.eu-west-3.amazonaws.com", headers: {}, properties: {})
93
+ end
94
+ if Aws::Endpoints::Matchers.string_equals?(region, "me-south-1")
95
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.me-south-1.amazonaws.com", headers: {}, properties: {})
96
+ end
97
+ if Aws::Endpoints::Matchers.string_equals?(region, "sa-east-1")
98
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.sa-east-1.amazonaws.com", headers: {}, properties: {})
99
+ end
100
+ if Aws::Endpoints::Matchers.string_equals?(region, "us-east-1")
101
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.us-east-1.amazonaws.com", headers: {}, properties: {})
102
+ end
103
+ if Aws::Endpoints::Matchers.string_equals?(region, "us-east-2")
104
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.us-east-2.amazonaws.com", headers: {}, properties: {})
105
+ end
106
+ if Aws::Endpoints::Matchers.string_equals?(region, "us-west-1")
107
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.us-west-1.amazonaws.com", headers: {}, properties: {})
108
+ end
109
+ if Aws::Endpoints::Matchers.string_equals?(region, "us-west-2")
110
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.us-west-2.amazonaws.com", headers: {}, properties: {})
111
+ end
112
+ if Aws::Endpoints::Matchers.string_equals?(region, "cn-north-1")
113
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.cn-north-1.amazonaws.com.cn", headers: {}, properties: {})
114
+ end
115
+ if Aws::Endpoints::Matchers.string_equals?(region, "cn-northwest-1")
116
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.cn-northwest-1.amazonaws.com.cn", headers: {}, properties: {})
117
+ end
118
+ if Aws::Endpoints::Matchers.string_equals?(region, "us-gov-east-1")
119
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.us-gov-east-1.amazonaws.com", headers: {}, properties: {})
120
+ end
121
+ if Aws::Endpoints::Matchers.string_equals?(region, "us-gov-west-1")
122
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.us-gov-west-1.amazonaws.com", headers: {}, properties: {})
42
123
  end
43
- raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
124
+ return Aws::Endpoints::Endpoint.new(url: "https://wafv2.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
44
125
  end
45
- return Aws::Endpoints::Endpoint.new(url: "https://wafv2.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
46
126
  end
127
+ raise ArgumentError, "Invalid Configuration: Missing Region"
47
128
  raise ArgumentError, 'No endpoint could be resolved'
48
129
 
49
130
  end