fastly 5.2.2 → 5.3.1

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +4 -3
  5. data/docs/AutomationTokenCreateResponse.md +3 -3
  6. data/docs/AutomationTokenCreateResponseAllOf.md +3 -3
  7. data/docs/AutomationTokenResponse.md +2 -2
  8. data/docs/AutomationTokenResponseAllOf.md +2 -2
  9. data/docs/AutomationTokensApi.md +4 -3
  10. data/docs/Batch.md +12 -0
  11. data/docs/BatchErrors.md +13 -0
  12. data/docs/ErrorResponse.md +13 -0
  13. data/docs/HistoricalFieldResultsAttributes.md +1 -1
  14. data/docs/HistoricalFieldResultsAttributesAllOf.md +1 -1
  15. data/docs/RateLimiter.md +1 -1
  16. data/docs/RateLimiterApi.md +122 -0
  17. data/docs/RateLimiterResponse.md +1 -1
  18. data/docs/ReadOnlyCustomerId.md +9 -0
  19. data/docs/ReadOnlyId.md +9 -0
  20. data/docs/ReadOnlyIdService.md +9 -0
  21. data/docs/ReadOnlyUserId.md +9 -0
  22. data/docs/SchemasSnippetResponse.md +1 -1
  23. data/docs/Snippet.md +1 -1
  24. data/docs/SnippetApi.md +4 -4
  25. data/docs/SnippetResponse.md +1 -1
  26. data/docs/TokensAdditionalProps.md +9 -0
  27. data/docs/ValidatorResult.md +1 -5
  28. data/docs/ValidatorResultData.md +12 -0
  29. data/docs/ValidatorResultDataAttributes.md +14 -0
  30. data/docs/{ValidatorResultMessages.md → ValidatorResultDataAttributesMessages.md} +2 -2
  31. data/docs/VclApi.md +8 -6
  32. data/docs/VclSyntaxHighlightingResponse.md +10 -0
  33. data/lib/fastly/api/automation_tokens_api.rb +5 -5
  34. data/lib/fastly/api/rate_limiter_api.rb +345 -0
  35. data/lib/fastly/api/snippet_api.rb +6 -6
  36. data/lib/fastly/api/vcl_api.rb +10 -10
  37. data/lib/fastly/configuration.rb +12 -0
  38. data/lib/fastly/models/automation_token_create_request_attributes.rb +0 -1
  39. data/lib/fastly/models/automation_token_create_response.rb +3 -6
  40. data/lib/fastly/models/automation_token_create_response_all_of.rb +3 -6
  41. data/lib/fastly/models/automation_token_response.rb +2 -4
  42. data/lib/fastly/models/automation_token_response_all_of.rb +2 -4
  43. data/lib/fastly/models/batch.rb +239 -0
  44. data/lib/fastly/models/batch_errors.rb +247 -0
  45. data/lib/fastly/models/error_response.rb +245 -0
  46. data/lib/fastly/models/historical_field_results_attributes.rb +1 -2
  47. data/lib/fastly/models/historical_field_results_attributes_all_of.rb +1 -2
  48. data/lib/fastly/models/rate_limiter.rb +5 -2
  49. data/lib/fastly/models/rate_limiter_response.rb +5 -2
  50. data/lib/fastly/models/read_only_customer_id.rb +207 -0
  51. data/lib/fastly/models/read_only_id.rb +207 -0
  52. data/lib/fastly/models/read_only_id_service.rb +207 -0
  53. data/lib/fastly/models/read_only_user_id.rb +207 -0
  54. data/lib/fastly/models/schemas_snippet_response.rb +3 -3
  55. data/lib/fastly/models/snippet.rb +3 -3
  56. data/lib/fastly/models/snippet_response.rb +3 -3
  57. data/lib/fastly/models/tokens_additional_props.rb +227 -0
  58. data/lib/fastly/models/validator_result.rb +7 -84
  59. data/lib/fastly/models/validator_result_data.rb +234 -0
  60. data/lib/fastly/models/{rate_limiter_response1.rb → validator_result_data_attributes.rb} +71 -70
  61. data/lib/fastly/models/{validator_result_messages.rb → validator_result_data_attributes_messages.rb} +4 -4
  62. data/lib/fastly/models/vcl_syntax_highlighting_response.rb +217 -0
  63. data/lib/fastly/version.rb +1 -1
  64. data/lib/fastly.rb +12 -2
  65. data/sig.json +1 -1
  66. metadata +26 -6
  67. data/docs/RateLimiterResponse1.md +0 -12
@@ -0,0 +1,245 @@
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://developer.fastly.com/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 ErrorResponse
16
+ attr_accessor :detail
17
+
18
+ attr_accessor :errors
19
+
20
+ attr_accessor :status
21
+
22
+ attr_accessor :title
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'detail' => :'detail',
28
+ :'errors' => :'errors',
29
+ :'status' => :'status',
30
+ :'title' => :'title'
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
+ :'detail' => :'String',
43
+ :'errors' => :'Array<Object>',
44
+ :'status' => :'Integer',
45
+ :'title' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.fastly_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ErrorResponse` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'detail')
71
+ self.detail = attributes[:'detail']
72
+ end
73
+
74
+ if attributes.key?(:'errors')
75
+ if (value = attributes[:'errors']).is_a?(Array)
76
+ self.errors = value
77
+ end
78
+ end
79
+
80
+ if attributes.key?(:'status')
81
+ self.status = attributes[:'status']
82
+ end
83
+
84
+ if attributes.key?(:'title')
85
+ self.title = attributes[:'title']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ detail == o.detail &&
108
+ errors == o.errors &&
109
+ status == o.status &&
110
+ title == o.title
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [detail, errors, status, title].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ self.class.fastly_types.each_pair do |key, type|
138
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
139
+ self.send("#{key}=", nil)
140
+ elsif type =~ /\AArray<(.*)>/i
141
+ # check to ensure the input is an array given that the attribute
142
+ # is documented as an array but the input is not
143
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
144
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
145
+ end
146
+ elsif !attributes[self.class.attribute_map[key]].nil?
147
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
148
+ end
149
+ end
150
+
151
+ self
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def _deserialize(type, value)
159
+ case type.to_sym
160
+ when :Time
161
+ Time.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ # models (e.g. Pet) or oneOf
192
+ klass = Fastly.const_get(type)
193
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.fastly_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+
243
+ end
244
+
245
+ end
@@ -1113,7 +1113,7 @@ module Fastly
1113
1113
  :'ddos_action_tarpit' => :'Integer',
1114
1114
  :'ddos_action_close' => :'Integer',
1115
1115
  :'ddos_action_blackhole' => :'Integer',
1116
- :'service_id' => :'String',
1116
+ :'service_id' => :'ReadOnlyIdService',
1117
1117
  :'start_time' => :'Integer'
1118
1118
  }
1119
1119
  end
@@ -1122,7 +1122,6 @@ module Fastly
1122
1122
  def self.fastly_nullable
1123
1123
  Set.new([
1124
1124
  :'hit_ratio',
1125
- :'service_id',
1126
1125
  ])
1127
1126
  end
1128
1127
 
@@ -33,7 +33,7 @@ module Fastly
33
33
  # Attribute type mapping.
34
34
  def self.fastly_types
35
35
  {
36
- :'service_id' => :'String',
36
+ :'service_id' => :'ReadOnlyIdService',
37
37
  :'start_time' => :'Integer'
38
38
  }
39
39
  end
@@ -41,7 +41,6 @@ module Fastly
41
41
  # List of attributes with nullable: true
42
42
  def self.fastly_nullable
43
43
  Set.new([
44
- :'service_id',
45
44
  ])
46
45
  end
47
46
 
@@ -37,6 +37,7 @@ module Fastly
37
37
  # The action to take when a rate limiter violation is detected.
38
38
  attr_accessor :action
39
39
 
40
+ # Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`.
40
41
  attr_accessor :response
41
42
 
42
43
  # Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration.
@@ -104,7 +105,7 @@ module Fastly
104
105
  :'client_key' => :'Array<String>',
105
106
  :'penalty_box_duration' => :'Integer',
106
107
  :'action' => :'String',
107
- :'response' => :'RateLimiterResponse1',
108
+ :'response' => :'Hash<String, String>',
108
109
  :'response_object_name' => :'String',
109
110
  :'logger_type' => :'String',
110
111
  :'feature_revision' => :'Integer'
@@ -172,7 +173,9 @@ module Fastly
172
173
  end
173
174
 
174
175
  if attributes.key?(:'response')
175
- self.response = attributes[:'response']
176
+ if (value = attributes[:'response']).is_a?(Hash)
177
+ self.response = value
178
+ end
176
179
  end
177
180
 
178
181
  if attributes.key?(:'response_object_name')
@@ -37,6 +37,7 @@ module Fastly
37
37
  # The action to take when a rate limiter violation is detected.
38
38
  attr_accessor :action
39
39
 
40
+ # Custom response to be sent when the rate limit is exceeded. Required if `action` is `response`.
40
41
  attr_accessor :response
41
42
 
42
43
  # Name of existing response object. Required if `action` is `response_object`. Note that the rate limiter response is only updated to reflect the response object content when saving the rate limiter configuration.
@@ -126,7 +127,7 @@ module Fastly
126
127
  :'client_key' => :'Array<String>',
127
128
  :'penalty_box_duration' => :'Integer',
128
129
  :'action' => :'String',
129
- :'response' => :'RateLimiterResponse1',
130
+ :'response' => :'Hash<String, String>',
130
131
  :'response_object_name' => :'String',
131
132
  :'logger_type' => :'String',
132
133
  :'feature_revision' => :'Integer',
@@ -213,7 +214,9 @@ module Fastly
213
214
  end
214
215
 
215
216
  if attributes.key?(:'response')
216
- self.response = attributes[:'response']
217
+ if (value = attributes[:'response']).is_a?(Hash)
218
+ self.response = value
219
+ end
217
220
  end
218
221
 
219
222
  if attributes.key?(:'response_object_name')
@@ -0,0 +1,207 @@
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://developer.fastly.com/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 ReadOnlyCustomerId
16
+ # Attribute mapping from ruby-style variable name to JSON key.
17
+ def self.attribute_map
18
+ {
19
+ }
20
+ end
21
+
22
+ # Returns all the JSON keys this model knows about
23
+ def self.acceptable_attributes
24
+ attribute_map.values
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.fastly_types
29
+ {
30
+ }
31
+ end
32
+
33
+ # List of attributes with nullable: true
34
+ def self.fastly_nullable
35
+ Set.new([
36
+ ])
37
+ end
38
+
39
+ # Initializes the object
40
+ # @param [Hash] attributes Model attributes in the form of hash
41
+ def initialize(attributes = {})
42
+ if (!attributes.is_a?(Hash))
43
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ReadOnlyCustomerId` initialize method"
44
+ end
45
+
46
+ # check to see if the attribute exists and convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h|
48
+ if (!self.class.attribute_map.key?(k.to_sym))
49
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ReadOnlyCustomerId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
50
+ end
51
+ h[k.to_sym] = v
52
+ }
53
+ end
54
+
55
+ # Show invalid properties with the reasons. Usually used together with valid?
56
+ # @return Array for valid properties with the reasons
57
+ def list_invalid_properties
58
+ invalid_properties = Array.new
59
+ invalid_properties
60
+ end
61
+
62
+ # Check to see if the all the properties in the model are valid
63
+ # @return true if the model is valid
64
+ def valid?
65
+ true
66
+ end
67
+
68
+ # Checks equality by comparing each attribute.
69
+ # @param [Object] Object to be compared
70
+ def ==(o)
71
+ return true if self.equal?(o)
72
+ self.class == o.class
73
+ end
74
+
75
+ # @see the `==` method
76
+ # @param [Object] Object to be compared
77
+ def eql?(o)
78
+ self == o
79
+ end
80
+
81
+ # Calculates hash code according to all attributes.
82
+ # @return [Integer] Hash code
83
+ def hash
84
+ [].hash
85
+ end
86
+
87
+ # Builds the object from hash
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ # @return [Object] Returns the model itself
90
+ def self.build_from_hash(attributes)
91
+ new.build_from_hash(attributes)
92
+ end
93
+
94
+ # Builds the object from hash
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ # @return [Object] Returns the model itself
97
+ def build_from_hash(attributes)
98
+ return nil unless attributes.is_a?(Hash)
99
+ self.class.fastly_types.each_pair do |key, type|
100
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
101
+ self.send("#{key}=", nil)
102
+ elsif type =~ /\AArray<(.*)>/i
103
+ # check to ensure the input is an array given that the attribute
104
+ # is documented as an array but the input is not
105
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
106
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
107
+ end
108
+ elsif !attributes[self.class.attribute_map[key]].nil?
109
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
110
+ end
111
+ end
112
+
113
+ self
114
+ end
115
+
116
+ # Deserializes the data based on type
117
+ # @param string type Data type
118
+ # @param string value Value to be deserialized
119
+ # @return [Object] Deserialized data
120
+ def _deserialize(type, value)
121
+ case type.to_sym
122
+ when :Time
123
+ Time.parse(value)
124
+ when :Date
125
+ Date.parse(value)
126
+ when :String
127
+ value.to_s
128
+ when :Integer
129
+ value.to_i
130
+ when :Float
131
+ value.to_f
132
+ when :Boolean
133
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
134
+ true
135
+ else
136
+ false
137
+ end
138
+ when :Object
139
+ # generic object (usually a Hash), return directly
140
+ value
141
+ when /\AArray<(?<inner_type>.+)>\z/
142
+ inner_type = Regexp.last_match[:inner_type]
143
+ value.map { |v| _deserialize(inner_type, v) }
144
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
145
+ k_type = Regexp.last_match[:k_type]
146
+ v_type = Regexp.last_match[:v_type]
147
+ {}.tap do |hash|
148
+ value.each do |k, v|
149
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
150
+ end
151
+ end
152
+ else # model
153
+ # models (e.g. Pet) or oneOf
154
+ klass = Fastly.const_get(type)
155
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
156
+ end
157
+ end
158
+
159
+ # Returns the string representation of the object
160
+ # @return [String] String presentation of the object
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_hash (backward compatibility)
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_body
168
+ to_hash
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ if value.nil?
178
+ is_nullable = self.class.fastly_nullable.include?(attr)
179
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
180
+ end
181
+
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map { |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+
205
+ end
206
+
207
+ end