fastly 5.3.1 → 6.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (224) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +63 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +85 -63
  5. data/docs/AclEntry.md +1 -1
  6. data/docs/AclEntryApi.md +176 -0
  7. data/docs/AclEntryResponse.md +1 -1
  8. data/docs/ApexRedirectApi.md +56 -0
  9. data/docs/{BillingEstimateResponseAllOfLines.md → BillingEstimateLines.md} +2 -2
  10. data/docs/{BillingEstimateResponseAllOfLine.md → BillingEstimateLinesLineItems.md} +1 -1
  11. data/docs/BillingEstimateResponse.md +1 -1
  12. data/docs/{BillingResponseAllOf.md → BillingResponseItemItemsData.md} +1 -1
  13. data/docs/BillingResponseLineItem.md +1 -1
  14. data/docs/BillingStatus.md +1 -1
  15. data/docs/BulkUpdateAclEntry.md +1 -1
  16. data/docs/ClientKey.md +12 -0
  17. data/docs/ContactApi.md +50 -0
  18. data/docs/Content.md +2 -2
  19. data/docs/ContentApi.md +52 -0
  20. data/docs/DirectorApi.md +42 -0
  21. data/docs/DomainInspector.md +12 -0
  22. data/docs/DomainInspectorEntry.md +11 -0
  23. data/docs/DomainInspectorEntryDimensions.md +12 -0
  24. data/docs/DomainInspectorHistoricalApi.md +72 -0
  25. data/docs/DomainInspectorMeasurements.md +71 -0
  26. data/docs/DomainInspectorRealtimeApi.md +132 -0
  27. data/docs/DomainInspectorRealtimeEntry.md +12 -0
  28. data/docs/EventAttributes.md +1 -1
  29. data/docs/{EventsResponseAllOf.md → EventData.md} +1 -1
  30. data/docs/HistoricalDomains.md +13 -0
  31. data/docs/HistoricalDomainsData.md +11 -0
  32. data/docs/HistoricalDomainsMeta.md +18 -0
  33. data/docs/HistoricalDomainsMetaFilters.md +12 -0
  34. data/docs/HistoricalDomainsResponse.md +13 -0
  35. data/docs/HistoricalDomainsResponseAllOf.md +10 -0
  36. data/docs/{HistoricalFieldResultsAttributesAllOf.md → HistoricalFieldResultsAttributesAdditional.md} +1 -1
  37. data/docs/HistoricalOriginsResponse.md +13 -0
  38. data/docs/HistoricalOriginsResponseAllOf.md +10 -0
  39. data/docs/IamRolesApi.md +157 -0
  40. data/docs/IamServiceGroupsApi.md +157 -0
  41. data/docs/IamUserGroupsApi.md +315 -0
  42. data/docs/InlineResponse2005.md +11 -0
  43. data/docs/InlineResponse2006.md +11 -0
  44. data/docs/{BillingEstimateResponseAllOf.md → InlineResponse2007.md} +2 -2
  45. data/docs/InlineResponse400.md +10 -0
  46. data/docs/LegacyWafConfigurationSet.md +11 -0
  47. data/docs/LegacyWafConfigurationSetsApi.md +125 -0
  48. data/docs/LegacyWafFirewall.md +18 -0
  49. data/docs/LegacyWafFirewallApi.md +352 -0
  50. data/docs/LegacyWafOwasp.md +38 -0
  51. data/docs/LegacyWafOwaspApi.md +138 -0
  52. data/docs/LegacyWafRule.md +14 -0
  53. data/docs/LegacyWafRuleApi.md +184 -0
  54. data/docs/LegacyWafRuleStatus.md +12 -0
  55. data/docs/LegacyWafRuleStatusApi.md +202 -0
  56. data/docs/LegacyWafRuleset.md +11 -0
  57. data/docs/LegacyWafRulesetApi.md +136 -0
  58. data/docs/LegacyWafTag.md +10 -0
  59. data/docs/LegacyWafTagApi.md +58 -0
  60. data/docs/LegacyWafUpdateStatus.md +15 -0
  61. data/docs/LegacyWafUpdateStatusApi.md +102 -0
  62. data/docs/{BillingResponseLineItemAllOf.md → LineItemData.md} +2 -2
  63. data/docs/LineItemDataReadOnlyInvoiceId.md +9 -0
  64. data/docs/LoggingKafkaApi.md +42 -0
  65. data/docs/LoggingKinesisApi.md +42 -0
  66. data/docs/OriginInspector.md +12 -0
  67. data/docs/OriginInspectorDimensions.md +12 -0
  68. data/docs/OriginInspectorEntry.md +11 -0
  69. data/docs/OriginInspectorHistorical.md +13 -0
  70. data/docs/OriginInspectorHistoricalApi.md +72 -0
  71. data/docs/OriginInspectorHistoricalData.md +11 -0
  72. data/docs/OriginInspectorHistoricalMeta.md +18 -0
  73. data/docs/OriginInspectorHistoricalMetaFilters.md +12 -0
  74. data/docs/OriginInspectorMeasurements.md +161 -0
  75. data/docs/OriginInspectorRealtimeApi.md +132 -0
  76. data/docs/OriginInspectorRealtimeEntry.md +12 -0
  77. data/docs/OriginInspectorRealtimeEntryRecorded.md +9 -0
  78. data/docs/OriginInspectorSubsequentRequestTimestamp.md +9 -0
  79. data/docs/OriginInspectorValues.md +161 -0
  80. data/docs/PaginationCursorMeta.md +11 -0
  81. data/docs/ReadOnlyServiceId.md +9 -0
  82. data/docs/ReadOnlyVersion.md +9 -0
  83. data/docs/RealtimeEntry.md +2 -2
  84. data/docs/RealtimeEntryAggregated.md +227 -0
  85. data/docs/RealtimeEntryRecorded.md +9 -0
  86. data/docs/RealtimeMeasurements.md +1 -1
  87. data/docs/RecordedTimestamp.md +9 -0
  88. data/docs/RequestSettingsApi.md +40 -0
  89. data/docs/ResponseObjectApi.md +82 -0
  90. data/docs/SchemasUserResponseReadOnly.md +12 -0
  91. data/docs/Secret.md +12 -0
  92. data/docs/SecretResponse.md +13 -0
  93. data/docs/SecretStore.md +10 -0
  94. data/docs/SecretStoreApi.md +233 -0
  95. data/docs/SecretStoreItemApi.md +255 -0
  96. data/docs/SecretStoreResponse.md +12 -0
  97. data/docs/ServiceAuthorizationsApi.md +76 -0
  98. data/docs/SigningKey.md +10 -0
  99. data/docs/SnippetApi.md +42 -0
  100. data/docs/SubsequentRequestTimestamp.md +9 -0
  101. data/docs/SudoApi.md +52 -0
  102. data/docs/SudoGenericTokenError.md +10 -0
  103. data/docs/SudoRequest.md +12 -0
  104. data/docs/SudoResponse.md +10 -0
  105. data/docs/TokensApi.md +70 -0
  106. data/docs/{UserResponseAllOf.md → UserResponseReadOnly.md} +1 -1
  107. data/docs/Values.md +71 -0
  108. data/docs/WafActiveRulesApi.md +41 -0
  109. data/lib/fastly/api/acl_entry_api.rb +332 -0
  110. data/lib/fastly/api/apex_redirect_api.rb +111 -0
  111. data/lib/fastly/api/contact_api.rb +90 -0
  112. data/lib/fastly/api/content_api.rb +79 -0
  113. data/lib/fastly/api/director_api.rb +82 -0
  114. data/lib/fastly/api/domain_inspector_historical_api.rb +125 -0
  115. data/lib/fastly/api/domain_inspector_realtime_api.rb +223 -0
  116. data/lib/fastly/api/iam_roles_api.rb +271 -0
  117. data/lib/fastly/api/iam_service_groups_api.rb +271 -0
  118. data/lib/fastly/api/iam_user_groups_api.rb +547 -0
  119. data/lib/fastly/api/legacy_waf_configuration_sets_api.rb +209 -0
  120. data/lib/fastly/api/legacy_waf_firewall_api.rb +627 -0
  121. data/lib/fastly/api/legacy_waf_owasp_api.rb +244 -0
  122. data/lib/fastly/api/legacy_waf_rule_api.rb +307 -0
  123. data/lib/fastly/api/legacy_waf_rule_status_api.rb +366 -0
  124. data/lib/fastly/api/legacy_waf_ruleset_api.rb +237 -0
  125. data/lib/fastly/api/legacy_waf_tag_api.rb +96 -0
  126. data/lib/fastly/api/legacy_waf_update_status_api.rb +184 -0
  127. data/lib/fastly/api/logging_kafka_api.rb +82 -0
  128. data/lib/fastly/api/logging_kinesis_api.rb +82 -0
  129. data/lib/fastly/api/origin_inspector_historical_api.rb +125 -0
  130. data/lib/fastly/api/origin_inspector_realtime_api.rb +223 -0
  131. data/lib/fastly/api/request_settings_api.rb +75 -0
  132. data/lib/fastly/api/response_object_api.rb +157 -0
  133. data/lib/fastly/api/secret_store_api.rb +381 -0
  134. data/lib/fastly/api/secret_store_item_api.rb +437 -0
  135. data/lib/fastly/api/service_authorizations_api.rb +126 -0
  136. data/lib/fastly/api/snippet_api.rb +82 -0
  137. data/lib/fastly/api/sudo_api.rb +83 -0
  138. data/lib/fastly/api/tokens_api.rb +122 -0
  139. data/lib/fastly/api/waf_active_rules_api.rb +75 -0
  140. data/lib/fastly/configuration.rb +504 -0
  141. data/lib/fastly/models/acl_entry.rb +1 -1
  142. data/lib/fastly/models/acl_entry_response.rb +1 -1
  143. data/lib/fastly/models/{billing_response_all_of.rb → billing_estimate_lines.rb} +4 -4
  144. data/lib/fastly/models/{billing_estimate_response_all_of_line.rb → billing_estimate_lines_line_items.rb} +3 -3
  145. data/lib/fastly/models/billing_estimate_response.rb +9 -9
  146. data/lib/fastly/models/billing_response.rb +1 -1
  147. data/lib/fastly/models/{billing_estimate_response_all_of.rb → billing_response_item_items_data.rb} +11 -11
  148. data/lib/fastly/models/billing_response_line_item.rb +2 -2
  149. data/lib/fastly/models/billing_status.rb +2 -0
  150. data/lib/fastly/models/bulk_update_acl_entry.rb +1 -1
  151. data/lib/fastly/models/client_key.rb +239 -0
  152. data/lib/fastly/models/content.rb +8 -4
  153. data/lib/fastly/models/domain.rb +1 -0
  154. data/lib/fastly/models/domain_inspector.rb +238 -0
  155. data/lib/fastly/models/domain_inspector_entry.rb +228 -0
  156. data/lib/fastly/models/domain_inspector_entry_dimensions.rb +238 -0
  157. data/lib/fastly/models/domain_inspector_measurements.rb +828 -0
  158. data/lib/fastly/models/domain_inspector_realtime_entry.rb +241 -0
  159. data/lib/fastly/models/event_attributes.rb +4 -2
  160. data/lib/fastly/models/{events_response_all_of.rb → event_data.rb} +3 -3
  161. data/lib/fastly/models/events_response.rb +1 -1
  162. data/lib/fastly/models/historical_domains.rb +249 -0
  163. data/lib/fastly/models/historical_domains_data.rb +228 -0
  164. data/lib/fastly/models/historical_domains_meta.rb +297 -0
  165. data/lib/fastly/models/historical_domains_meta_filters.rb +235 -0
  166. data/lib/fastly/models/historical_domains_response.rb +257 -0
  167. data/lib/fastly/models/historical_domains_response_all_of.rb +219 -0
  168. data/lib/fastly/models/historical_field_results_attributes.rb +1 -1
  169. data/lib/fastly/models/{historical_field_results_attributes_all_of.rb → historical_field_results_attributes_additional.rb} +3 -3
  170. data/lib/fastly/models/historical_origins_response.rb +257 -0
  171. data/lib/fastly/models/historical_origins_response_all_of.rb +219 -0
  172. data/lib/fastly/models/inline_response2005.rb +227 -0
  173. data/lib/fastly/models/inline_response2006.rb +227 -0
  174. data/lib/fastly/models/inline_response2007.rb +218 -0
  175. data/lib/fastly/models/inline_response400.rb +250 -0
  176. data/lib/fastly/models/legacy_waf_configuration_set.rb +227 -0
  177. data/lib/fastly/models/legacy_waf_firewall.rb +297 -0
  178. data/lib/fastly/models/legacy_waf_owasp.rb +527 -0
  179. data/lib/fastly/models/legacy_waf_rule.rb +257 -0
  180. data/lib/fastly/models/legacy_waf_rule_status.rb +237 -0
  181. data/lib/fastly/models/legacy_waf_ruleset.rb +227 -0
  182. data/lib/fastly/models/{billing_estimate_response_all_of_lines.rb → legacy_waf_tag.rb} +11 -10
  183. data/lib/fastly/models/legacy_waf_update_status.rb +267 -0
  184. data/lib/fastly/models/{billing_response_line_item_all_of.rb → line_item_data.rb} +4 -4
  185. data/lib/fastly/models/line_item_data_read_only_invoice_id.rb +207 -0
  186. data/lib/fastly/models/origin_inspector.rb +238 -0
  187. data/lib/fastly/models/origin_inspector_dimensions.rb +238 -0
  188. data/lib/fastly/models/origin_inspector_entry.rb +228 -0
  189. data/lib/fastly/models/origin_inspector_historical.rb +249 -0
  190. data/lib/fastly/models/origin_inspector_historical_data.rb +225 -0
  191. data/lib/fastly/models/origin_inspector_historical_meta.rb +297 -0
  192. data/lib/fastly/models/origin_inspector_historical_meta_filters.rb +235 -0
  193. data/lib/fastly/models/origin_inspector_measurements.rb +1728 -0
  194. data/lib/fastly/models/origin_inspector_realtime_entry.rb +241 -0
  195. data/lib/fastly/models/origin_inspector_realtime_entry_recorded.rb +208 -0
  196. data/lib/fastly/models/origin_inspector_subsequent_request_timestamp.rb +208 -0
  197. data/lib/fastly/models/origin_inspector_values.rb +1728 -0
  198. data/lib/fastly/models/pagination_cursor_meta.rb +227 -0
  199. data/lib/fastly/models/read_only_service_id.rb +207 -0
  200. data/lib/fastly/models/read_only_version.rb +207 -0
  201. data/lib/fastly/models/realtime_entry.rb +2 -7
  202. data/lib/fastly/models/realtime_entry_aggregated.rb +2397 -0
  203. data/lib/fastly/models/realtime_entry_recorded.rb +208 -0
  204. data/lib/fastly/models/realtime_measurements.rb +4 -2
  205. data/lib/fastly/models/recorded_timestamp.rb +208 -0
  206. data/lib/fastly/models/schemas_user_response.rb +5 -2
  207. data/lib/fastly/models/schemas_user_response_read_only.rb +235 -0
  208. data/lib/fastly/models/secret.rb +238 -0
  209. data/lib/fastly/models/secret_response.rb +249 -0
  210. data/lib/fastly/models/secret_store.rb +217 -0
  211. data/lib/fastly/models/secret_store_response.rb +238 -0
  212. data/lib/fastly/models/signing_key.rb +218 -0
  213. data/lib/fastly/models/subsequent_request_timestamp.rb +208 -0
  214. data/lib/fastly/models/sudo_generic_token_error.rb +216 -0
  215. data/lib/fastly/models/sudo_request.rb +244 -0
  216. data/lib/fastly/models/sudo_response.rb +217 -0
  217. data/lib/fastly/models/user.rb +3 -0
  218. data/lib/fastly/models/user_response.rb +4 -1
  219. data/lib/fastly/models/{user_response_all_of.rb → user_response_read_only.rb} +3 -3
  220. data/lib/fastly/models/values.rb +828 -0
  221. data/lib/fastly/version.rb +1 -1
  222. data/lib/fastly.rb +79 -8
  223. data/sig.json +1 -1
  224. metadata +160 -18
@@ -0,0 +1,216 @@
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 SudoGenericTokenError
16
+ attr_accessor :msg
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'msg' => :'msg'
22
+ }
23
+ end
24
+
25
+ # Returns all the JSON keys this model knows about
26
+ def self.acceptable_attributes
27
+ attribute_map.values
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.fastly_types
32
+ {
33
+ :'msg' => :'String'
34
+ }
35
+ end
36
+
37
+ # List of attributes with nullable: true
38
+ def self.fastly_nullable
39
+ Set.new([
40
+ ])
41
+ end
42
+
43
+ # Initializes the object
44
+ # @param [Hash] attributes Model attributes in the form of hash
45
+ def initialize(attributes = {})
46
+ if (!attributes.is_a?(Hash))
47
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::SudoGenericTokenError` initialize method"
48
+ end
49
+
50
+ # check to see if the attribute exists and convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h|
52
+ if (!self.class.attribute_map.key?(k.to_sym))
53
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::SudoGenericTokenError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ end
55
+ h[k.to_sym] = v
56
+ }
57
+
58
+ if attributes.key?(:'msg')
59
+ self.msg = attributes[:'msg']
60
+ end
61
+ end
62
+
63
+ # Show invalid properties with the reasons. Usually used together with valid?
64
+ # @return Array for valid properties with the reasons
65
+ def list_invalid_properties
66
+ invalid_properties = Array.new
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ true
74
+ end
75
+
76
+ # Checks equality by comparing each attribute.
77
+ # @param [Object] Object to be compared
78
+ def ==(o)
79
+ return true if self.equal?(o)
80
+ self.class == o.class &&
81
+ msg == o.msg
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Integer] Hash code
92
+ def hash
93
+ [msg].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def self.build_from_hash(attributes)
100
+ new.build_from_hash(attributes)
101
+ end
102
+
103
+ # Builds the object from hash
104
+ # @param [Hash] attributes Model attributes in the form of hash
105
+ # @return [Object] Returns the model itself
106
+ def build_from_hash(attributes)
107
+ return nil unless attributes.is_a?(Hash)
108
+ self.class.fastly_types.each_pair do |key, type|
109
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
110
+ self.send("#{key}=", nil)
111
+ elsif type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ end
120
+ end
121
+
122
+ self
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def _deserialize(type, value)
130
+ case type.to_sym
131
+ when :Time
132
+ Time.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ # models (e.g. Pet) or oneOf
163
+ klass = Fastly.const_get(type)
164
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.fastly_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,244 @@
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 SudoRequest
16
+ attr_accessor :username
17
+
18
+ attr_accessor :password
19
+
20
+ attr_accessor :expiry_time
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'username' => :'username',
26
+ :'password' => :'password',
27
+ :'expiry_time' => :'expiry_time'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.fastly_types
38
+ {
39
+ :'username' => :'String',
40
+ :'password' => :'String',
41
+ :'expiry_time' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.fastly_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::SudoRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::SudoRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'username')
67
+ self.username = attributes[:'username']
68
+ end
69
+
70
+ if attributes.key?(:'password')
71
+ self.password = attributes[:'password']
72
+ end
73
+
74
+ if attributes.key?(:'expiry_time')
75
+ self.expiry_time = attributes[:'expiry_time']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ if @username.nil?
84
+ invalid_properties.push('invalid value for "username", username cannot be nil.')
85
+ end
86
+
87
+ if @password.nil?
88
+ invalid_properties.push('invalid value for "password", password cannot be nil.')
89
+ end
90
+
91
+ invalid_properties
92
+ end
93
+
94
+ # Check to see if the all the properties in the model are valid
95
+ # @return true if the model is valid
96
+ def valid?
97
+ return false if @username.nil?
98
+ return false if @password.nil?
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
+ username == o.username &&
108
+ password == o.password &&
109
+ expiry_time == o.expiry_time
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [username, password, expiry_time].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ self.class.fastly_types.each_pair do |key, type|
137
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
138
+ self.send("#{key}=", nil)
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = Fastly.const_get(type)
192
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.fastly_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end
@@ -0,0 +1,217 @@
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 SudoResponse
16
+ # A UTC time-stamp of when sudo access will expire. If blank, sudo access expires five minutes after the request.
17
+ attr_accessor :expiry_time
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'expiry_time' => :'expiry_time'
23
+ }
24
+ end
25
+
26
+ # Returns all the JSON keys this model knows about
27
+ def self.acceptable_attributes
28
+ attribute_map.values
29
+ end
30
+
31
+ # Attribute type mapping.
32
+ def self.fastly_types
33
+ {
34
+ :'expiry_time' => :'Time'
35
+ }
36
+ end
37
+
38
+ # List of attributes with nullable: true
39
+ def self.fastly_nullable
40
+ Set.new([
41
+ ])
42
+ end
43
+
44
+ # Initializes the object
45
+ # @param [Hash] attributes Model attributes in the form of hash
46
+ def initialize(attributes = {})
47
+ if (!attributes.is_a?(Hash))
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::SudoResponse` initialize method"
49
+ end
50
+
51
+ # check to see if the attribute exists and convert string to symbol for hash key
52
+ attributes = attributes.each_with_object({}) { |(k, v), h|
53
+ if (!self.class.attribute_map.key?(k.to_sym))
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::SudoResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ end
56
+ h[k.to_sym] = v
57
+ }
58
+
59
+ if attributes.key?(:'expiry_time')
60
+ self.expiry_time = attributes[:'expiry_time']
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ expiry_time == o.expiry_time
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Integer] Hash code
93
+ def hash
94
+ [expiry_time].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def self.build_from_hash(attributes)
101
+ new.build_from_hash(attributes)
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.fastly_types.each_pair do |key, type|
110
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
111
+ self.send("#{key}=", nil)
112
+ elsif type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
117
+ end
118
+ elsif !attributes[self.class.attribute_map[key]].nil?
119
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
120
+ end
121
+ end
122
+
123
+ self
124
+ end
125
+
126
+ # Deserializes the data based on type
127
+ # @param string type Data type
128
+ # @param string value Value to be deserialized
129
+ # @return [Object] Deserialized data
130
+ def _deserialize(type, value)
131
+ case type.to_sym
132
+ when :Time
133
+ Time.parse(value)
134
+ when :Date
135
+ Date.parse(value)
136
+ when :String
137
+ value.to_s
138
+ when :Integer
139
+ value.to_i
140
+ when :Float
141
+ value.to_f
142
+ when :Boolean
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ # models (e.g. Pet) or oneOf
164
+ klass = Fastly.const_get(type)
165
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
166
+ end
167
+ end
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # to_body is an alias to to_hash (backward compatibility)
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_body
178
+ to_hash
179
+ end
180
+
181
+ # Returns the object in the form of hash
182
+ # @return [Hash] Returns the object in the form of hash
183
+ def to_hash
184
+ hash = {}
185
+ self.class.attribute_map.each_pair do |attr, param|
186
+ value = self.send(attr)
187
+ if value.nil?
188
+ is_nullable = self.class.fastly_nullable.include?(attr)
189
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
190
+ end
191
+
192
+ hash[param] = _to_hash(value)
193
+ end
194
+ hash
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value)
202
+ if value.is_a?(Array)
203
+ value.compact.map { |v| _to_hash(v) }
204
+ elsif value.is_a?(Hash)
205
+ {}.tap do |hash|
206
+ value.each { |k, v| hash[k] = _to_hash(v) }
207
+ end
208
+ elsif value.respond_to? :to_hash
209
+ value.to_hash
210
+ else
211
+ value
212
+ end
213
+ end
214
+
215
+ end
216
+
217
+ end
@@ -71,6 +71,9 @@ module Fastly
71
71
  # List of attributes with nullable: true
72
72
  def self.fastly_nullable
73
73
  Set.new([
74
+ :'locked',
75
+ :'require_new_password',
76
+ :'two_factor_auth_enabled',
74
77
  ])
75
78
  end
76
79
 
@@ -99,6 +99,9 @@ module Fastly
99
99
  # List of attributes with nullable: true
100
100
  def self.fastly_nullable
101
101
  Set.new([
102
+ :'locked',
103
+ :'require_new_password',
104
+ :'two_factor_auth_enabled',
102
105
  :'created_at',
103
106
  :'deleted_at',
104
107
  :'updated_at',
@@ -110,7 +113,7 @@ module Fastly
110
113
  [
111
114
  :'Timestamps',
112
115
  :'User',
113
- :'UserResponseAllOf'
116
+ :'UserResponseReadOnly'
114
117
  ]
115
118
  end
116
119