fastly 13.1.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -0
  3. data/Gemfile.lock +4 -4
  4. data/README.md +26 -12
  5. data/docs/ApiDiscoveryResponseBodyGetAllServices.md +13 -0
  6. data/docs/ApiDiscoveryResponseCustomer.md +10 -0
  7. data/docs/{LogTimeseriesGetResponseMetaFilters.md → ApiDiscoveryResponseCustomerCustomer.md} +3 -2
  8. data/docs/ApiDiscoveryResponseEnable.md +12 -0
  9. data/docs/ApiDiscoveryResponseEnabledServices.md +10 -0
  10. data/docs/ApiDiscoveryResponseLinks.md +10 -0
  11. data/docs/ApiDiscoveryResponseLinksGetAllServices.md +10 -0
  12. data/docs/{LogTimeseriesResultDimensions.md → ApiDiscoveryResponseLinksGetAllServicesLinks.md} +2 -2
  13. data/docs/{DdosProtectionAction.md → ApiDiscoveryResponseLinksLinks.md} +2 -1
  14. data/docs/ApiDiscoveryResponseProduct.md +10 -0
  15. data/docs/ApiDiscoveryResponseProductProduct.md +11 -0
  16. data/docs/ApiDiscoveryResponseService.md +10 -0
  17. data/docs/{BotManagementResponseServiceService.md → ApiDiscoveryResponseServiceService.md} +1 -1
  18. data/docs/AttackReport.md +19 -0
  19. data/docs/AttackSignal.md +12 -0
  20. data/docs/AttackSource.md +13 -0
  21. data/docs/Backend.md +4 -4
  22. data/docs/BackendApi.md +10 -10
  23. data/docs/BackendResponse.md +4 -4
  24. data/docs/BotManagementResponseBodyEnable.md +1 -1
  25. data/docs/BotManagementResponseService.md +1 -1
  26. data/docs/BrotliCompressionResponseBodyEnable.md +1 -1
  27. data/docs/BrotliCompressionResponseService.md +1 -1
  28. data/docs/DdosProtectionApi.md +42 -0
  29. data/docs/DdosProtectionAttributeStats.md +1 -1
  30. data/docs/DdosProtectionInvalidRequest.md +13 -0
  31. data/docs/DdosProtectionNotAuthorized.md +11 -0
  32. data/docs/DdosProtectionResponseConfigure.md +1 -1
  33. data/docs/DdosProtectionResponseEnable.md +1 -1
  34. data/docs/DdosProtectionResponseService.md +1 -1
  35. data/docs/DdosProtectionRule.md +1 -1
  36. data/docs/DdosProtectionRuleAllOf.md +1 -1
  37. data/docs/DdosProtectionRulePatch.md +10 -0
  38. data/docs/DdosProtectionRuleWithStats.md +23 -0
  39. data/docs/DdosProtectionRuleWithStatsAllOf.md +10 -0
  40. data/docs/DdosProtectionTrafficStats.md +1 -0
  41. data/docs/DdosProtectionTrafficStatsAllOf.md +1 -0
  42. data/docs/DmDomainsApi.md +220 -0
  43. data/docs/DomainInspectorResponseBodyEnable.md +1 -1
  44. data/docs/DomainInspectorResponseService.md +1 -1
  45. data/docs/DomainOwnershipsApi.md +2 -2
  46. data/docs/FanoutResponseBodyEnable.md +1 -1
  47. data/docs/FanoutResponseService.md +1 -1
  48. data/docs/Healthcheck.md +1 -1
  49. data/docs/HealthcheckApi.md +4 -4
  50. data/docs/HealthcheckResponse.md +1 -1
  51. data/docs/HistoricalApi.md +2 -0
  52. data/docs/IamRolesApi.md +23 -253
  53. data/docs/IamV1RoleListResponse.md +12 -0
  54. data/docs/IamV1RoleResponse.md +13 -0
  55. data/docs/ImageOptimizerResponseBodyEnable.md +1 -1
  56. data/docs/ImageOptimizerResponseService.md +1 -1
  57. data/docs/InlineResponse20010.md +10 -0
  58. data/docs/InlineResponse2003.md +2 -2
  59. data/docs/InlineResponse2004.md +2 -1
  60. data/docs/InlineResponse2005.md +1 -2
  61. data/docs/InlineResponse2006.md +1 -1
  62. data/docs/InlineResponse2007.md +1 -1
  63. data/docs/InlineResponse2008.md +1 -1
  64. data/docs/InlineResponse2009.md +2 -1
  65. data/docs/InvitationDataAttributes.md +1 -0
  66. data/docs/KvStoreApi.md +4 -2
  67. data/docs/KvStoreItemApi.md +2 -2
  68. data/docs/ListAttackReport.md +11 -0
  69. data/docs/ListAttackReportMeta.md +10 -0
  70. data/docs/{DdosProtectionTrafficAttribute.md → ListSignalReport.md} +2 -1
  71. data/docs/LogExplorerApi.md +1 -1
  72. data/docs/LogExplorerInsightsResponseBodyEnable.md +1 -1
  73. data/docs/LogExplorerInsightsResponseService.md +1 -1
  74. data/docs/LoggingHttpsAdditional.md +1 -0
  75. data/docs/LoggingHttpsApi.md +4 -0
  76. data/docs/LoggingHttpsResponse.md +1 -0
  77. data/docs/NgwafReportsApi.md +99 -0
  78. data/docs/NgwafResponseConfigure.md +1 -1
  79. data/docs/NgwafResponseEnable.md +1 -1
  80. data/docs/NgwafResponseService.md +1 -1
  81. data/docs/ObservabilityTimeseriesApi.md +67 -0
  82. data/docs/OriginInspectorResponseBodyEnable.md +1 -1
  83. data/docs/OriginInspectorResponseService.md +1 -1
  84. data/docs/PoolApi.md +4 -4
  85. data/docs/PoolResponse.md +1 -1
  86. data/docs/PoolResponseCommon.md +1 -1
  87. data/docs/PoolResponsePost.md +1 -1
  88. data/docs/ProductApiDiscoveryApi.md +163 -0
  89. data/docs/RealtimeEntryAggregated.md +1 -0
  90. data/docs/RealtimeMeasurements.md +1 -0
  91. data/docs/RequestBodyForCreate.md +12 -0
  92. data/docs/RequestBodyForUpdate.md +11 -0
  93. data/docs/Results.md +1 -0
  94. data/docs/SchemasUserResponse.md +1 -0
  95. data/docs/SecretStoreApi.md +2 -2
  96. data/docs/SecretStoreItemApi.md +2 -2
  97. data/docs/ServiceAuthorizationsApi.md +2 -2
  98. data/docs/SignalReport.md +13 -0
  99. data/docs/SuccessfulResponseAsObject.md +17 -0
  100. data/docs/SuccessfulResponseAsObjectAllOf.md +15 -0
  101. data/docs/TimeseriesGetResponse.md +11 -0
  102. data/docs/TimeseriesMeta.md +13 -0
  103. data/docs/TimeseriesResult.md +11 -0
  104. data/docs/TlsSubscriptionsApi.md +0 -2
  105. data/docs/TopWorkspace.md +12 -0
  106. data/docs/User.md +1 -0
  107. data/docs/UserApi.md +4 -0
  108. data/docs/UserResponse.md +1 -0
  109. data/docs/WebsocketsResponseBodyEnable.md +1 -1
  110. data/docs/WebsocketsResponseService.md +1 -1
  111. data/lib/fastly/api/backend_api.rb +16 -16
  112. data/lib/fastly/api/ddos_protection_api.rb +73 -0
  113. data/lib/fastly/api/dm_domains_api.rb +362 -0
  114. data/lib/fastly/api/domain_ownerships_api.rb +3 -3
  115. data/lib/fastly/api/healthcheck_api.rb +20 -4
  116. data/lib/fastly/api/historical_api.rb +3 -0
  117. data/lib/fastly/api/iam_roles_api.rb +43 -435
  118. data/lib/fastly/api/kv_store_api.rb +6 -3
  119. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  120. data/lib/fastly/api/logging_https_api.rb +6 -0
  121. data/lib/fastly/api/ngwaf_reports_api.rb +161 -0
  122. data/lib/fastly/api/{observability_timeseries_for_logs_api.rb → observability_timeseries_api.rb} +38 -43
  123. data/lib/fastly/api/pool_api.rb +4 -4
  124. data/lib/fastly/api/product_api_discovery_api.rb +263 -0
  125. data/lib/fastly/api/secret_store_api.rb +3 -3
  126. data/lib/fastly/api/secret_store_item_api.rb +3 -3
  127. data/lib/fastly/api/service_authorizations_api.rb +3 -3
  128. data/lib/fastly/api/tls_subscriptions_api.rb +0 -3
  129. data/lib/fastly/api/user_api.rb +6 -0
  130. data/lib/fastly/configuration.rb +75 -39
  131. data/lib/fastly/models/api_discovery_response_body_get_all_services.rb +256 -0
  132. data/lib/fastly/models/api_discovery_response_customer.rb +216 -0
  133. data/lib/fastly/models/api_discovery_response_customer_customer.rb +227 -0
  134. data/lib/fastly/models/api_discovery_response_enable.rb +243 -0
  135. data/lib/fastly/models/{log_timeseries_get_response_meta_filters.rb → api_discovery_response_enabled_services.rb} +12 -13
  136. data/lib/fastly/models/api_discovery_response_links.rb +216 -0
  137. data/lib/fastly/models/api_discovery_response_links_get_all_services.rb +216 -0
  138. data/lib/fastly/models/api_discovery_response_links_get_all_services_links.rb +217 -0
  139. data/lib/fastly/models/api_discovery_response_links_links.rb +217 -0
  140. data/lib/fastly/models/api_discovery_response_product.rb +216 -0
  141. data/lib/fastly/models/api_discovery_response_product_product.rb +227 -0
  142. data/lib/fastly/models/api_discovery_response_service.rb +216 -0
  143. data/lib/fastly/models/{bot_management_response_service_service.rb → api_discovery_response_service_service.rb} +3 -3
  144. data/lib/fastly/models/attack_report.rb +359 -0
  145. data/lib/fastly/models/attack_signal.rb +252 -0
  146. data/lib/fastly/models/attack_source.rb +267 -0
  147. data/lib/fastly/models/backend.rb +7 -1
  148. data/lib/fastly/models/backend_response.rb +7 -1
  149. data/lib/fastly/models/bot_management_response_body_enable.rb +1 -1
  150. data/lib/fastly/models/bot_management_response_service.rb +1 -1
  151. data/lib/fastly/models/brotli_compression_response_body_enable.rb +1 -1
  152. data/lib/fastly/models/brotli_compression_response_service.rb +1 -1
  153. data/lib/fastly/models/ddos_protection_attribute_stats.rb +2 -1
  154. data/lib/fastly/models/ddos_protection_invalid_request.rb +309 -0
  155. data/lib/fastly/models/{log_timeseries_filter_field_item.rb → ddos_protection_not_authorized.rb} +24 -36
  156. data/lib/fastly/models/ddos_protection_response_configure.rb +1 -1
  157. data/lib/fastly/models/ddos_protection_response_enable.rb +1 -1
  158. data/lib/fastly/models/ddos_protection_response_service.rb +1 -1
  159. data/lib/fastly/models/ddos_protection_rule.rb +2 -1
  160. data/lib/fastly/models/ddos_protection_rule_all_of.rb +2 -1
  161. data/lib/fastly/models/ddos_protection_rule_patch.rb +219 -0
  162. data/lib/fastly/models/ddos_protection_rule_with_stats.rb +365 -0
  163. data/lib/fastly/models/ddos_protection_rule_with_stats_all_of.rb +216 -0
  164. data/lib/fastly/models/ddos_protection_traffic_stats.rb +20 -4
  165. data/lib/fastly/models/ddos_protection_traffic_stats_all_of.rb +20 -4
  166. data/lib/fastly/models/domain_inspector_response_body_enable.rb +1 -1
  167. data/lib/fastly/models/domain_inspector_response_service.rb +1 -1
  168. data/lib/fastly/models/fanout_response_body_enable.rb +1 -1
  169. data/lib/fastly/models/fanout_response_service.rb +1 -1
  170. data/lib/fastly/models/healthcheck.rb +25 -1
  171. data/lib/fastly/models/healthcheck_response.rb +25 -1
  172. data/lib/fastly/models/iam_v1_role_list_response.rb +240 -0
  173. data/lib/fastly/models/{iam_role_all_of.rb → iam_v1_role_response.rb} +14 -34
  174. data/lib/fastly/models/image_optimizer_response_body_enable.rb +1 -1
  175. data/lib/fastly/models/image_optimizer_response_service.rb +1 -1
  176. data/lib/fastly/models/inline_response20010.rb +218 -0
  177. data/lib/fastly/models/inline_response2003.rb +11 -1
  178. data/lib/fastly/models/inline_response2004.rb +20 -8
  179. data/lib/fastly/models/inline_response2005.rb +8 -18
  180. data/lib/fastly/models/inline_response2006.rb +1 -1
  181. data/lib/fastly/models/inline_response2007.rb +1 -1
  182. data/lib/fastly/models/inline_response2008.rb +1 -1
  183. data/lib/fastly/models/inline_response2009.rb +13 -4
  184. data/lib/fastly/models/invitation_data_attributes.rb +12 -1
  185. data/lib/fastly/models/{log_timeseries_get_response.rb → list_attack_report.rb} +5 -5
  186. data/lib/fastly/models/list_attack_report_meta.rb +218 -0
  187. data/lib/fastly/models/{log_timeseries_result_dimensions.rb → list_signal_report.rb} +12 -10
  188. data/lib/fastly/models/log_explorer_insights_response_body_enable.rb +1 -1
  189. data/lib/fastly/models/log_explorer_insights_response_service.rb +1 -1
  190. data/lib/fastly/models/logging_https_additional.rb +16 -4
  191. data/lib/fastly/models/logging_https_response.rb +13 -1
  192. data/lib/fastly/models/ngwaf_response_configure.rb +1 -1
  193. data/lib/fastly/models/ngwaf_response_enable.rb +1 -1
  194. data/lib/fastly/models/ngwaf_response_service.rb +1 -1
  195. data/lib/fastly/models/origin_inspector_response_body_enable.rb +1 -1
  196. data/lib/fastly/models/origin_inspector_response_service.rb +1 -1
  197. data/lib/fastly/models/pool_response.rb +1 -1
  198. data/lib/fastly/models/pool_response_common.rb +1 -1
  199. data/lib/fastly/models/pool_response_post.rb +1 -1
  200. data/lib/fastly/models/realtime_entry_aggregated.rb +14 -4
  201. data/lib/fastly/models/realtime_measurements.rb +14 -4
  202. data/lib/fastly/models/request_body_for_create.rb +244 -0
  203. data/lib/fastly/models/request_body_for_update.rb +229 -0
  204. data/lib/fastly/models/results.rb +11 -1
  205. data/lib/fastly/models/role_user.rb +2 -0
  206. data/lib/fastly/models/schemas_user_response.rb +13 -1
  207. data/lib/fastly/models/signal_report.rb +249 -0
  208. data/lib/fastly/models/{iam_role.rb → successful_response_as_object.rb} +37 -35
  209. data/lib/fastly/models/successful_response_as_object_all_of.rb +268 -0
  210. data/lib/fastly/models/timeseries_get_response.rb +227 -0
  211. data/lib/fastly/models/{log_timeseries_get_response_meta.rb → timeseries_meta.rb} +23 -32
  212. data/lib/fastly/models/{log_timeseries_result.rb → timeseries_result.rb} +9 -5
  213. data/lib/fastly/models/top_workspace.rb +238 -0
  214. data/lib/fastly/models/user.rb +13 -1
  215. data/lib/fastly/models/user_response.rb +13 -1
  216. data/lib/fastly/models/websockets_response_body_enable.rb +1 -1
  217. data/lib/fastly/models/websockets_response_service.rb +1 -1
  218. data/lib/fastly/version.rb +1 -1
  219. data/lib/fastly.rb +40 -13
  220. data/sig.json +1 -1
  221. metadata +82 -28
  222. data/docs/IamRole.md +0 -17
  223. data/docs/IamRoleAllOf.md +0 -15
  224. data/docs/LogTimeseriesFilterFieldItem.md +0 -12
  225. data/docs/LogTimeseriesGetResponse.md +0 -11
  226. data/docs/LogTimeseriesGetResponseMeta.md +0 -14
  227. data/docs/LogTimeseriesResult.md +0 -11
  228. data/docs/LogTimeseriesValueField.md +0 -59
  229. data/docs/ObservabilityTimeseriesForLogsApi.md +0 -67
  230. data/lib/fastly/models/ddos_protection_action.rb +0 -37
  231. data/lib/fastly/models/ddos_protection_traffic_attribute.rb +0 -40
  232. data/lib/fastly/models/log_timeseries_value_field.rb +0 -108
@@ -12,14 +12,14 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- # Echoes the filters that were supplied in the request.
16
- class LogTimeseriesGetResponseMetaFilters
17
- attr_accessor :filter_fields
15
+ class ApiDiscoveryResponseEnabledServices
16
+ # A list of services for a customer with API Discovery enabled.
17
+ attr_accessor :services
18
18
 
19
19
  # Attribute mapping from ruby-style variable name to JSON key.
20
20
  def self.attribute_map
21
21
  {
22
- :'filter_fields' => :'filter_fields'
22
+ :'services' => :'services'
23
23
  }
24
24
  end
25
25
 
@@ -31,14 +31,13 @@ module Fastly
31
31
  # Attribute type mapping.
32
32
  def self.fastly_types
33
33
  {
34
- :'filter_fields' => :'Array<LogTimeseriesFilterFieldItem>'
34
+ :'services' => :'Array<String>'
35
35
  }
36
36
  end
37
37
 
38
38
  # List of attributes with nullable: true
39
39
  def self.fastly_nullable
40
40
  Set.new([
41
- :'filter_fields'
42
41
  ])
43
42
  end
44
43
 
@@ -46,20 +45,20 @@ module Fastly
46
45
  # @param [Hash] attributes Model attributes in the form of hash
47
46
  def initialize(attributes = {})
48
47
  if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::LogTimeseriesGetResponseMetaFilters` initialize method"
48
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::ApiDiscoveryResponseEnabledServices` initialize method"
50
49
  end
51
50
 
52
51
  # check to see if the attribute exists and convert string to symbol for hash key
53
52
  attributes = attributes.each_with_object({}) { |(k, v), h|
54
53
  if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::LogTimeseriesGetResponseMetaFilters`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
54
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ApiDiscoveryResponseEnabledServices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
55
  end
57
56
  h[k.to_sym] = v
58
57
  }
59
58
 
60
- if attributes.key?(:'filter_fields')
61
- if (value = attributes[:'filter_fields']).is_a?(Array)
62
- self.filter_fields = value
59
+ if attributes.key?(:'services')
60
+ if (value = attributes[:'services']).is_a?(Array)
61
+ self.services = value
63
62
  end
64
63
  end
65
64
  end
@@ -82,7 +81,7 @@ module Fastly
82
81
  def ==(o)
83
82
  return true if self.equal?(o)
84
83
  self.class == o.class &&
85
- filter_fields == o.filter_fields
84
+ services == o.services
86
85
  end
87
86
 
88
87
  # @see the `==` method
@@ -94,7 +93,7 @@ module Fastly
94
93
  # Calculates hash code according to all attributes.
95
94
  # @return [Integer] Hash code
96
95
  def hash
97
- [filter_fields].hash
96
+ [services].hash
98
97
  end
99
98
 
100
99
  # Builds the object from hash
@@ -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://www.fastly.com/documentation/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'date'
12
+ require 'time'
13
+
14
+ module Fastly
15
+ class ApiDiscoveryResponseLinks
16
+ attr_accessor :_links
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'_links' => :'_links'
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
+ :'_links' => :'ApiDiscoveryResponseLinksLinks'
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::ApiDiscoveryResponseLinks` 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::ApiDiscoveryResponseLinks`. 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?(:'_links')
59
+ self._links = attributes[:'_links']
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
+ _links == o._links
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
+ [_links].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,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://www.fastly.com/documentation/reference/api/)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: oss@fastly.com
8
+
9
+ =end
10
+
11
+ require 'date'
12
+ require 'time'
13
+
14
+ module Fastly
15
+ class ApiDiscoveryResponseLinksGetAllServices
16
+ attr_accessor :_links
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'_links' => :'_links'
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
+ :'_links' => :'ApiDiscoveryResponseLinksGetAllServicesLinks'
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::ApiDiscoveryResponseLinksGetAllServices` 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::ApiDiscoveryResponseLinksGetAllServices`. 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?(:'_links')
59
+ self._links = attributes[:'_links']
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
+ _links == o._links
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
+ [_links].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