fastly 8.9.0 → 9.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +15 -4
  5. data/docs/AccessKey.md +12 -0
  6. data/docs/AccessKeyResponse.md +15 -0
  7. data/docs/AclsInComputeApi.md +2 -2
  8. data/docs/Backend.md +2 -2
  9. data/docs/BackendApi.md +8 -8
  10. data/docs/BackendResponse.md +2 -2
  11. data/docs/BillingUsageMetricsApi.md +13 -19
  12. data/docs/ComputeAclUpdate.md +10 -0
  13. data/docs/DimensionAttributesCountryStats.md +12 -0
  14. data/docs/DimensionAttributesRate.md +10 -0
  15. data/docs/DimensionBrowser.md +10 -0
  16. data/docs/DimensionContentType.md +10 -0
  17. data/docs/DimensionCountry.md +10 -0
  18. data/docs/DimensionDevice.md +10 -0
  19. data/docs/DimensionOs.md +10 -0
  20. data/docs/DimensionResponse.md +10 -0
  21. data/docs/DimensionStatusCode.md +10 -0
  22. data/docs/DimensionUrl.md +10 -0
  23. data/docs/EnabledProductsApi.md +5 -5
  24. data/docs/FilterFieldItem.md +12 -0
  25. data/docs/GetLogInsightsResponse.md +11 -0
  26. data/docs/GetLogRecordsResponse.md +11 -0
  27. data/docs/GetLogRecordsResponseMeta.md +10 -0
  28. data/docs/GetLogRecordsResponseMetaFilters.md +16 -0
  29. data/docs/InsightsApi.md +69 -0
  30. data/docs/KvStoreItemApi.md +2 -0
  31. data/docs/LogExplorerApi.md +65 -0
  32. data/docs/LogInsights.md +12 -0
  33. data/docs/LogInsightsDimensionAttributes.md +49 -0
  34. data/docs/LogInsightsDimensions.md +61 -0
  35. data/docs/LogInsightsMeta.md +10 -0
  36. data/docs/LogInsightsMetaFilter.md +14 -0
  37. data/docs/LogInsightsValues.md +65 -0
  38. data/docs/LogPropertyServiceId.md +9 -0
  39. data/docs/LogRecord.md +37 -0
  40. data/docs/LoggingGrafanacloudlogsAdditional.md +14 -0
  41. data/docs/LoggingGrafanacloudlogsApi.md +259 -0
  42. data/docs/LoggingGrafanacloudlogsResponse.md +23 -0
  43. data/docs/ObjectStorageAccessKeysApi.md +163 -0
  44. data/docs/RealtimeEntryAggregated.md +3 -7
  45. data/docs/RealtimeMeasurements.md +3 -7
  46. data/docs/Results.md +3 -7
  47. data/docs/SetConfiguration.md +1 -0
  48. data/docs/Usagemetric.md +18 -0
  49. data/docs/Usagemetrics.md +10 -0
  50. data/docs/ValueField.md +59 -0
  51. data/docs/Values503Responses.md +12 -0
  52. data/docs/ValuesBandwidth.md +11 -0
  53. data/docs/ValuesBrowser.md +11 -0
  54. data/docs/ValuesCacheHitRatio.md +10 -0
  55. data/docs/ValuesCountryStats.md +12 -0
  56. data/docs/ValuesDuration.md +12 -0
  57. data/docs/ValuesMisses.md +10 -0
  58. data/docs/ValuesRate.md +10 -0
  59. data/docs/ValuesRequests.md +10 -0
  60. data/docs/ValuesStatusCodes.md +12 -0
  61. data/lib/fastly/api/acls_in_compute_api.rb +3 -3
  62. data/lib/fastly/api/backend_api.rb +8 -8
  63. data/lib/fastly/api/billing_usage_metrics_api.rb +30 -57
  64. data/lib/fastly/api/enabled_products_api.rb +10 -10
  65. data/lib/fastly/api/insights_api.rb +125 -0
  66. data/lib/fastly/api/kv_store_item_api.rb +3 -0
  67. data/lib/fastly/api/log_explorer_api.rb +109 -0
  68. data/lib/fastly/api/logging_grafanacloudlogs_api.rb +471 -0
  69. data/lib/fastly/api/object_storage_access_keys_api.rb +263 -0
  70. data/lib/fastly/configuration.rb +67 -1
  71. data/lib/fastly/models/access_key.rb +248 -0
  72. data/lib/fastly/models/access_key_response.rb +269 -0
  73. data/lib/fastly/models/backend.rb +2 -2
  74. data/lib/fastly/models/backend_response.rb +2 -2
  75. data/lib/fastly/models/compute_acl_list_entries.rb +1 -1
  76. data/lib/fastly/models/compute_acl_lookup.rb +1 -1
  77. data/lib/fastly/models/compute_acl_update.rb +219 -0
  78. data/lib/fastly/models/compute_acl_update_entry.rb +1 -1
  79. data/lib/fastly/models/dimension_attributes_country_stats.rb +237 -0
  80. data/lib/fastly/models/dimension_attributes_rate.rb +217 -0
  81. data/lib/fastly/models/dimension_browser.rb +217 -0
  82. data/lib/fastly/models/dimension_content_type.rb +217 -0
  83. data/lib/fastly/models/dimension_country.rb +217 -0
  84. data/lib/fastly/models/dimension_device.rb +217 -0
  85. data/lib/fastly/models/dimension_os.rb +217 -0
  86. data/lib/fastly/models/dimension_response.rb +217 -0
  87. data/lib/fastly/models/dimension_status_code.rb +217 -0
  88. data/lib/fastly/models/dimension_url.rb +217 -0
  89. data/lib/fastly/models/filter_field_item.rb +271 -0
  90. data/lib/fastly/models/get_log_insights_response.rb +227 -0
  91. data/lib/fastly/models/get_log_records_response.rb +227 -0
  92. data/lib/fastly/models/get_log_records_response_meta.rb +216 -0
  93. data/lib/fastly/models/get_log_records_response_meta_filters.rb +307 -0
  94. data/lib/fastly/models/log_insights.rb +234 -0
  95. data/lib/fastly/models/log_insights_dimension_attributes.rb +103 -0
  96. data/lib/fastly/models/log_insights_dimensions.rb +109 -0
  97. data/lib/fastly/models/log_insights_meta.rb +217 -0
  98. data/lib/fastly/models/log_insights_meta_filter.rb +284 -0
  99. data/lib/fastly/models/log_insights_values.rb +111 -0
  100. data/lib/fastly/models/log_property_service_id.rb +208 -0
  101. data/lib/fastly/models/log_record.rb +486 -0
  102. data/lib/fastly/models/logging_grafanacloudlogs_additional.rb +257 -0
  103. data/lib/fastly/models/logging_grafanacloudlogs_response.rb +408 -0
  104. data/lib/fastly/models/realtime_entry_aggregated.rb +34 -74
  105. data/lib/fastly/models/realtime_measurements.rb +34 -74
  106. data/lib/fastly/models/results.rb +31 -71
  107. data/lib/fastly/models/set_configuration.rb +14 -4
  108. data/lib/fastly/models/usagemetric.rb +297 -0
  109. data/lib/fastly/models/usagemetrics.rb +218 -0
  110. data/lib/fastly/models/value_field.rb +108 -0
  111. data/lib/fastly/models/values503_responses.rb +237 -0
  112. data/lib/fastly/models/values_bandwidth.rb +227 -0
  113. data/lib/fastly/models/values_browser.rb +227 -0
  114. data/lib/fastly/models/values_cache_hit_ratio.rb +217 -0
  115. data/lib/fastly/models/values_country_stats.rb +237 -0
  116. data/lib/fastly/models/values_duration.rb +237 -0
  117. data/lib/fastly/models/values_misses.rb +217 -0
  118. data/lib/fastly/models/values_rate.rb +217 -0
  119. data/lib/fastly/models/values_requests.rb +217 -0
  120. data/lib/fastly/models/values_status_codes.rb +237 -0
  121. data/lib/fastly/version.rb +1 -1
  122. data/lib/fastly.rb +45 -0
  123. data/sig.json +1 -1
  124. metadata +92 -2
@@ -0,0 +1,111 @@
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
+ module LogInsightsValues
16
+ class << self
17
+ # List of class defined in oneOf (OpenAPI v3)
18
+ def fastly_one_of
19
+ [
20
+ :'Values503Responses',
21
+ :'ValuesBandwidth',
22
+ :'ValuesBrowser',
23
+ :'ValuesCacheHitRatio',
24
+ :'ValuesCountryStats',
25
+ :'ValuesDuration',
26
+ :'ValuesMisses',
27
+ :'ValuesRate',
28
+ :'ValuesRequests',
29
+ :'ValuesStatusCodes'
30
+ ]
31
+ end
32
+
33
+ # Builds the object
34
+ # @param [Mixed] Data to be matched against the list of oneOf items
35
+ # @return [Object] Returns the model or the data itself
36
+ def build(data)
37
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
38
+ # Note:
39
+ # - We do not attempt to check whether exactly one item matches.
40
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
41
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
42
+ # - TODO: scalar values are de facto behaving as if they were nullable.
43
+ # - TODO: logging when debugging is set.
44
+ fastly_one_of.each do |klass|
45
+ begin
46
+ next if klass == :AnyType # "nullable: true"
47
+ typed_data = find_and_cast_into_type(klass, data)
48
+ return typed_data if typed_data
49
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
50
+ end
51
+ end
52
+
53
+ fastly_one_of.include?(:AnyType) ? data : nil
54
+ end
55
+
56
+ private
57
+
58
+ SchemaMismatchError = Class.new(StandardError)
59
+
60
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
61
+ def find_and_cast_into_type(klass, data)
62
+ return if data.nil?
63
+
64
+ case klass.to_s
65
+ when 'Boolean'
66
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
67
+ when 'Float'
68
+ return data if data.instance_of?(Float)
69
+ when 'Integer'
70
+ return data if data.instance_of?(Integer)
71
+ when 'Time'
72
+ return Time.parse(data)
73
+ when 'Date'
74
+ return Date.parse(data)
75
+ when 'String'
76
+ return data if data.instance_of?(String)
77
+ when 'Object' # "type: object"
78
+ return data if data.instance_of?(Hash)
79
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
80
+ if data.instance_of?(Array)
81
+ sub_type = Regexp.last_match[:sub_type]
82
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
83
+ end
84
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
85
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
86
+ sub_type = Regexp.last_match[:sub_type]
87
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
88
+ end
89
+ else # model
90
+ const = Fastly.const_get(klass)
91
+ if const
92
+ if const.respond_to?(:fastly_one_of) # nested oneOf model
93
+ model = const.build(data)
94
+ return model if model
95
+ else
96
+ # raise if data contains keys that are not known to the model
97
+ raise unless (data.keys - const.acceptable_attributes).empty?
98
+ model = const.build_from_hash(data)
99
+ return model if model && model.valid?
100
+ end
101
+ end
102
+ end
103
+
104
+ raise # if no match by now, raise
105
+ rescue
106
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
107
+ end
108
+ end
109
+ end
110
+
111
+ end
@@ -0,0 +1,208 @@
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
+ # The ID of the service that received the request.
16
+ class LogPropertyServiceId
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ }
21
+ end
22
+
23
+ # Returns all the JSON keys this model knows about
24
+ def self.acceptable_attributes
25
+ attribute_map.values
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.fastly_types
30
+ {
31
+ }
32
+ end
33
+
34
+ # List of attributes with nullable: true
35
+ def self.fastly_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LogPropertyServiceId` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::LogPropertyServiceId`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class
74
+ end
75
+
76
+ # @see the `==` method
77
+ # @param [Object] Object to be compared
78
+ def eql?(o)
79
+ self == o
80
+ end
81
+
82
+ # Calculates hash code according to all attributes.
83
+ # @return [Integer] Hash code
84
+ def hash
85
+ [].hash
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def self.build_from_hash(attributes)
92
+ new.build_from_hash(attributes)
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def build_from_hash(attributes)
99
+ return nil unless attributes.is_a?(Hash)
100
+ self.class.fastly_types.each_pair do |key, type|
101
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
102
+ self.send("#{key}=", nil)
103
+ elsif type =~ /\AArray<(.*)>/i
104
+ # check to ensure the input is an array given that the attribute
105
+ # is documented as an array but the input is not
106
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
107
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
+ end
109
+ elsif !attributes[self.class.attribute_map[key]].nil?
110
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
+ end
112
+ end
113
+
114
+ self
115
+ end
116
+
117
+ # Deserializes the data based on type
118
+ # @param string type Data type
119
+ # @param string value Value to be deserialized
120
+ # @return [Object] Deserialized data
121
+ def _deserialize(type, value)
122
+ case type.to_sym
123
+ when :Time
124
+ Time.parse(value)
125
+ when :Date
126
+ Date.parse(value)
127
+ when :String
128
+ value.to_s
129
+ when :Integer
130
+ value.to_i
131
+ when :Float
132
+ value.to_f
133
+ when :Boolean
134
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
+ true
136
+ else
137
+ false
138
+ end
139
+ when :Object
140
+ # generic object (usually a Hash), return directly
141
+ value
142
+ when /\AArray<(?<inner_type>.+)>\z/
143
+ inner_type = Regexp.last_match[:inner_type]
144
+ value.map { |v| _deserialize(inner_type, v) }
145
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
+ k_type = Regexp.last_match[:k_type]
147
+ v_type = Regexp.last_match[:v_type]
148
+ {}.tap do |hash|
149
+ value.each do |k, v|
150
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
+ end
152
+ end
153
+ else # model
154
+ # models (e.g. Pet) or oneOf
155
+ klass = Fastly.const_get(type)
156
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
157
+ end
158
+ end
159
+
160
+ # Returns the string representation of the object
161
+ # @return [String] String presentation of the object
162
+ def to_s
163
+ to_hash.to_s
164
+ end
165
+
166
+ # to_body is an alias to to_hash (backward compatibility)
167
+ # @return [Hash] Returns the object in the form of hash
168
+ def to_body
169
+ to_hash
170
+ end
171
+
172
+ # Returns the object in the form of hash
173
+ # @return [Hash] Returns the object in the form of hash
174
+ def to_hash
175
+ hash = {}
176
+ self.class.attribute_map.each_pair do |attr, param|
177
+ value = self.send(attr)
178
+ if value.nil?
179
+ is_nullable = self.class.fastly_nullable.include?(attr)
180
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
181
+ end
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ # Outputs non-array value in the form of hash
189
+ # For object, use to_hash. Otherwise, just return the value
190
+ # @param [Object] value Any valid value
191
+ # @return [Hash] Returns the value in the form of hash
192
+ def _to_hash(value)
193
+ if value.is_a?(Array)
194
+ value.compact.map { |v| _to_hash(v) }
195
+ elsif value.is_a?(Hash)
196
+ {}.tap do |hash|
197
+ value.each { |k, v| hash[k] = _to_hash(v) }
198
+ end
199
+ elsif value.respond_to? :to_hash
200
+ value.to_hash
201
+ else
202
+ value
203
+ end
204
+ end
205
+
206
+ end
207
+
208
+ end