fastly 5.2.2 → 5.3.1

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -59,8 +59,8 @@ module Fastly
59
59
  # Attribute type mapping.
60
60
  def self.fastly_types
61
61
  {
62
- :'id' => :'String',
63
- :'customer_id' => :'String',
62
+ :'id' => :'ReadOnlyId',
63
+ :'customer_id' => :'ReadOnlyCustomerId',
64
64
  :'role' => :'String',
65
65
  :'ip' => :'String',
66
66
  :'user_agent' => :'String',
@@ -74,8 +74,6 @@ module Fastly
74
74
  # List of attributes with nullable: true
75
75
  def self.fastly_nullable
76
76
  Set.new([
77
- :'id',
78
- :'customer_id',
79
77
  ])
80
78
  end
81
79
 
@@ -0,0 +1,239 @@
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 Batch
16
+ # A descriptor for the response of the entire batch
17
+ attr_accessor :title
18
+
19
+ # If an error is present in any of the requests, this field will describe that error
20
+ attr_accessor :type
21
+
22
+ # Per-key errors which failed to parse, validate, or otherwise transmit
23
+ attr_accessor :errors
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'title' => :'title',
29
+ :'type' => :'type',
30
+ :'errors' => :'errors'
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
+ :'title' => :'String',
43
+ :'type' => :'String',
44
+ :'errors' => :'Array<BatchErrors>'
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::Batch` 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::Batch`. 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?(:'title')
70
+ self.title = attributes[:'title']
71
+ end
72
+
73
+ if attributes.key?(:'type')
74
+ self.type = attributes[:'type']
75
+ end
76
+
77
+ if attributes.key?(:'errors')
78
+ if (value = attributes[:'errors']).is_a?(Array)
79
+ self.errors = value
80
+ end
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ invalid_properties
89
+ end
90
+
91
+ # Check to see if the all the properties in the model are valid
92
+ # @return true if the model is valid
93
+ def valid?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ title == o.title &&
103
+ type == o.type &&
104
+ errors == o.errors
105
+ end
106
+
107
+ # @see the `==` method
108
+ # @param [Object] Object to be compared
109
+ def eql?(o)
110
+ self == o
111
+ end
112
+
113
+ # Calculates hash code according to all attributes.
114
+ # @return [Integer] Hash code
115
+ def hash
116
+ [title, type, errors].hash
117
+ end
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def self.build_from_hash(attributes)
123
+ new.build_from_hash(attributes)
124
+ end
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+ self.class.fastly_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = Fastly.const_get(type)
187
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.fastly_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -0,0 +1,247 @@
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 BatchErrors
16
+ # The key that the error corresponds to. This field will be empty if the object or one of its fields was unable to be parsed.
17
+ attr_accessor :key
18
+
19
+ # The line number of the payload on which the error occurred (starting from 0 for the first line).
20
+ attr_accessor :index
21
+
22
+ # The HTTP response code for the request, or a 400 if the request was not able to be completed.
23
+ attr_accessor :code
24
+
25
+ # A descriptor of this particular item's error.
26
+ attr_accessor :reason
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'key' => :'key',
32
+ :'index' => :'index',
33
+ :'code' => :'code',
34
+ :'reason' => :'reason'
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
+ :'key' => :'String',
47
+ :'index' => :'Integer',
48
+ :'code' => :'String',
49
+ :'reason' => :'String'
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::BatchErrors` 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::BatchErrors`. 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?(:'key')
75
+ self.key = attributes[:'key']
76
+ end
77
+
78
+ if attributes.key?(:'index')
79
+ self.index = attributes[:'index']
80
+ end
81
+
82
+ if attributes.key?(:'code')
83
+ self.code = attributes[:'code']
84
+ end
85
+
86
+ if attributes.key?(:'reason')
87
+ self.reason = attributes[:'reason']
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
+ invalid_properties
96
+ end
97
+
98
+ # Check to see if the all the properties in the model are valid
99
+ # @return true if the model is valid
100
+ def valid?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ key == o.key &&
110
+ index == o.index &&
111
+ code == o.code &&
112
+ reason == o.reason
113
+ end
114
+
115
+ # @see the `==` method
116
+ # @param [Object] Object to be compared
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Integer] Hash code
123
+ def hash
124
+ [key, index, code, reason].hash
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def self.build_from_hash(attributes)
131
+ new.build_from_hash(attributes)
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ self.class.fastly_types.each_pair do |key, type|
140
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
141
+ self.send("#{key}=", nil)
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
146
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
147
+ end
148
+ elsif !attributes[self.class.attribute_map[key]].nil?
149
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
150
+ end
151
+ end
152
+
153
+ self
154
+ end
155
+
156
+ # Deserializes the data based on type
157
+ # @param string type Data type
158
+ # @param string value Value to be deserialized
159
+ # @return [Object] Deserialized data
160
+ def _deserialize(type, value)
161
+ case type.to_sym
162
+ when :Time
163
+ Time.parse(value)
164
+ when :Date
165
+ Date.parse(value)
166
+ when :String
167
+ value.to_s
168
+ when :Integer
169
+ value.to_i
170
+ when :Float
171
+ value.to_f
172
+ when :Boolean
173
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
174
+ true
175
+ else
176
+ false
177
+ end
178
+ when :Object
179
+ # generic object (usually a Hash), return directly
180
+ value
181
+ when /\AArray<(?<inner_type>.+)>\z/
182
+ inner_type = Regexp.last_match[:inner_type]
183
+ value.map { |v| _deserialize(inner_type, v) }
184
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
185
+ k_type = Regexp.last_match[:k_type]
186
+ v_type = Regexp.last_match[:v_type]
187
+ {}.tap do |hash|
188
+ value.each do |k, v|
189
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
190
+ end
191
+ end
192
+ else # model
193
+ # models (e.g. Pet) or oneOf
194
+ klass = Fastly.const_get(type)
195
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
196
+ end
197
+ end
198
+
199
+ # Returns the string representation of the object
200
+ # @return [String] String presentation of the object
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # to_body is an alias to to_hash (backward compatibility)
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_body
208
+ to_hash
209
+ end
210
+
211
+ # Returns the object in the form of hash
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_hash
214
+ hash = {}
215
+ self.class.attribute_map.each_pair do |attr, param|
216
+ value = self.send(attr)
217
+ if value.nil?
218
+ is_nullable = self.class.fastly_nullable.include?(attr)
219
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
220
+ end
221
+
222
+ hash[param] = _to_hash(value)
223
+ end
224
+ hash
225
+ end
226
+
227
+ # Outputs non-array value in the form of hash
228
+ # For object, use to_hash. Otherwise, just return the value
229
+ # @param [Object] value Any valid value
230
+ # @return [Hash] Returns the value in the form of hash
231
+ def _to_hash(value)
232
+ if value.is_a?(Array)
233
+ value.compact.map { |v| _to_hash(v) }
234
+ elsif value.is_a?(Hash)
235
+ {}.tap do |hash|
236
+ value.each { |k, v| hash[k] = _to_hash(v) }
237
+ end
238
+ elsif value.respond_to? :to_hash
239
+ value.to_hash
240
+ else
241
+ value
242
+ end
243
+ end
244
+
245
+ end
246
+
247
+ end