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.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +16 -4
  5. data/docs/AttackReport.md +19 -0
  6. data/docs/AttackSignal.md +12 -0
  7. data/docs/AttackSource.md +13 -0
  8. data/docs/Backend.md +4 -4
  9. data/docs/BackendApi.md +10 -10
  10. data/docs/BackendResponse.md +4 -4
  11. data/docs/DdosProtectionApi.md +40 -0
  12. data/docs/DdosProtectionAttributeStats.md +1 -1
  13. data/docs/DdosProtectionInvalidRequest.md +13 -0
  14. data/docs/{LogTimeseriesResultDimensions.md → DdosProtectionNotAuthorized.md} +3 -2
  15. data/docs/DdosProtectionRule.md +1 -1
  16. data/docs/DdosProtectionRuleAllOf.md +1 -1
  17. data/docs/DdosProtectionRulePatch.md +10 -0
  18. data/docs/HistoricalApi.md +2 -0
  19. data/docs/KvStoreApi.md +2 -0
  20. data/docs/ListAttackReport.md +11 -0
  21. data/docs/{DdosProtectionTrafficAttribute.md → ListAttackReportMeta.md} +2 -1
  22. data/docs/{DdosProtectionAction.md → ListSignalReport.md} +2 -1
  23. data/docs/LogExplorerApi.md +1 -1
  24. data/docs/NgwafReportsApi.md +99 -0
  25. data/docs/ObservabilityTimeseriesApi.md +67 -0
  26. data/docs/PoolApi.md +4 -4
  27. data/docs/PoolResponse.md +1 -1
  28. data/docs/PoolResponseCommon.md +1 -1
  29. data/docs/PoolResponsePost.md +1 -1
  30. data/docs/SignalReport.md +13 -0
  31. data/docs/TimeseriesGetResponse.md +11 -0
  32. data/docs/TimeseriesMeta.md +13 -0
  33. data/docs/TimeseriesResult.md +11 -0
  34. data/docs/TlsSubscriptionsApi.md +0 -2
  35. data/docs/TopWorkspace.md +12 -0
  36. data/lib/fastly/api/backend_api.rb +16 -16
  37. data/lib/fastly/api/ddos_protection_api.rb +70 -0
  38. data/lib/fastly/api/historical_api.rb +3 -0
  39. data/lib/fastly/api/kv_store_api.rb +3 -0
  40. data/lib/fastly/api/ngwaf_reports_api.rb +161 -0
  41. data/lib/fastly/api/{observability_timeseries_for_logs_api.rb → observability_timeseries_api.rb} +38 -43
  42. data/lib/fastly/api/pool_api.rb +4 -4
  43. data/lib/fastly/api/tls_subscriptions_api.rb +0 -3
  44. data/lib/fastly/configuration.rb +19 -1
  45. data/lib/fastly/models/attack_report.rb +359 -0
  46. data/lib/fastly/models/attack_signal.rb +252 -0
  47. data/lib/fastly/models/attack_source.rb +267 -0
  48. data/lib/fastly/models/backend.rb +7 -1
  49. data/lib/fastly/models/backend_response.rb +7 -1
  50. data/lib/fastly/models/ddos_protection_attribute_stats.rb +2 -1
  51. data/lib/fastly/models/ddos_protection_invalid_request.rb +309 -0
  52. data/lib/fastly/models/{log_timeseries_filter_field_item.rb → ddos_protection_not_authorized.rb} +24 -36
  53. data/lib/fastly/models/ddos_protection_rule.rb +2 -1
  54. data/lib/fastly/models/ddos_protection_rule_all_of.rb +2 -1
  55. data/lib/fastly/models/ddos_protection_rule_patch.rb +219 -0
  56. data/lib/fastly/models/{log_timeseries_get_response.rb → list_attack_report.rb} +5 -5
  57. data/lib/fastly/models/list_attack_report_meta.rb +218 -0
  58. data/lib/fastly/models/{log_timeseries_result_dimensions.rb → list_signal_report.rb} +12 -10
  59. data/lib/fastly/models/pool_response.rb +1 -1
  60. data/lib/fastly/models/pool_response_common.rb +1 -1
  61. data/lib/fastly/models/pool_response_post.rb +1 -1
  62. data/lib/fastly/models/signal_report.rb +249 -0
  63. data/lib/fastly/models/{log_timeseries_get_response_meta_filters.rb → timeseries_get_response.rb} +20 -13
  64. data/lib/fastly/models/{log_timeseries_get_response_meta.rb → timeseries_meta.rb} +23 -32
  65. data/lib/fastly/models/{log_timeseries_result.rb → timeseries_result.rb} +9 -5
  66. data/lib/fastly/models/top_workspace.rb +238 -0
  67. data/lib/fastly/version.rb +1 -1
  68. data/lib/fastly.rb +16 -10
  69. data/sig.json +1 -1
  70. metadata +34 -22
  71. data/docs/LogTimeseriesFilterFieldItem.md +0 -12
  72. data/docs/LogTimeseriesGetResponse.md +0 -11
  73. data/docs/LogTimeseriesGetResponseMeta.md +0 -14
  74. data/docs/LogTimeseriesGetResponseMetaFilters.md +0 -10
  75. data/docs/LogTimeseriesResult.md +0 -11
  76. data/docs/LogTimeseriesValueField.md +0 -59
  77. data/docs/ObservabilityTimeseriesForLogsApi.md +0 -67
  78. data/lib/fastly/models/ddos_protection_action.rb +0 -37
  79. data/lib/fastly/models/ddos_protection_traffic_attribute.rb +0 -40
  80. data/lib/fastly/models/log_timeseries_value_field.rb +0 -108
@@ -12,7 +12,7 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class LogTimeseriesGetResponse
15
+ class ListAttackReport
16
16
  attr_accessor :data
17
17
 
18
18
  attr_accessor :meta
@@ -33,8 +33,8 @@ module Fastly
33
33
  # Attribute type mapping.
34
34
  def self.fastly_types
35
35
  {
36
- :'data' => :'Array<LogTimeseriesResult>',
37
- :'meta' => :'LogTimeseriesGetResponseMeta'
36
+ :'data' => :'Array<AttackReport>',
37
+ :'meta' => :'ListAttackReportMeta'
38
38
  }
39
39
  end
40
40
 
@@ -48,13 +48,13 @@ module Fastly
48
48
  # @param [Hash] attributes Model attributes in the form of hash
49
49
  def initialize(attributes = {})
50
50
  if (!attributes.is_a?(Hash))
51
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LogTimeseriesGetResponse` initialize method"
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ListAttackReport` initialize method"
52
52
  end
53
53
 
54
54
  # check to see if the attribute exists and convert string to symbol for hash key
55
55
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
56
  if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::LogTimeseriesGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ListAttackReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
58
  end
59
59
  h[k.to_sym] = v
60
60
  }
@@ -0,0 +1,218 @@
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
+ # Metadata about the request.
16
+ class ListAttackReportMeta
17
+ # The count of attack reports matching the filter.
18
+ attr_accessor :total
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'total' => :'total'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.fastly_types
34
+ {
35
+ :'total' => :'Integer'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.fastly_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ListAttackReportMeta` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ListAttackReportMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'total')
61
+ self.total = attributes[:'total']
62
+ end
63
+ end
64
+
65
+ # Show invalid properties with the reasons. Usually used together with valid?
66
+ # @return Array for valid properties with the reasons
67
+ def list_invalid_properties
68
+ invalid_properties = Array.new
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ total == o.total
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [total].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.fastly_types.each_pair do |key, type|
111
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
112
+ self.send("#{key}=", nil)
113
+ elsif type =~ /\AArray<(.*)>/i
114
+ # check to ensure the input is an array given that the attribute
115
+ # is documented as an array but the input is not
116
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
117
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
118
+ end
119
+ elsif !attributes[self.class.attribute_map[key]].nil?
120
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :Time
134
+ Time.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ # models (e.g. Pet) or oneOf
165
+ klass = Fastly.const_get(type)
166
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
167
+ end
168
+ end
169
+
170
+ # Returns the string representation of the object
171
+ # @return [String] String presentation of the object
172
+ def to_s
173
+ to_hash.to_s
174
+ end
175
+
176
+ # to_body is an alias to to_hash (backward compatibility)
177
+ # @return [Hash] Returns the object in the form of hash
178
+ def to_body
179
+ to_hash
180
+ end
181
+
182
+ # Returns the object in the form of hash
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_hash
185
+ hash = {}
186
+ self.class.attribute_map.each_pair do |attr, param|
187
+ value = self.send(attr)
188
+ if value.nil?
189
+ is_nullable = self.class.fastly_nullable.include?(attr)
190
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
191
+ end
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ # Outputs non-array value in the form of hash
199
+ # For object, use to_hash. Otherwise, just return the value
200
+ # @param [Object] value Any valid value
201
+ # @return [Hash] Returns the value in the form of hash
202
+ def _to_hash(value)
203
+ if value.is_a?(Array)
204
+ value.compact.map { |v| _to_hash(v) }
205
+ elsif value.is_a?(Hash)
206
+ {}.tap do |hash|
207
+ value.each { |k, v| hash[k] = _to_hash(v) }
208
+ end
209
+ elsif value.respond_to? :to_hash
210
+ value.to_hash
211
+ else
212
+ value
213
+ end
214
+ end
215
+
216
+ end
217
+
218
+ end
@@ -12,13 +12,13 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class LogTimeseriesResultDimensions
16
- attr_accessor :time
15
+ class ListSignalReport
16
+ attr_accessor :data
17
17
 
18
18
  # Attribute mapping from ruby-style variable name to JSON key.
19
19
  def self.attribute_map
20
20
  {
21
- :'time' => :'time'
21
+ :'data' => :'data'
22
22
  }
23
23
  end
24
24
 
@@ -30,7 +30,7 @@ module Fastly
30
30
  # Attribute type mapping.
31
31
  def self.fastly_types
32
32
  {
33
- :'time' => :'String'
33
+ :'data' => :'Array<SignalReport>'
34
34
  }
35
35
  end
36
36
 
@@ -44,19 +44,21 @@ module Fastly
44
44
  # @param [Hash] attributes Model attributes in the form of hash
45
45
  def initialize(attributes = {})
46
46
  if (!attributes.is_a?(Hash))
47
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LogTimeseriesResultDimensions` initialize method"
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ListSignalReport` initialize method"
48
48
  end
49
49
 
50
50
  # check to see if the attribute exists and convert string to symbol for hash key
51
51
  attributes = attributes.each_with_object({}) { |(k, v), h|
52
52
  if (!self.class.attribute_map.key?(k.to_sym))
53
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::LogTimeseriesResultDimensions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ListSignalReport`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
54
  end
55
55
  h[k.to_sym] = v
56
56
  }
57
57
 
58
- if attributes.key?(:'time')
59
- self.time = attributes[:'time']
58
+ if attributes.key?(:'data')
59
+ if (value = attributes[:'data']).is_a?(Array)
60
+ self.data = value
61
+ end
60
62
  end
61
63
  end
62
64
 
@@ -78,7 +80,7 @@ module Fastly
78
80
  def ==(o)
79
81
  return true if self.equal?(o)
80
82
  self.class == o.class &&
81
- time == o.time
83
+ data == o.data
82
84
  end
83
85
 
84
86
  # @see the `==` method
@@ -90,7 +92,7 @@ module Fastly
90
92
  # Calculates hash code according to all attributes.
91
93
  # @return [Integer] Hash code
92
94
  def hash
93
- [time].hash
95
+ [data].hash
94
96
  end
95
97
 
96
98
  # Builds the object from hash
@@ -74,7 +74,7 @@ module Fastly
74
74
  # The hostname to [override the Host header](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/specifying-an-override-host/). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting.
75
75
  attr_accessor :override_host
76
76
 
77
- # 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`.
77
+ # 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`.
78
78
  attr_accessor :between_bytes_timeout
79
79
 
80
80
  # How long to wait for a timeout in milliseconds.
@@ -13,7 +13,7 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class PoolResponseCommon
16
- # 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`.
16
+ # 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`.
17
17
  attr_accessor :between_bytes_timeout
18
18
 
19
19
  # How long to wait for a timeout in milliseconds.
@@ -74,7 +74,7 @@ module Fastly
74
74
  # The hostname to [override the Host header](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/specifying-an-override-host/). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting.
75
75
  attr_accessor :override_host
76
76
 
77
- # 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`.
77
+ # 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`.
78
78
  attr_accessor :between_bytes_timeout
79
79
 
80
80
  # How long to wait for a timeout in milliseconds.
@@ -0,0 +1,249 @@
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 SignalReport
16
+ # Name of the attack type.
17
+ attr_accessor :name
18
+
19
+ # Display name of the attack type.
20
+ attr_accessor :display_name
21
+
22
+ # Total count of attacks of this type.
23
+ attr_accessor :count
24
+
25
+ # Top workspaces affected by this attack type.
26
+ attr_accessor :top_workspaces
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'name' => :'name',
32
+ :'display_name' => :'display_name',
33
+ :'count' => :'count',
34
+ :'top_workspaces' => :'top_workspaces'
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
+ :'name' => :'String',
47
+ :'display_name' => :'String',
48
+ :'count' => :'Integer',
49
+ :'top_workspaces' => :'Array<TopWorkspace>'
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::SignalReport` 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::SignalReport`. 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?(:'name')
75
+ self.name = attributes[:'name']
76
+ end
77
+
78
+ if attributes.key?(:'display_name')
79
+ self.display_name = attributes[:'display_name']
80
+ end
81
+
82
+ if attributes.key?(:'count')
83
+ self.count = attributes[:'count']
84
+ end
85
+
86
+ if attributes.key?(:'top_workspaces')
87
+ if (value = attributes[:'top_workspaces']).is_a?(Array)
88
+ self.top_workspaces = value
89
+ end
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ name == o.name &&
112
+ display_name == o.display_name &&
113
+ count == o.count &&
114
+ top_workspaces == o.top_workspaces
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [name, display_name, count, top_workspaces].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ self.class.fastly_types.each_pair do |key, type|
142
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
143
+ self.send("#{key}=", nil)
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ end
153
+ end
154
+
155
+ self
156
+ end
157
+
158
+ # Deserializes the data based on type
159
+ # @param string type Data type
160
+ # @param string value Value to be deserialized
161
+ # @return [Object] Deserialized data
162
+ def _deserialize(type, value)
163
+ case type.to_sym
164
+ when :Time
165
+ Time.parse(value)
166
+ when :Date
167
+ Date.parse(value)
168
+ when :String
169
+ value.to_s
170
+ when :Integer
171
+ value.to_i
172
+ when :Float
173
+ value.to_f
174
+ when :Boolean
175
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
176
+ true
177
+ else
178
+ false
179
+ end
180
+ when :Object
181
+ # generic object (usually a Hash), return directly
182
+ value
183
+ when /\AArray<(?<inner_type>.+)>\z/
184
+ inner_type = Regexp.last_match[:inner_type]
185
+ value.map { |v| _deserialize(inner_type, v) }
186
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
187
+ k_type = Regexp.last_match[:k_type]
188
+ v_type = Regexp.last_match[:v_type]
189
+ {}.tap do |hash|
190
+ value.each do |k, v|
191
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
192
+ end
193
+ end
194
+ else # model
195
+ # models (e.g. Pet) or oneOf
196
+ klass = Fastly.const_get(type)
197
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.fastly_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end
246
+
247
+ end
248
+
249
+ end
@@ -12,14 +12,16 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- # Echoes the filters that were supplied in the request.
16
- class LogTimeseriesGetResponseMetaFilters
17
- attr_accessor :filter_fields
15
+ class TimeseriesGetResponse
16
+ attr_accessor :data
17
+
18
+ attr_accessor :meta
18
19
 
19
20
  # Attribute mapping from ruby-style variable name to JSON key.
20
21
  def self.attribute_map
21
22
  {
22
- :'filter_fields' => :'filter_fields'
23
+ :'data' => :'data',
24
+ :'meta' => :'meta'
23
25
  }
24
26
  end
25
27
 
@@ -31,14 +33,14 @@ module Fastly
31
33
  # Attribute type mapping.
32
34
  def self.fastly_types
33
35
  {
34
- :'filter_fields' => :'Array<LogTimeseriesFilterFieldItem>'
36
+ :'data' => :'Array<TimeseriesResult>',
37
+ :'meta' => :'TimeseriesMeta'
35
38
  }
36
39
  end
37
40
 
38
41
  # List of attributes with nullable: true
39
42
  def self.fastly_nullable
40
43
  Set.new([
41
- :'filter_fields'
42
44
  ])
43
45
  end
44
46
 
@@ -46,22 +48,26 @@ module Fastly
46
48
  # @param [Hash] attributes Model attributes in the form of hash
47
49
  def initialize(attributes = {})
48
50
  if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LogTimeseriesGetResponseMetaFilters` initialize method"
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::TimeseriesGetResponse` initialize method"
50
52
  end
51
53
 
52
54
  # check to see if the attribute exists and convert string to symbol for hash key
53
55
  attributes = attributes.each_with_object({}) { |(k, v), h|
54
56
  if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::LogTimeseriesGetResponseMetaFilters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::TimeseriesGetResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
58
  end
57
59
  h[k.to_sym] = v
58
60
  }
59
61
 
60
- if attributes.key?(:'filter_fields')
61
- if (value = attributes[:'filter_fields']).is_a?(Array)
62
- self.filter_fields = value
62
+ if attributes.key?(:'data')
63
+ if (value = attributes[:'data']).is_a?(Array)
64
+ self.data = value
63
65
  end
64
66
  end
67
+
68
+ if attributes.key?(:'meta')
69
+ self.meta = attributes[:'meta']
70
+ end
65
71
  end
66
72
 
67
73
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -82,7 +88,8 @@ module Fastly
82
88
  def ==(o)
83
89
  return true if self.equal?(o)
84
90
  self.class == o.class &&
85
- filter_fields == o.filter_fields
91
+ data == o.data &&
92
+ meta == o.meta
86
93
  end
87
94
 
88
95
  # @see the `==` method
@@ -94,7 +101,7 @@ module Fastly
94
101
  # Calculates hash code according to all attributes.
95
102
  # @return [Integer] Hash code
96
103
  def hash
97
- [filter_fields].hash
104
+ [data, meta].hash
98
105
  end
99
106
 
100
107
  # Builds the object from hash