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,252 @@
|
|
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 AttackSignal
|
16
|
+
# Name of the attack signal tag
|
17
|
+
attr_accessor :tag_name
|
18
|
+
|
19
|
+
# Count of requests with this attack signal
|
20
|
+
attr_accessor :tag_count
|
21
|
+
|
22
|
+
# Total number of attacks considered
|
23
|
+
attr_accessor :total_count
|
24
|
+
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
26
|
+
def self.attribute_map
|
27
|
+
{
|
28
|
+
:'tag_name' => :'tag_name',
|
29
|
+
:'tag_count' => :'tag_count',
|
30
|
+
:'total_count' => :'total_count'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns all the JSON keys this model knows about
|
35
|
+
def self.acceptable_attributes
|
36
|
+
attribute_map.values
|
37
|
+
end
|
38
|
+
|
39
|
+
# Attribute type mapping.
|
40
|
+
def self.fastly_types
|
41
|
+
{
|
42
|
+
:'tag_name' => :'String',
|
43
|
+
:'tag_count' => :'Integer',
|
44
|
+
:'total_count' => :'Integer'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# List of attributes with nullable: true
|
49
|
+
def self.fastly_nullable
|
50
|
+
Set.new([
|
51
|
+
])
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
if (!attributes.is_a?(Hash))
|
58
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::AttackSignal` initialize method"
|
59
|
+
end
|
60
|
+
|
61
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
62
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
63
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
64
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::AttackSignal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
65
|
+
end
|
66
|
+
h[k.to_sym] = v
|
67
|
+
}
|
68
|
+
|
69
|
+
if attributes.key?(:'tag_name')
|
70
|
+
self.tag_name = attributes[:'tag_name']
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.key?(:'tag_count')
|
74
|
+
self.tag_count = attributes[:'tag_count']
|
75
|
+
end
|
76
|
+
|
77
|
+
if attributes.key?(:'total_count')
|
78
|
+
self.total_count = attributes[:'total_count']
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
83
|
+
# @return Array for valid properties with the reasons
|
84
|
+
def list_invalid_properties
|
85
|
+
invalid_properties = Array.new
|
86
|
+
if @tag_name.nil?
|
87
|
+
invalid_properties.push('invalid value for "tag_name", tag_name cannot be nil.')
|
88
|
+
end
|
89
|
+
|
90
|
+
if @tag_count.nil?
|
91
|
+
invalid_properties.push('invalid value for "tag_count", tag_count cannot be nil.')
|
92
|
+
end
|
93
|
+
|
94
|
+
if @total_count.nil?
|
95
|
+
invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
|
96
|
+
end
|
97
|
+
|
98
|
+
invalid_properties
|
99
|
+
end
|
100
|
+
|
101
|
+
# Check to see if the all the properties in the model are valid
|
102
|
+
# @return true if the model is valid
|
103
|
+
def valid?
|
104
|
+
return false if @tag_name.nil?
|
105
|
+
return false if @tag_count.nil?
|
106
|
+
return false if @total_count.nil?
|
107
|
+
true
|
108
|
+
end
|
109
|
+
|
110
|
+
# Checks equality by comparing each attribute.
|
111
|
+
# @param [Object] Object to be compared
|
112
|
+
def ==(o)
|
113
|
+
return true if self.equal?(o)
|
114
|
+
self.class == o.class &&
|
115
|
+
tag_name == o.tag_name &&
|
116
|
+
tag_count == o.tag_count &&
|
117
|
+
total_count == o.total_count
|
118
|
+
end
|
119
|
+
|
120
|
+
# @see the `==` method
|
121
|
+
# @param [Object] Object to be compared
|
122
|
+
def eql?(o)
|
123
|
+
self == o
|
124
|
+
end
|
125
|
+
|
126
|
+
# Calculates hash code according to all attributes.
|
127
|
+
# @return [Integer] Hash code
|
128
|
+
def hash
|
129
|
+
[tag_name, tag_count, total_count].hash
|
130
|
+
end
|
131
|
+
|
132
|
+
# Builds the object from hash
|
133
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
134
|
+
# @return [Object] Returns the model itself
|
135
|
+
def self.build_from_hash(attributes)
|
136
|
+
new.build_from_hash(attributes)
|
137
|
+
end
|
138
|
+
|
139
|
+
# Builds the object from hash
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
141
|
+
# @return [Object] Returns the model itself
|
142
|
+
def build_from_hash(attributes)
|
143
|
+
return nil unless attributes.is_a?(Hash)
|
144
|
+
self.class.fastly_types.each_pair do |key, type|
|
145
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
146
|
+
self.send("#{key}=", nil)
|
147
|
+
elsif type =~ /\AArray<(.*)>/i
|
148
|
+
# check to ensure the input is an array given that the attribute
|
149
|
+
# is documented as an array but the input is not
|
150
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
151
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
152
|
+
end
|
153
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
154
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
self
|
159
|
+
end
|
160
|
+
|
161
|
+
# Deserializes the data based on type
|
162
|
+
# @param string type Data type
|
163
|
+
# @param string value Value to be deserialized
|
164
|
+
# @return [Object] Deserialized data
|
165
|
+
def _deserialize(type, value)
|
166
|
+
case type.to_sym
|
167
|
+
when :Time
|
168
|
+
Time.parse(value)
|
169
|
+
when :Date
|
170
|
+
Date.parse(value)
|
171
|
+
when :String
|
172
|
+
value.to_s
|
173
|
+
when :Integer
|
174
|
+
value.to_i
|
175
|
+
when :Float
|
176
|
+
value.to_f
|
177
|
+
when :Boolean
|
178
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
179
|
+
true
|
180
|
+
else
|
181
|
+
false
|
182
|
+
end
|
183
|
+
when :Object
|
184
|
+
# generic object (usually a Hash), return directly
|
185
|
+
value
|
186
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
187
|
+
inner_type = Regexp.last_match[:inner_type]
|
188
|
+
value.map { |v| _deserialize(inner_type, v) }
|
189
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
190
|
+
k_type = Regexp.last_match[:k_type]
|
191
|
+
v_type = Regexp.last_match[:v_type]
|
192
|
+
{}.tap do |hash|
|
193
|
+
value.each do |k, v|
|
194
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
195
|
+
end
|
196
|
+
end
|
197
|
+
else # model
|
198
|
+
# models (e.g. Pet) or oneOf
|
199
|
+
klass = Fastly.const_get(type)
|
200
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the string representation of the object
|
205
|
+
# @return [String] String presentation of the object
|
206
|
+
def to_s
|
207
|
+
to_hash.to_s
|
208
|
+
end
|
209
|
+
|
210
|
+
# to_body is an alias to to_hash (backward compatibility)
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_body
|
213
|
+
to_hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns the object in the form of hash
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_hash
|
219
|
+
hash = {}
|
220
|
+
self.class.attribute_map.each_pair do |attr, param|
|
221
|
+
value = self.send(attr)
|
222
|
+
if value.nil?
|
223
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
224
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
225
|
+
end
|
226
|
+
|
227
|
+
hash[param] = _to_hash(value)
|
228
|
+
end
|
229
|
+
hash
|
230
|
+
end
|
231
|
+
|
232
|
+
# Outputs non-array value in the form of hash
|
233
|
+
# For object, use to_hash. Otherwise, just return the value
|
234
|
+
# @param [Object] value Any valid value
|
235
|
+
# @return [Hash] Returns the value in the form of hash
|
236
|
+
def _to_hash(value)
|
237
|
+
if value.is_a?(Array)
|
238
|
+
value.compact.map { |v| _to_hash(v) }
|
239
|
+
elsif value.is_a?(Hash)
|
240
|
+
{}.tap do |hash|
|
241
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
242
|
+
end
|
243
|
+
elsif value.respond_to? :to_hash
|
244
|
+
value.to_hash
|
245
|
+
else
|
246
|
+
value
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
end
|
251
|
+
|
252
|
+
end
|
@@ -0,0 +1,267 @@
|
|
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 AttackSource
|
16
|
+
# Country code of the attack source
|
17
|
+
attr_accessor :country_code
|
18
|
+
|
19
|
+
# Name of the country
|
20
|
+
attr_accessor :country_name
|
21
|
+
|
22
|
+
# Number of requests from this country
|
23
|
+
attr_accessor :request_count
|
24
|
+
|
25
|
+
# Total number of attacks considered
|
26
|
+
attr_accessor :total_count
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'country_code' => :'country_code',
|
32
|
+
:'country_name' => :'country_name',
|
33
|
+
:'request_count' => :'request_count',
|
34
|
+
:'total_count' => :'total_count'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Returns all the JSON keys this model knows about
|
39
|
+
def self.acceptable_attributes
|
40
|
+
attribute_map.values
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.fastly_types
|
45
|
+
{
|
46
|
+
:'country_code' => :'String',
|
47
|
+
:'country_name' => :'String',
|
48
|
+
:'request_count' => :'Integer',
|
49
|
+
:'total_count' => :'Integer'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# List of attributes with nullable: true
|
54
|
+
def self.fastly_nullable
|
55
|
+
Set.new([
|
56
|
+
])
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes the object
|
60
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
61
|
+
def initialize(attributes = {})
|
62
|
+
if (!attributes.is_a?(Hash))
|
63
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::AttackSource` initialize method"
|
64
|
+
end
|
65
|
+
|
66
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
67
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
68
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
69
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::AttackSource`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
70
|
+
end
|
71
|
+
h[k.to_sym] = v
|
72
|
+
}
|
73
|
+
|
74
|
+
if attributes.key?(:'country_code')
|
75
|
+
self.country_code = attributes[:'country_code']
|
76
|
+
end
|
77
|
+
|
78
|
+
if attributes.key?(:'country_name')
|
79
|
+
self.country_name = attributes[:'country_name']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'request_count')
|
83
|
+
self.request_count = attributes[:'request_count']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'total_count')
|
87
|
+
self.total_count = attributes[:'total_count']
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
92
|
+
# @return Array for valid properties with the reasons
|
93
|
+
def list_invalid_properties
|
94
|
+
invalid_properties = Array.new
|
95
|
+
if @country_code.nil?
|
96
|
+
invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
|
97
|
+
end
|
98
|
+
|
99
|
+
if @country_name.nil?
|
100
|
+
invalid_properties.push('invalid value for "country_name", country_name cannot be nil.')
|
101
|
+
end
|
102
|
+
|
103
|
+
if @request_count.nil?
|
104
|
+
invalid_properties.push('invalid value for "request_count", request_count cannot be nil.')
|
105
|
+
end
|
106
|
+
|
107
|
+
if @total_count.nil?
|
108
|
+
invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
|
109
|
+
end
|
110
|
+
|
111
|
+
invalid_properties
|
112
|
+
end
|
113
|
+
|
114
|
+
# Check to see if the all the properties in the model are valid
|
115
|
+
# @return true if the model is valid
|
116
|
+
def valid?
|
117
|
+
return false if @country_code.nil?
|
118
|
+
return false if @country_name.nil?
|
119
|
+
return false if @request_count.nil?
|
120
|
+
return false if @total_count.nil?
|
121
|
+
true
|
122
|
+
end
|
123
|
+
|
124
|
+
# Checks equality by comparing each attribute.
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def ==(o)
|
127
|
+
return true if self.equal?(o)
|
128
|
+
self.class == o.class &&
|
129
|
+
country_code == o.country_code &&
|
130
|
+
country_name == o.country_name &&
|
131
|
+
request_count == o.request_count &&
|
132
|
+
total_count == o.total_count
|
133
|
+
end
|
134
|
+
|
135
|
+
# @see the `==` method
|
136
|
+
# @param [Object] Object to be compared
|
137
|
+
def eql?(o)
|
138
|
+
self == o
|
139
|
+
end
|
140
|
+
|
141
|
+
# Calculates hash code according to all attributes.
|
142
|
+
# @return [Integer] Hash code
|
143
|
+
def hash
|
144
|
+
[country_code, country_name, request_count, total_count].hash
|
145
|
+
end
|
146
|
+
|
147
|
+
# Builds the object from hash
|
148
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
149
|
+
# @return [Object] Returns the model itself
|
150
|
+
def self.build_from_hash(attributes)
|
151
|
+
new.build_from_hash(attributes)
|
152
|
+
end
|
153
|
+
|
154
|
+
# Builds the object from hash
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
156
|
+
# @return [Object] Returns the model itself
|
157
|
+
def build_from_hash(attributes)
|
158
|
+
return nil unless attributes.is_a?(Hash)
|
159
|
+
self.class.fastly_types.each_pair do |key, type|
|
160
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
|
161
|
+
self.send("#{key}=", nil)
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
163
|
+
# check to ensure the input is an array given that the attribute
|
164
|
+
# is documented as an array but the input is not
|
165
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
166
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
167
|
+
end
|
168
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
169
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
self
|
174
|
+
end
|
175
|
+
|
176
|
+
# Deserializes the data based on type
|
177
|
+
# @param string type Data type
|
178
|
+
# @param string value Value to be deserialized
|
179
|
+
# @return [Object] Deserialized data
|
180
|
+
def _deserialize(type, value)
|
181
|
+
case type.to_sym
|
182
|
+
when :Time
|
183
|
+
Time.parse(value)
|
184
|
+
when :Date
|
185
|
+
Date.parse(value)
|
186
|
+
when :String
|
187
|
+
value.to_s
|
188
|
+
when :Integer
|
189
|
+
value.to_i
|
190
|
+
when :Float
|
191
|
+
value.to_f
|
192
|
+
when :Boolean
|
193
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
194
|
+
true
|
195
|
+
else
|
196
|
+
false
|
197
|
+
end
|
198
|
+
when :Object
|
199
|
+
# generic object (usually a Hash), return directly
|
200
|
+
value
|
201
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
202
|
+
inner_type = Regexp.last_match[:inner_type]
|
203
|
+
value.map { |v| _deserialize(inner_type, v) }
|
204
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
205
|
+
k_type = Regexp.last_match[:k_type]
|
206
|
+
v_type = Regexp.last_match[:v_type]
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each do |k, v|
|
209
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
210
|
+
end
|
211
|
+
end
|
212
|
+
else # model
|
213
|
+
# models (e.g. Pet) or oneOf
|
214
|
+
klass = Fastly.const_get(type)
|
215
|
+
klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
# Returns the string representation of the object
|
220
|
+
# @return [String] String presentation of the object
|
221
|
+
def to_s
|
222
|
+
to_hash.to_s
|
223
|
+
end
|
224
|
+
|
225
|
+
# to_body is an alias to to_hash (backward compatibility)
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
227
|
+
def to_body
|
228
|
+
to_hash
|
229
|
+
end
|
230
|
+
|
231
|
+
# Returns the object in the form of hash
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_hash
|
234
|
+
hash = {}
|
235
|
+
self.class.attribute_map.each_pair do |attr, param|
|
236
|
+
value = self.send(attr)
|
237
|
+
if value.nil?
|
238
|
+
is_nullable = self.class.fastly_nullable.include?(attr)
|
239
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
240
|
+
end
|
241
|
+
|
242
|
+
hash[param] = _to_hash(value)
|
243
|
+
end
|
244
|
+
hash
|
245
|
+
end
|
246
|
+
|
247
|
+
# Outputs non-array value in the form of hash
|
248
|
+
# For object, use to_hash. Otherwise, just return the value
|
249
|
+
# @param [Object] value Any valid value
|
250
|
+
# @return [Hash] Returns the value in the form of hash
|
251
|
+
def _to_hash(value)
|
252
|
+
if value.is_a?(Array)
|
253
|
+
value.compact.map { |v| _to_hash(v) }
|
254
|
+
elsif value.is_a?(Hash)
|
255
|
+
{}.tap do |hash|
|
256
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
257
|
+
end
|
258
|
+
elsif value.respond_to? :to_hash
|
259
|
+
value.to_hash
|
260
|
+
else
|
261
|
+
value
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
end
|
266
|
+
|
267
|
+
end
|
@@ -19,7 +19,7 @@ module Fastly
|
|
19
19
|
# Whether or not this backend should be automatically load balanced. If true, all backends with this setting that don't have a `request_condition` will be selected based on their `weight`.
|
20
20
|
attr_accessor :auto_loadbalance
|
21
21
|
|
22
|
-
# Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`.
|
22
|
+
# Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, for Delivery services, the response received so far will be considered complete and the fetch will end. For Compute services, timeout expiration is treated as a failure of the backend connection, and an error is generated. May be set at runtime using `bereq.between_bytes_timeout`.
|
23
23
|
attr_accessor :between_bytes_timeout
|
24
24
|
|
25
25
|
# Unused.
|
@@ -383,14 +383,20 @@ module Fastly
|
|
383
383
|
|
384
384
|
if attributes.key?(:'tcp_keepalive_interval')
|
385
385
|
self.tcp_keepalive_interval = attributes[:'tcp_keepalive_interval']
|
386
|
+
else
|
387
|
+
self.tcp_keepalive_interval = 10
|
386
388
|
end
|
387
389
|
|
388
390
|
if attributes.key?(:'tcp_keepalive_probes')
|
389
391
|
self.tcp_keepalive_probes = attributes[:'tcp_keepalive_probes']
|
392
|
+
else
|
393
|
+
self.tcp_keepalive_probes = 3
|
390
394
|
end
|
391
395
|
|
392
396
|
if attributes.key?(:'tcp_keepalive_time')
|
393
397
|
self.tcp_keepalive_time = attributes[:'tcp_keepalive_time']
|
398
|
+
else
|
399
|
+
self.tcp_keepalive_time = 300
|
394
400
|
end
|
395
401
|
|
396
402
|
if attributes.key?(:'use_ssl')
|
@@ -19,7 +19,7 @@ module Fastly
|
|
19
19
|
# Whether or not this backend should be automatically load balanced. If true, all backends with this setting that don't have a `request_condition` will be selected based on their `weight`.
|
20
20
|
attr_accessor :auto_loadbalance
|
21
21
|
|
22
|
-
# Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`.
|
22
|
+
# Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, for Delivery services, the response received so far will be considered complete and the fetch will end. For Compute services, timeout expiration is treated as a failure of the backend connection, and an error is generated. May be set at runtime using `bereq.between_bytes_timeout`.
|
23
23
|
attr_accessor :between_bytes_timeout
|
24
24
|
|
25
25
|
# Unused.
|
@@ -424,14 +424,20 @@ module Fastly
|
|
424
424
|
|
425
425
|
if attributes.key?(:'tcp_keepalive_interval')
|
426
426
|
self.tcp_keepalive_interval = attributes[:'tcp_keepalive_interval']
|
427
|
+
else
|
428
|
+
self.tcp_keepalive_interval = 10
|
427
429
|
end
|
428
430
|
|
429
431
|
if attributes.key?(:'tcp_keepalive_probes')
|
430
432
|
self.tcp_keepalive_probes = attributes[:'tcp_keepalive_probes']
|
433
|
+
else
|
434
|
+
self.tcp_keepalive_probes = 3
|
431
435
|
end
|
432
436
|
|
433
437
|
if attributes.key?(:'tcp_keepalive_time')
|
434
438
|
self.tcp_keepalive_time = attributes[:'tcp_keepalive_time']
|
439
|
+
else
|
440
|
+
self.tcp_keepalive_time = 300
|
435
441
|
end
|
436
442
|
|
437
443
|
if attributes.key?(:'use_ssl')
|
@@ -13,6 +13,7 @@ require 'time'
|
|
13
13
|
|
14
14
|
module Fastly
|
15
15
|
class DdosProtectionAttributeStats
|
16
|
+
# Name of an attribute type used in traffic stats. Currently, supported values are source_ip, country_code, host, asn, source_ip_prefix, user_agent, method_path.
|
16
17
|
attr_accessor :name
|
17
18
|
|
18
19
|
# Values for traffic attribute.
|
@@ -34,7 +35,7 @@ module Fastly
|
|
34
35
|
# Attribute type mapping.
|
35
36
|
def self.fastly_types
|
36
37
|
{
|
37
|
-
:'name' => :'
|
38
|
+
:'name' => :'String',
|
38
39
|
:'values' => :'Array<DdosProtectionAttributeValue>'
|
39
40
|
}
|
40
41
|
end
|