fastly 13.1.0 → 14.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/Gemfile.lock +4 -4
- data/README.md +16 -4
- data/docs/AttackReport.md +19 -0
- data/docs/AttackSignal.md +12 -0
- data/docs/AttackSource.md +13 -0
- data/docs/Backend.md +4 -4
- data/docs/BackendApi.md +10 -10
- data/docs/BackendResponse.md +4 -4
- data/docs/DdosProtectionApi.md +40 -0
- data/docs/DdosProtectionAttributeStats.md +1 -1
- data/docs/DdosProtectionInvalidRequest.md +13 -0
- data/docs/{LogTimeseriesResultDimensions.md → DdosProtectionNotAuthorized.md} +3 -2
- data/docs/DdosProtectionRule.md +1 -1
- data/docs/DdosProtectionRuleAllOf.md +1 -1
- data/docs/DdosProtectionRulePatch.md +10 -0
- data/docs/HistoricalApi.md +2 -0
- data/docs/KvStoreApi.md +2 -0
- data/docs/ListAttackReport.md +11 -0
- data/docs/{DdosProtectionTrafficAttribute.md → ListAttackReportMeta.md} +2 -1
- data/docs/{DdosProtectionAction.md → ListSignalReport.md} +2 -1
- data/docs/LogExplorerApi.md +1 -1
- data/docs/NgwafReportsApi.md +99 -0
- data/docs/ObservabilityTimeseriesApi.md +67 -0
- data/docs/PoolApi.md +4 -4
- data/docs/PoolResponse.md +1 -1
- data/docs/PoolResponseCommon.md +1 -1
- data/docs/PoolResponsePost.md +1 -1
- data/docs/SignalReport.md +13 -0
- data/docs/TimeseriesGetResponse.md +11 -0
- data/docs/TimeseriesMeta.md +13 -0
- data/docs/TimeseriesResult.md +11 -0
- data/docs/TlsSubscriptionsApi.md +0 -2
- data/docs/TopWorkspace.md +12 -0
- data/lib/fastly/api/backend_api.rb +16 -16
- data/lib/fastly/api/ddos_protection_api.rb +70 -0
- data/lib/fastly/api/historical_api.rb +3 -0
- data/lib/fastly/api/kv_store_api.rb +3 -0
- data/lib/fastly/api/ngwaf_reports_api.rb +161 -0
- data/lib/fastly/api/{observability_timeseries_for_logs_api.rb → observability_timeseries_api.rb} +38 -43
- data/lib/fastly/api/pool_api.rb +4 -4
- data/lib/fastly/api/tls_subscriptions_api.rb +0 -3
- data/lib/fastly/configuration.rb +19 -1
- data/lib/fastly/models/attack_report.rb +359 -0
- data/lib/fastly/models/attack_signal.rb +252 -0
- data/lib/fastly/models/attack_source.rb +267 -0
- data/lib/fastly/models/backend.rb +7 -1
- data/lib/fastly/models/backend_response.rb +7 -1
- data/lib/fastly/models/ddos_protection_attribute_stats.rb +2 -1
- data/lib/fastly/models/ddos_protection_invalid_request.rb +309 -0
- data/lib/fastly/models/{log_timeseries_filter_field_item.rb → ddos_protection_not_authorized.rb} +24 -36
- data/lib/fastly/models/ddos_protection_rule.rb +2 -1
- data/lib/fastly/models/ddos_protection_rule_all_of.rb +2 -1
- data/lib/fastly/models/ddos_protection_rule_patch.rb +219 -0
- data/lib/fastly/models/{log_timeseries_get_response.rb → list_attack_report.rb} +5 -5
- data/lib/fastly/models/list_attack_report_meta.rb +218 -0
- data/lib/fastly/models/{log_timeseries_result_dimensions.rb → list_signal_report.rb} +12 -10
- data/lib/fastly/models/pool_response.rb +1 -1
- data/lib/fastly/models/pool_response_common.rb +1 -1
- data/lib/fastly/models/pool_response_post.rb +1 -1
- data/lib/fastly/models/signal_report.rb +249 -0
- data/lib/fastly/models/{log_timeseries_get_response_meta_filters.rb → timeseries_get_response.rb} +20 -13
- data/lib/fastly/models/{log_timeseries_get_response_meta.rb → timeseries_meta.rb} +23 -32
- data/lib/fastly/models/{log_timeseries_result.rb → timeseries_result.rb} +9 -5
- data/lib/fastly/models/top_workspace.rb +238 -0
- data/lib/fastly/version.rb +1 -1
- data/lib/fastly.rb +16 -10
- data/sig.json +1 -1
- metadata +34 -22
- data/docs/LogTimeseriesFilterFieldItem.md +0 -12
- data/docs/LogTimeseriesGetResponse.md +0 -11
- data/docs/LogTimeseriesGetResponseMeta.md +0 -14
- data/docs/LogTimeseriesGetResponseMetaFilters.md +0 -10
- data/docs/LogTimeseriesResult.md +0 -11
- data/docs/LogTimeseriesValueField.md +0 -59
- data/docs/ObservabilityTimeseriesForLogsApi.md +0 -67
- data/lib/fastly/models/ddos_protection_action.rb +0 -37
- data/lib/fastly/models/ddos_protection_traffic_attribute.rb +0 -40
- data/lib/fastly/models/log_timeseries_value_field.rb +0 -108
@@ -0,0 +1,309 @@
|
|
1
|
+
=begin
|
2
|
+
#Fastly API
|
3
|
+
|
4
|
+
#Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: oss@fastly.com
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
require 'time'
|
13
|
+
|
14
|
+
module Fastly
|
15
|
+
class DdosProtectionInvalidRequest
|
16
|
+
attr_accessor :title
|
17
|
+
|
18
|
+
attr_accessor :status
|
19
|
+
|
20
|
+
attr_accessor :detail
|
21
|
+
|
22
|
+
attr_accessor :errors
|
23
|
+
|
24
|
+
class EnumAttributeValidator
|
25
|
+
attr_reader :datatype
|
26
|
+
attr_reader :allowable_values
|
27
|
+
|
28
|
+
def initialize(datatype, allowable_values)
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
30
|
+
case datatype.to_s
|
31
|
+
when /Integer/i
|
32
|
+
value.to_i
|
33
|
+
when /Float/i
|
34
|
+
value.to_f
|
35
|
+
else
|
36
|
+
value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def valid?(value)
|
42
|
+
!value || allowable_values.include?(value)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
47
|
+
def self.attribute_map
|
48
|
+
{
|
49
|
+
:'title' => :'title',
|
50
|
+
:'status' => :'status',
|
51
|
+
:'detail' => :'detail',
|
52
|
+
:'errors' => :'errors'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Returns all the JSON keys this model knows about
|
57
|
+
def self.acceptable_attributes
|
58
|
+
attribute_map.values
|
59
|
+
end
|
60
|
+
|
61
|
+
# Attribute type mapping.
|
62
|
+
def self.fastly_types
|
63
|
+
{
|
64
|
+
:'title' => :'String',
|
65
|
+
:'status' => :'Integer',
|
66
|
+
:'detail' => :'String',
|
67
|
+
:'errors' => :'Array<DdosProtectionErrorErrors>'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# List of attributes with nullable: true
|
72
|
+
def self.fastly_nullable
|
73
|
+
Set.new([
|
74
|
+
])
|
75
|
+
end
|
76
|
+
|
77
|
+
# Initializes the object
|
78
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
79
|
+
def initialize(attributes = {})
|
80
|
+
if (!attributes.is_a?(Hash))
|
81
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::DdosProtectionInvalidRequest` initialize method"
|
82
|
+
end
|
83
|
+
|
84
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
85
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
86
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
87
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::DdosProtectionInvalidRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
88
|
+
end
|
89
|
+
h[k.to_sym] = v
|
90
|
+
}
|
91
|
+
|
92
|
+
if attributes.key?(:'title')
|
93
|
+
self.title = attributes[:'title']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'status')
|
97
|
+
self.status = attributes[:'status']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'detail')
|
101
|
+
self.detail = attributes[:'detail']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'errors')
|
105
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
106
|
+
self.errors = value
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
112
|
+
# @return Array for valid properties with the reasons
|
113
|
+
def list_invalid_properties
|
114
|
+
invalid_properties = Array.new
|
115
|
+
if @title.nil?
|
116
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
117
|
+
end
|
118
|
+
|
119
|
+
if @status.nil?
|
120
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
121
|
+
end
|
122
|
+
|
123
|
+
if @detail.nil?
|
124
|
+
invalid_properties.push('invalid value for "detail", detail cannot be nil.')
|
125
|
+
end
|
126
|
+
|
127
|
+
if @errors.nil?
|
128
|
+
invalid_properties.push('invalid value for "errors", errors cannot be nil.')
|
129
|
+
end
|
130
|
+
|
131
|
+
invalid_properties
|
132
|
+
end
|
133
|
+
|
134
|
+
# Check to see if the all the properties in the model are valid
|
135
|
+
# @return true if the model is valid
|
136
|
+
def valid?
|
137
|
+
return false if @title.nil?
|
138
|
+
return false if @status.nil?
|
139
|
+
status_validator = EnumAttributeValidator.new('Integer', [400])
|
140
|
+
return false unless status_validator.valid?(@status)
|
141
|
+
return false if @detail.nil?
|
142
|
+
return false if @errors.nil?
|
143
|
+
true
|
144
|
+
end
|
145
|
+
|
146
|
+
# Custom attribute writer method checking allowed values (enum).
|
147
|
+
# @param [Object] status Object to be assigned
|
148
|
+
def status=(status)
|
149
|
+
validator = EnumAttributeValidator.new('Integer', [400])
|
150
|
+
unless validator.valid?(status)
|
151
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
152
|
+
end
|
153
|
+
@status = status
|
154
|
+
end
|
155
|
+
|
156
|
+
# Custom attribute writer method with validation
|
157
|
+
# @param [Object] errors Value to be assigned
|
158
|
+
def errors=(errors)
|
159
|
+
if errors.nil?
|
160
|
+
fail ArgumentError, 'errors cannot be nil'
|
161
|
+
end
|
162
|
+
|
163
|
+
@errors = errors
|
164
|
+
end
|
165
|
+
|
166
|
+
# Checks equality by comparing each attribute.
|
167
|
+
# @param [Object] Object to be compared
|
168
|
+
def ==(o)
|
169
|
+
return true if self.equal?(o)
|
170
|
+
self.class == o.class &&
|
171
|
+
title == o.title &&
|
172
|
+
status == o.status &&
|
173
|
+
detail == o.detail &&
|
174
|
+
errors == o.errors
|
175
|
+
end
|
176
|
+
|
177
|
+
# @see the `==` method
|
178
|
+
# @param [Object] Object to be compared
|
179
|
+
def eql?(o)
|
180
|
+
self == o
|
181
|
+
end
|
182
|
+
|
183
|
+
# Calculates hash code according to all attributes.
|
184
|
+
# @return [Integer] Hash code
|
185
|
+
def hash
|
186
|
+
[title, status, detail, errors].hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Builds the object from hash
|
190
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
191
|
+
# @return [Object] Returns the model itself
|
192
|
+
def self.build_from_hash(attributes)
|
193
|
+
new.build_from_hash(attributes)
|
194
|
+
end
|
195
|
+
|
196
|
+
# Builds the object from hash
|
197
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
198
|
+
# @return [Object] Returns the model itself
|
199
|
+
def build_from_hash(attributes)
|
200
|
+
return nil unless attributes.is_a?(Hash)
|
201
|
+
self.class.fastly_types.each_pair do |key, type|
|
202
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
203
|
+
self.send("#{key}=", nil)
|
204
|
+
elsif type =~ /\AArray<(.*)>/i
|
205
|
+
# check to ensure the input is an array given that the attribute
|
206
|
+
# is documented as an array but the input is not
|
207
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
208
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
209
|
+
end
|
210
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
211
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
self
|
216
|
+
end
|
217
|
+
|
218
|
+
# Deserializes the data based on type
|
219
|
+
# @param string type Data type
|
220
|
+
# @param string value Value to be deserialized
|
221
|
+
# @return [Object] Deserialized data
|
222
|
+
def _deserialize(type, value)
|
223
|
+
case type.to_sym
|
224
|
+
when :Time
|
225
|
+
Time.parse(value)
|
226
|
+
when :Date
|
227
|
+
Date.parse(value)
|
228
|
+
when :String
|
229
|
+
value.to_s
|
230
|
+
when :Integer
|
231
|
+
value.to_i
|
232
|
+
when :Float
|
233
|
+
value.to_f
|
234
|
+
when :Boolean
|
235
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
236
|
+
true
|
237
|
+
else
|
238
|
+
false
|
239
|
+
end
|
240
|
+
when :Object
|
241
|
+
# generic object (usually a Hash), return directly
|
242
|
+
value
|
243
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
244
|
+
inner_type = Regexp.last_match[:inner_type]
|
245
|
+
value.map { |v| _deserialize(inner_type, v) }
|
246
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
247
|
+
k_type = Regexp.last_match[:k_type]
|
248
|
+
v_type = Regexp.last_match[:v_type]
|
249
|
+
{}.tap do |hash|
|
250
|
+
value.each do |k, v|
|
251
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
252
|
+
end
|
253
|
+
end
|
254
|
+
else # model
|
255
|
+
# models (e.g. Pet) or oneOf
|
256
|
+
klass = Fastly.const_get(type)
|
257
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
# Returns the string representation of the object
|
262
|
+
# @return [String] String presentation of the object
|
263
|
+
def to_s
|
264
|
+
to_hash.to_s
|
265
|
+
end
|
266
|
+
|
267
|
+
# to_body is an alias to to_hash (backward compatibility)
|
268
|
+
# @return [Hash] Returns the object in the form of hash
|
269
|
+
def to_body
|
270
|
+
to_hash
|
271
|
+
end
|
272
|
+
|
273
|
+
# Returns the object in the form of hash
|
274
|
+
# @return [Hash] Returns the object in the form of hash
|
275
|
+
def to_hash
|
276
|
+
hash = {}
|
277
|
+
self.class.attribute_map.each_pair do |attr, param|
|
278
|
+
value = self.send(attr)
|
279
|
+
if value.nil?
|
280
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
281
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
282
|
+
end
|
283
|
+
|
284
|
+
hash[param] = _to_hash(value)
|
285
|
+
end
|
286
|
+
hash
|
287
|
+
end
|
288
|
+
|
289
|
+
# Outputs non-array value in the form of hash
|
290
|
+
# For object, use to_hash. Otherwise, just return the value
|
291
|
+
# @param [Object] value Any valid value
|
292
|
+
# @return [Hash] Returns the value in the form of hash
|
293
|
+
def _to_hash(value)
|
294
|
+
if value.is_a?(Array)
|
295
|
+
value.compact.map { |v| _to_hash(v) }
|
296
|
+
elsif value.is_a?(Hash)
|
297
|
+
{}.tap do |hash|
|
298
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
299
|
+
end
|
300
|
+
elsif value.respond_to? :to_hash
|
301
|
+
value.to_hash
|
302
|
+
else
|
303
|
+
value
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
data/lib/fastly/models/{log_timeseries_filter_field_item.rb → ddos_protection_not_authorized.rb}
RENAMED
@@ -12,15 +12,10 @@ require 'date'
|
|
12
12
|
require 'time'
|
13
13
|
|
14
14
|
module Fastly
|
15
|
-
|
16
|
-
|
17
|
-
# The log field to which this filter should be applied.
|
18
|
-
attr_accessor :field
|
15
|
+
class DdosProtectionNotAuthorized
|
16
|
+
attr_accessor :title
|
19
17
|
|
20
|
-
|
21
|
-
attr_accessor :operator
|
22
|
-
|
23
|
-
attr_accessor :value
|
18
|
+
attr_accessor :status
|
24
19
|
|
25
20
|
class EnumAttributeValidator
|
26
21
|
attr_reader :datatype
|
@@ -47,9 +42,8 @@ module Fastly
|
|
47
42
|
# Attribute mapping from ruby-style variable name to JSON key.
|
48
43
|
def self.attribute_map
|
49
44
|
{
|
50
|
-
:'
|
51
|
-
:'
|
52
|
-
:'value' => :'value'
|
45
|
+
:'title' => :'title',
|
46
|
+
:'status' => :'status'
|
53
47
|
}
|
54
48
|
end
|
55
49
|
|
@@ -61,9 +55,8 @@ module Fastly
|
|
61
55
|
# Attribute type mapping.
|
62
56
|
def self.fastly_types
|
63
57
|
{
|
64
|
-
:'
|
65
|
-
:'
|
66
|
-
:'value' => :'LogTimeseriesValueField'
|
58
|
+
:'title' => :'String',
|
59
|
+
:'status' => :'Integer'
|
67
60
|
}
|
68
61
|
end
|
69
62
|
|
@@ -77,27 +70,23 @@ module Fastly
|
|
77
70
|
# @param [Hash] attributes Model attributes in the form of hash
|
78
71
|
def initialize(attributes = {})
|
79
72
|
if (!attributes.is_a?(Hash))
|
80
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::
|
73
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::DdosProtectionNotAuthorized` initialize method"
|
81
74
|
end
|
82
75
|
|
83
76
|
# check to see if the attribute exists and convert string to symbol for hash key
|
84
77
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
85
78
|
if (!self.class.attribute_map.key?(k.to_sym))
|
86
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::
|
79
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::DdosProtectionNotAuthorized`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
87
80
|
end
|
88
81
|
h[k.to_sym] = v
|
89
82
|
}
|
90
83
|
|
91
|
-
if attributes.key?(:'
|
92
|
-
self.
|
93
|
-
end
|
94
|
-
|
95
|
-
if attributes.key?(:'operator')
|
96
|
-
self.operator = attributes[:'operator']
|
84
|
+
if attributes.key?(:'title')
|
85
|
+
self.title = attributes[:'title']
|
97
86
|
end
|
98
87
|
|
99
|
-
if attributes.key?(:'
|
100
|
-
self.
|
88
|
+
if attributes.key?(:'status')
|
89
|
+
self.status = attributes[:'status']
|
101
90
|
end
|
102
91
|
end
|
103
92
|
|
@@ -111,19 +100,19 @@ module Fastly
|
|
111
100
|
# Check to see if the all the properties in the model are valid
|
112
101
|
# @return true if the model is valid
|
113
102
|
def valid?
|
114
|
-
|
115
|
-
return false unless
|
103
|
+
status_validator = EnumAttributeValidator.new('Integer', [403])
|
104
|
+
return false unless status_validator.valid?(@status)
|
116
105
|
true
|
117
106
|
end
|
118
107
|
|
119
108
|
# Custom attribute writer method checking allowed values (enum).
|
120
|
-
# @param [Object]
|
121
|
-
def
|
122
|
-
validator = EnumAttributeValidator.new('
|
123
|
-
unless validator.valid?(
|
124
|
-
fail ArgumentError, "invalid value for \"
|
109
|
+
# @param [Object] status Object to be assigned
|
110
|
+
def status=(status)
|
111
|
+
validator = EnumAttributeValidator.new('Integer', [403])
|
112
|
+
unless validator.valid?(status)
|
113
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
125
114
|
end
|
126
|
-
@
|
115
|
+
@status = status
|
127
116
|
end
|
128
117
|
|
129
118
|
# Checks equality by comparing each attribute.
|
@@ -131,9 +120,8 @@ module Fastly
|
|
131
120
|
def ==(o)
|
132
121
|
return true if self.equal?(o)
|
133
122
|
self.class == o.class &&
|
134
|
-
|
135
|
-
|
136
|
-
value == o.value
|
123
|
+
title == o.title &&
|
124
|
+
status == o.status
|
137
125
|
end
|
138
126
|
|
139
127
|
# @see the `==` method
|
@@ -145,7 +133,7 @@ module Fastly
|
|
145
133
|
# Calculates hash code according to all attributes.
|
146
134
|
# @return [Integer] Hash code
|
147
135
|
def hash
|
148
|
-
[
|
136
|
+
[title, status].hash
|
149
137
|
end
|
150
138
|
|
151
139
|
# Builds the object from hash
|
@@ -25,6 +25,7 @@ module Fastly
|
|
25
25
|
# A human-readable name for the rule.
|
26
26
|
attr_accessor :name
|
27
27
|
|
28
|
+
# Action types for a rule. Supported action values are default, block, log, off. The default action value follows the current protection mode of the associated service.
|
28
29
|
attr_accessor :action
|
29
30
|
|
30
31
|
# Alphanumeric string identifying the customer.
|
@@ -82,7 +83,7 @@ module Fastly
|
|
82
83
|
:'updated_at' => :'Time',
|
83
84
|
:'id' => :'String',
|
84
85
|
:'name' => :'String',
|
85
|
-
:'action' => :'
|
86
|
+
:'action' => :'String',
|
86
87
|
:'customer_id' => :'String',
|
87
88
|
:'service_id' => :'String',
|
88
89
|
:'source_ip' => :'String',
|
@@ -19,6 +19,7 @@ module Fastly
|
|
19
19
|
# A human-readable name for the rule.
|
20
20
|
attr_accessor :name
|
21
21
|
|
22
|
+
# Action types for a rule. Supported action values are default, block, log, off. The default action value follows the current protection mode of the associated service.
|
22
23
|
attr_accessor :action
|
23
24
|
|
24
25
|
# Alphanumeric string identifying the customer.
|
@@ -72,7 +73,7 @@ module Fastly
|
|
72
73
|
{
|
73
74
|
:'id' => :'String',
|
74
75
|
:'name' => :'String',
|
75
|
-
:'action' => :'
|
76
|
+
:'action' => :'String',
|
76
77
|
:'customer_id' => :'String',
|
77
78
|
:'service_id' => :'String',
|
78
79
|
:'source_ip' => :'String',
|
@@ -0,0 +1,219 @@
|
|
1
|
+
=begin
|
2
|
+
#Fastly API
|
3
|
+
|
4
|
+
#Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
Contact: oss@fastly.com
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'date'
|
12
|
+
require 'time'
|
13
|
+
|
14
|
+
module Fastly
|
15
|
+
class DdosProtectionRulePatch
|
16
|
+
# Action types for a rule. Supported action values are default, block, log, off. The default action value follows the current protection mode of the associated service.
|
17
|
+
attr_accessor :action
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'action' => :'action'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Returns all the JSON keys this model knows about
|
27
|
+
def self.acceptable_attributes
|
28
|
+
attribute_map.values
|
29
|
+
end
|
30
|
+
|
31
|
+
# Attribute type mapping.
|
32
|
+
def self.fastly_types
|
33
|
+
{
|
34
|
+
:'action' => :'String'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# List of attributes with nullable: true
|
39
|
+
def self.fastly_nullable
|
40
|
+
Set.new([
|
41
|
+
])
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
if (!attributes.is_a?(Hash))
|
48
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::DdosProtectionRulePatch` initialize method"
|
49
|
+
end
|
50
|
+
|
51
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
54
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::DdosProtectionRulePatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
55
|
+
end
|
56
|
+
h[k.to_sym] = v
|
57
|
+
}
|
58
|
+
|
59
|
+
if attributes.key?(:'action')
|
60
|
+
self.action = attributes[:'action']
|
61
|
+
else
|
62
|
+
self.action = 'default'
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
67
|
+
# @return Array for valid properties with the reasons
|
68
|
+
def list_invalid_properties
|
69
|
+
invalid_properties = Array.new
|
70
|
+
invalid_properties
|
71
|
+
end
|
72
|
+
|
73
|
+
# Check to see if the all the properties in the model are valid
|
74
|
+
# @return true if the model is valid
|
75
|
+
def valid?
|
76
|
+
true
|
77
|
+
end
|
78
|
+
|
79
|
+
# Checks equality by comparing each attribute.
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def ==(o)
|
82
|
+
return true if self.equal?(o)
|
83
|
+
self.class == o.class &&
|
84
|
+
action == o.action
|
85
|
+
end
|
86
|
+
|
87
|
+
# @see the `==` method
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def eql?(o)
|
90
|
+
self == o
|
91
|
+
end
|
92
|
+
|
93
|
+
# Calculates hash code according to all attributes.
|
94
|
+
# @return [Integer] Hash code
|
95
|
+
def hash
|
96
|
+
[action].hash
|
97
|
+
end
|
98
|
+
|
99
|
+
# Builds the object from hash
|
100
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
101
|
+
# @return [Object] Returns the model itself
|
102
|
+
def self.build_from_hash(attributes)
|
103
|
+
new.build_from_hash(attributes)
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def build_from_hash(attributes)
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
111
|
+
self.class.fastly_types.each_pair do |key, type|
|
112
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
113
|
+
self.send("#{key}=", nil)
|
114
|
+
elsif type =~ /\AArray<(.*)>/i
|
115
|
+
# check to ensure the input is an array given that the attribute
|
116
|
+
# is documented as an array but the input is not
|
117
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
119
|
+
end
|
120
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
self
|
126
|
+
end
|
127
|
+
|
128
|
+
# Deserializes the data based on type
|
129
|
+
# @param string type Data type
|
130
|
+
# @param string value Value to be deserialized
|
131
|
+
# @return [Object] Deserialized data
|
132
|
+
def _deserialize(type, value)
|
133
|
+
case type.to_sym
|
134
|
+
when :Time
|
135
|
+
Time.parse(value)
|
136
|
+
when :Date
|
137
|
+
Date.parse(value)
|
138
|
+
when :String
|
139
|
+
value.to_s
|
140
|
+
when :Integer
|
141
|
+
value.to_i
|
142
|
+
when :Float
|
143
|
+
value.to_f
|
144
|
+
when :Boolean
|
145
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
146
|
+
true
|
147
|
+
else
|
148
|
+
false
|
149
|
+
end
|
150
|
+
when :Object
|
151
|
+
# generic object (usually a Hash), return directly
|
152
|
+
value
|
153
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
154
|
+
inner_type = Regexp.last_match[:inner_type]
|
155
|
+
value.map { |v| _deserialize(inner_type, v) }
|
156
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
157
|
+
k_type = Regexp.last_match[:k_type]
|
158
|
+
v_type = Regexp.last_match[:v_type]
|
159
|
+
{}.tap do |hash|
|
160
|
+
value.each do |k, v|
|
161
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
else # model
|
165
|
+
# models (e.g. Pet) or oneOf
|
166
|
+
klass = Fastly.const_get(type)
|
167
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
if value.nil?
|
190
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
|
+
end
|
193
|
+
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|