fastly 14.0.0 → 15.1.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 (222) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +45 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +22 -13
  5. data/docs/ApiDiscoveryResponseBodyGetAllServices.md +13 -0
  6. data/docs/ApiDiscoveryResponseCustomer.md +10 -0
  7. data/docs/ApiDiscoveryResponseCustomerCustomer.md +11 -0
  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/ApiDiscoveryResponseLinksGetAllServicesLinks.md +10 -0
  13. data/docs/ApiDiscoveryResponseLinksLinks.md +10 -0
  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/BotManagementResponseBodyEnable.md +1 -1
  19. data/docs/BotManagementResponseService.md +1 -1
  20. data/docs/BrotliCompressionResponseBodyEnable.md +1 -1
  21. data/docs/BrotliCompressionResponseService.md +1 -1
  22. data/docs/DdosProtectionApi.md +2 -0
  23. data/docs/DdosProtectionEvent.md +2 -0
  24. data/docs/DdosProtectionEventAllOf.md +2 -0
  25. data/docs/DdosProtectionRequestEnableMode.md +10 -0
  26. data/docs/DdosProtectionResponseConfigure.md +1 -1
  27. data/docs/DdosProtectionResponseEnable.md +1 -1
  28. data/docs/DdosProtectionResponseService.md +1 -1
  29. data/docs/DdosProtectionRuleWithStats.md +23 -0
  30. data/docs/DdosProtectionRuleWithStatsAllOf.md +10 -0
  31. data/docs/DdosProtectionTrafficStats.md +1 -0
  32. data/docs/DdosProtectionTrafficStatsAllOf.md +1 -0
  33. data/docs/DmDomainsApi.md +220 -0
  34. data/docs/DomainInspectorHistoricalApi.md +1 -1
  35. data/docs/DomainInspectorResponseBodyEnable.md +1 -1
  36. data/docs/DomainInspectorResponseService.md +1 -1
  37. data/docs/DomainOwnershipsApi.md +2 -2
  38. data/docs/DomainResearchApi.md +103 -0
  39. data/docs/DomainResearchResponseBodyEnable.md +12 -0
  40. data/docs/DomainResearchResponseCustomer.md +10 -0
  41. data/docs/DomainResearchResponseLinks.md +10 -0
  42. data/docs/DomainResearchResponseLinksLinks.md +10 -0
  43. data/docs/DomainResearchResponseProduct.md +10 -0
  44. data/docs/DomainResearchResponseProductProduct.md +11 -0
  45. data/docs/FanoutResponseBodyEnable.md +1 -1
  46. data/docs/FanoutResponseService.md +1 -1
  47. data/docs/Healthcheck.md +1 -1
  48. data/docs/HealthcheckApi.md +4 -4
  49. data/docs/HealthcheckResponse.md +1 -1
  50. data/docs/IamRolesApi.md +23 -253
  51. data/docs/IamV1RoleListResponse.md +12 -0
  52. data/docs/IamV1RoleResponse.md +14 -0
  53. data/docs/ImageOptimizerResponseBodyEnable.md +1 -1
  54. data/docs/ImageOptimizerResponseService.md +1 -1
  55. data/docs/InlineResponse20010.md +11 -0
  56. data/docs/InlineResponse20011.md +10 -0
  57. data/docs/InlineResponse2003.md +2 -2
  58. data/docs/InlineResponse2004.md +2 -1
  59. data/docs/InlineResponse2005.md +1 -2
  60. data/docs/InlineResponse2006.md +1 -2
  61. data/docs/InlineResponse2007.md +1 -1
  62. data/docs/InlineResponse2008.md +1 -1
  63. data/docs/InlineResponse2009.md +2 -1
  64. data/docs/InvitationDataAttributes.md +1 -0
  65. data/docs/KvStoreApi.md +43 -4
  66. data/docs/KvStoreDetails.md +2 -0
  67. data/docs/KvStoreItemApi.md +2 -2
  68. data/docs/{KvStoreRequestCreate.md → KvStoreRequestCreateOrUpdate.md} +1 -1
  69. data/docs/LogExplorerInsightsResponseBodyEnable.md +1 -1
  70. data/docs/LogExplorerInsightsResponseService.md +1 -1
  71. data/docs/LoggingHttpsAdditional.md +1 -0
  72. data/docs/LoggingHttpsApi.md +4 -0
  73. data/docs/LoggingHttpsResponse.md +1 -0
  74. data/docs/MetricsPlatformApi.md +75 -0
  75. data/docs/NgwafRequestEnable.md +1 -0
  76. data/docs/NgwafResponseConfigure.md +1 -1
  77. data/docs/NgwafResponseEnable.md +1 -1
  78. data/docs/NgwafResponseService.md +1 -1
  79. data/docs/Offer.md +12 -0
  80. data/docs/OfferAllOf.md +12 -0
  81. data/docs/OriginInspectorHistoricalApi.md +1 -1
  82. data/docs/OriginInspectorResponseBodyEnable.md +1 -1
  83. data/docs/OriginInspectorResponseService.md +1 -1
  84. data/docs/PlatformMetadata.md +14 -0
  85. data/docs/PlatformMetricsResponse.md +11 -0
  86. data/docs/PlatformValues.md +25 -0
  87. data/docs/ProductApiDiscoveryApi.md +163 -0
  88. data/docs/ProductDdosProtectionApi.md +3 -1
  89. data/docs/ProductDomainResearchApi.md +115 -0
  90. data/docs/RealtimeEntryAggregated.md +5 -0
  91. data/docs/RealtimeMeasurements.md +5 -0
  92. data/docs/RequestBodyForCreate.md +12 -0
  93. data/docs/RequestBodyForUpdate.md +11 -0
  94. data/docs/Results.md +5 -0
  95. data/docs/SchemasUserResponse.md +1 -0
  96. data/docs/SecretStoreApi.md +2 -2
  97. data/docs/SecretStoreItemApi.md +2 -2
  98. data/docs/ServiceAuthorizationsApi.md +2 -2
  99. data/docs/Status.md +15 -0
  100. data/docs/StatusAllOf.md +15 -0
  101. data/docs/SuccessfulResponseAsObject.md +17 -0
  102. data/docs/SuccessfulResponseAsObjectAllOf.md +15 -0
  103. data/docs/Suggestion.md +13 -0
  104. data/docs/SuggestionAllOf.md +13 -0
  105. data/docs/User.md +1 -0
  106. data/docs/UserApi.md +4 -0
  107. data/docs/UserResponse.md +1 -0
  108. data/docs/WebsocketsResponseBodyEnable.md +1 -1
  109. data/docs/WebsocketsResponseService.md +1 -1
  110. data/lib/fastly/api/ddos_protection_api.rb +3 -0
  111. data/lib/fastly/api/dm_domains_api.rb +362 -0
  112. data/lib/fastly/api/domain_inspector_historical_api.rb +1 -1
  113. data/lib/fastly/api/domain_ownerships_api.rb +3 -3
  114. data/lib/fastly/api/domain_research_api.rb +163 -0
  115. data/lib/fastly/api/healthcheck_api.rb +20 -4
  116. data/lib/fastly/api/iam_roles_api.rb +43 -435
  117. data/lib/fastly/api/kv_store_api.rb +74 -6
  118. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  119. data/lib/fastly/api/logging_https_api.rb +6 -0
  120. data/lib/fastly/api/metrics_platform_api.rb +134 -0
  121. data/lib/fastly/api/origin_inspector_historical_api.rb +1 -1
  122. data/lib/fastly/api/product_api_discovery_api.rb +263 -0
  123. data/lib/fastly/api/product_ddos_protection_api.rb +10 -3
  124. data/lib/fastly/api/product_domain_research_api.rb +186 -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/user_api.rb +6 -0
  129. data/lib/fastly/configuration.rb +98 -38
  130. data/lib/fastly/models/api_discovery_response_body_get_all_services.rb +256 -0
  131. data/lib/fastly/models/api_discovery_response_customer.rb +216 -0
  132. data/lib/fastly/models/api_discovery_response_customer_customer.rb +227 -0
  133. data/lib/fastly/models/api_discovery_response_enable.rb +243 -0
  134. data/lib/fastly/models/api_discovery_response_enabled_services.rb +219 -0
  135. data/lib/fastly/models/api_discovery_response_links.rb +216 -0
  136. data/lib/fastly/models/api_discovery_response_links_get_all_services.rb +216 -0
  137. data/lib/fastly/models/api_discovery_response_links_get_all_services_links.rb +217 -0
  138. data/lib/fastly/models/api_discovery_response_links_links.rb +217 -0
  139. data/lib/fastly/models/api_discovery_response_product.rb +216 -0
  140. data/lib/fastly/models/api_discovery_response_product_product.rb +227 -0
  141. data/lib/fastly/models/api_discovery_response_service.rb +216 -0
  142. data/lib/fastly/models/{bot_management_response_service_service.rb → api_discovery_response_service_service.rb} +3 -3
  143. data/lib/fastly/models/bot_management_response_body_enable.rb +1 -1
  144. data/lib/fastly/models/bot_management_response_service.rb +1 -1
  145. data/lib/fastly/models/brotli_compression_response_body_enable.rb +1 -1
  146. data/lib/fastly/models/brotli_compression_response_service.rb +1 -1
  147. data/lib/fastly/models/ddos_protection_event.rb +21 -1
  148. data/lib/fastly/models/ddos_protection_event_all_of.rb +21 -1
  149. data/lib/fastly/models/ddos_protection_request_enable_mode.rb +251 -0
  150. data/lib/fastly/models/ddos_protection_response_configure.rb +1 -1
  151. data/lib/fastly/models/ddos_protection_response_enable.rb +1 -1
  152. data/lib/fastly/models/ddos_protection_response_service.rb +1 -1
  153. data/lib/fastly/models/ddos_protection_rule_with_stats.rb +365 -0
  154. data/lib/fastly/models/ddos_protection_rule_with_stats_all_of.rb +216 -0
  155. data/lib/fastly/models/ddos_protection_traffic_stats.rb +20 -4
  156. data/lib/fastly/models/ddos_protection_traffic_stats_all_of.rb +20 -4
  157. data/lib/fastly/models/domain_inspector_response_body_enable.rb +1 -1
  158. data/lib/fastly/models/domain_inspector_response_service.rb +1 -1
  159. data/lib/fastly/models/domain_research_response_body_enable.rb +243 -0
  160. data/lib/fastly/models/domain_research_response_customer.rb +216 -0
  161. data/lib/fastly/models/domain_research_response_links.rb +216 -0
  162. data/lib/fastly/models/domain_research_response_links_links.rb +217 -0
  163. data/lib/fastly/models/domain_research_response_product.rb +216 -0
  164. data/lib/fastly/models/domain_research_response_product_product.rb +227 -0
  165. data/lib/fastly/models/fanout_response_body_enable.rb +1 -1
  166. data/lib/fastly/models/fanout_response_service.rb +1 -1
  167. data/lib/fastly/models/healthcheck.rb +25 -1
  168. data/lib/fastly/models/healthcheck_response.rb +25 -1
  169. data/lib/fastly/models/iam_v1_role_list_response.rb +240 -0
  170. data/lib/fastly/models/{iam_role_all_of.rb → iam_v1_role_response.rb} +23 -34
  171. data/lib/fastly/models/image_optimizer_response_body_enable.rb +1 -1
  172. data/lib/fastly/models/image_optimizer_response_service.rb +1 -1
  173. data/lib/fastly/models/inline_response20010.rb +227 -0
  174. data/lib/fastly/models/inline_response20011.rb +218 -0
  175. data/lib/fastly/models/inline_response2003.rb +11 -1
  176. data/lib/fastly/models/inline_response2004.rb +20 -8
  177. data/lib/fastly/models/inline_response2005.rb +8 -18
  178. data/lib/fastly/models/inline_response2006.rb +8 -17
  179. data/lib/fastly/models/inline_response2007.rb +1 -1
  180. data/lib/fastly/models/inline_response2008.rb +1 -1
  181. data/lib/fastly/models/inline_response2009.rb +13 -4
  182. data/lib/fastly/models/invitation_data_attributes.rb +12 -1
  183. data/lib/fastly/models/kv_store_details.rb +24 -4
  184. data/lib/fastly/models/{kv_store_request_create.rb → kv_store_request_create_or_update.rb} +3 -3
  185. data/lib/fastly/models/log_explorer_insights_response_body_enable.rb +1 -1
  186. data/lib/fastly/models/log_explorer_insights_response_service.rb +1 -1
  187. data/lib/fastly/models/logging_https_additional.rb +16 -4
  188. data/lib/fastly/models/logging_https_response.rb +13 -1
  189. data/lib/fastly/models/ngwaf_request_enable.rb +14 -4
  190. data/lib/fastly/models/ngwaf_response_configure.rb +1 -1
  191. data/lib/fastly/models/ngwaf_response_enable.rb +1 -1
  192. data/lib/fastly/models/ngwaf_response_service.rb +1 -1
  193. data/lib/fastly/models/offer.rb +245 -0
  194. data/lib/fastly/models/offer_all_of.rb +237 -0
  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/platform_metadata.rb +258 -0
  198. data/lib/fastly/models/platform_metrics_response.rb +228 -0
  199. data/lib/fastly/models/platform_values.rb +368 -0
  200. data/lib/fastly/models/realtime_entry_aggregated.rb +54 -4
  201. data/lib/fastly/models/realtime_measurements.rb +54 -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 +51 -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/status.rb +276 -0
  208. data/lib/fastly/models/status_all_of.rb +268 -0
  209. data/lib/fastly/models/{iam_role.rb → successful_response_as_object.rb} +37 -35
  210. data/lib/fastly/models/successful_response_as_object_all_of.rb +268 -0
  211. data/lib/fastly/models/suggestion.rb +255 -0
  212. data/lib/fastly/models/suggestion_all_of.rb +247 -0
  213. data/lib/fastly/models/user.rb +13 -1
  214. data/lib/fastly/models/user_response.rb +13 -1
  215. data/lib/fastly/models/websockets_response_body_enable.rb +1 -1
  216. data/lib/fastly/models/websockets_response_service.rb +1 -1
  217. data/lib/fastly/version.rb +1 -1
  218. data/lib/fastly.rb +45 -4
  219. data/sig.json +1 -1
  220. metadata +92 -10
  221. data/docs/IamRole.md +0 -17
  222. data/docs/IamRoleAllOf.md +0 -15
@@ -12,30 +12,31 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class IamRole
15
+ # All attributes for a domain response
16
+ class SuccessfulResponseAsObject
16
17
  # Date and time in ISO 8601 format.
17
18
  attr_accessor :created_at
18
19
 
19
20
  # Date and time in ISO 8601 format.
20
21
  attr_accessor :updated_at
21
22
 
22
- # Alphanumeric string identifying the role.
23
+ # Domain Identifier (UUID).
23
24
  attr_accessor :id
24
25
 
25
- # The type of the object.
26
- attr_accessor :object
26
+ # The fully-qualified domain name for your domain. Can be created, but not updated.
27
+ attr_accessor :fqdn
27
28
 
28
- # Name of the role.
29
- attr_accessor :name
29
+ # The `service_id` associated with your domain or `null` if there is no association.
30
+ attr_accessor :service_id
30
31
 
31
- # Description of the role.
32
+ # A freeform descriptive note.
32
33
  attr_accessor :description
33
34
 
34
- # This attribute is set to `true` if the role is managed by the customer. It is set to `false` if the role was created by Fastly.
35
- attr_accessor :custom
35
+ # Denotes if the domain has at least one TLS activation or not.
36
+ attr_accessor :activated
36
37
 
37
- # Number of permissions assigned to the role.
38
- attr_accessor :permissions_count
38
+ # Denotes that the customer has proven ownership over the domain by obtaining a Fastly-managed TLS certificate for it or by providing a their own TLS certificate from a publicly-trusted CA that includes the domain or matching wildcard.
39
+ attr_accessor :verified
39
40
 
40
41
  # Attribute mapping from ruby-style variable name to JSON key.
41
42
  def self.attribute_map
@@ -43,11 +44,11 @@ module Fastly
43
44
  :'created_at' => :'created_at',
44
45
  :'updated_at' => :'updated_at',
45
46
  :'id' => :'id',
46
- :'object' => :'object',
47
- :'name' => :'name',
47
+ :'fqdn' => :'fqdn',
48
+ :'service_id' => :'service_id',
48
49
  :'description' => :'description',
49
- :'custom' => :'custom',
50
- :'permissions_count' => :'permissions_count'
50
+ :'activated' => :'activated',
51
+ :'verified' => :'verified'
51
52
  }
52
53
  end
53
54
 
@@ -62,11 +63,11 @@ module Fastly
62
63
  :'created_at' => :'Time',
63
64
  :'updated_at' => :'Time',
64
65
  :'id' => :'String',
65
- :'object' => :'String',
66
- :'name' => :'String',
66
+ :'fqdn' => :'String',
67
+ :'service_id' => :'String',
67
68
  :'description' => :'String',
68
- :'custom' => :'Boolean',
69
- :'permissions_count' => :'Integer'
69
+ :'activated' => :'Boolean',
70
+ :'verified' => :'Boolean'
70
71
  }
71
72
  end
72
73
 
@@ -75,13 +76,14 @@ module Fastly
75
76
  Set.new([
76
77
  :'created_at',
77
78
  :'updated_at',
79
+ :'service_id',
78
80
  ])
79
81
  end
80
82
 
81
83
  # List of class defined in allOf (OpenAPI v3)
82
84
  def self.fastly_all_of
83
85
  [
84
- :'IamRoleAllOf',
86
+ :'SuccessfulResponseAsObjectAllOf',
85
87
  :'TimestampsNoDelete'
86
88
  ]
87
89
  end
@@ -90,13 +92,13 @@ module Fastly
90
92
  # @param [Hash] attributes Model attributes in the form of hash
91
93
  def initialize(attributes = {})
92
94
  if (!attributes.is_a?(Hash))
93
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::IamRole` initialize method"
95
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::SuccessfulResponseAsObject` initialize method"
94
96
  end
95
97
 
96
98
  # check to see if the attribute exists and convert string to symbol for hash key
97
99
  attributes = attributes.each_with_object({}) { |(k, v), h|
98
100
  if (!self.class.attribute_map.key?(k.to_sym))
99
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::IamRole`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::SuccessfulResponseAsObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
100
102
  end
101
103
  h[k.to_sym] = v
102
104
  }
@@ -113,24 +115,24 @@ module Fastly
113
115
  self.id = attributes[:'id']
114
116
  end
115
117
 
116
- if attributes.key?(:'object')
117
- self.object = attributes[:'object']
118
+ if attributes.key?(:'fqdn')
119
+ self.fqdn = attributes[:'fqdn']
118
120
  end
119
121
 
120
- if attributes.key?(:'name')
121
- self.name = attributes[:'name']
122
+ if attributes.key?(:'service_id')
123
+ self.service_id = attributes[:'service_id']
122
124
  end
123
125
 
124
126
  if attributes.key?(:'description')
125
127
  self.description = attributes[:'description']
126
128
  end
127
129
 
128
- if attributes.key?(:'custom')
129
- self.custom = attributes[:'custom']
130
+ if attributes.key?(:'activated')
131
+ self.activated = attributes[:'activated']
130
132
  end
131
133
 
132
- if attributes.key?(:'permissions_count')
133
- self.permissions_count = attributes[:'permissions_count']
134
+ if attributes.key?(:'verified')
135
+ self.verified = attributes[:'verified']
134
136
  end
135
137
  end
136
138
 
@@ -155,11 +157,11 @@ module Fastly
155
157
  created_at == o.created_at &&
156
158
  updated_at == o.updated_at &&
157
159
  id == o.id &&
158
- object == o.object &&
159
- name == o.name &&
160
+ fqdn == o.fqdn &&
161
+ service_id == o.service_id &&
160
162
  description == o.description &&
161
- custom == o.custom &&
162
- permissions_count == o.permissions_count
163
+ activated == o.activated &&
164
+ verified == o.verified
163
165
  end
164
166
 
165
167
  # @see the `==` method
@@ -171,7 +173,7 @@ module Fastly
171
173
  # Calculates hash code according to all attributes.
172
174
  # @return [Integer] Hash code
173
175
  def hash
174
- [created_at, updated_at, id, object, name, description, custom, permissions_count].hash
176
+ [created_at, updated_at, id, fqdn, service_id, description, activated, verified].hash
175
177
  end
176
178
 
177
179
  # Builds the object from hash
@@ -0,0 +1,268 @@
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 SuccessfulResponseAsObjectAllOf
16
+ # Domain Identifier (UUID).
17
+ attr_accessor :id
18
+
19
+ # The fully-qualified domain name for your domain. Can be created, but not updated.
20
+ attr_accessor :fqdn
21
+
22
+ # The `service_id` associated with your domain or `null` if there is no association.
23
+ attr_accessor :service_id
24
+
25
+ # A freeform descriptive note.
26
+ attr_accessor :description
27
+
28
+ # Denotes if the domain has at least one TLS activation or not.
29
+ attr_accessor :activated
30
+
31
+ # Denotes that the customer has proven ownership over the domain by obtaining a Fastly-managed TLS certificate for it or by providing a their own TLS certificate from a publicly-trusted CA that includes the domain or matching wildcard.
32
+ attr_accessor :verified
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'id' => :'id',
38
+ :'fqdn' => :'fqdn',
39
+ :'service_id' => :'service_id',
40
+ :'description' => :'description',
41
+ :'activated' => :'activated',
42
+ :'verified' => :'verified'
43
+ }
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.fastly_types
53
+ {
54
+ :'id' => :'String',
55
+ :'fqdn' => :'String',
56
+ :'service_id' => :'String',
57
+ :'description' => :'String',
58
+ :'activated' => :'Boolean',
59
+ :'verified' => :'Boolean'
60
+ }
61
+ end
62
+
63
+ # List of attributes with nullable: true
64
+ def self.fastly_nullable
65
+ Set.new([
66
+ :'service_id',
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::SuccessfulResponseAsObjectAllOf` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::SuccessfulResponseAsObjectAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'id')
86
+ self.id = attributes[:'id']
87
+ end
88
+
89
+ if attributes.key?(:'fqdn')
90
+ self.fqdn = attributes[:'fqdn']
91
+ end
92
+
93
+ if attributes.key?(:'service_id')
94
+ self.service_id = attributes[:'service_id']
95
+ end
96
+
97
+ if attributes.key?(:'description')
98
+ self.description = attributes[:'description']
99
+ end
100
+
101
+ if attributes.key?(:'activated')
102
+ self.activated = attributes[:'activated']
103
+ end
104
+
105
+ if attributes.key?(:'verified')
106
+ self.verified = attributes[:'verified']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ invalid_properties
115
+ end
116
+
117
+ # Check to see if the all the properties in the model are valid
118
+ # @return true if the model is valid
119
+ def valid?
120
+ true
121
+ end
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] Object to be compared
125
+ def ==(o)
126
+ return true if self.equal?(o)
127
+ self.class == o.class &&
128
+ id == o.id &&
129
+ fqdn == o.fqdn &&
130
+ service_id == o.service_id &&
131
+ description == o.description &&
132
+ activated == o.activated &&
133
+ verified == o.verified
134
+ end
135
+
136
+ # @see the `==` method
137
+ # @param [Object] Object to be compared
138
+ def eql?(o)
139
+ self == o
140
+ end
141
+
142
+ # Calculates hash code according to all attributes.
143
+ # @return [Integer] Hash code
144
+ def hash
145
+ [id, fqdn, service_id, description, activated, verified].hash
146
+ end
147
+
148
+ # Builds the object from hash
149
+ # @param [Hash] attributes Model attributes in the form of hash
150
+ # @return [Object] Returns the model itself
151
+ def self.build_from_hash(attributes)
152
+ new.build_from_hash(attributes)
153
+ end
154
+
155
+ # Builds the object from hash
156
+ # @param [Hash] attributes Model attributes in the form of hash
157
+ # @return [Object] Returns the model itself
158
+ def build_from_hash(attributes)
159
+ return nil unless attributes.is_a?(Hash)
160
+ self.class.fastly_types.each_pair do |key, type|
161
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
162
+ self.send("#{key}=", nil)
163
+ elsif type =~ /\AArray<(.*)>/i
164
+ # check to ensure the input is an array given that the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
167
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
168
+ end
169
+ elsif !attributes[self.class.attribute_map[key]].nil?
170
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
171
+ end
172
+ end
173
+
174
+ self
175
+ end
176
+
177
+ # Deserializes the data based on type
178
+ # @param string type Data type
179
+ # @param string value Value to be deserialized
180
+ # @return [Object] Deserialized data
181
+ def _deserialize(type, value)
182
+ case type.to_sym
183
+ when :Time
184
+ Time.parse(value)
185
+ when :Date
186
+ Date.parse(value)
187
+ when :String
188
+ value.to_s
189
+ when :Integer
190
+ value.to_i
191
+ when :Float
192
+ value.to_f
193
+ when :Boolean
194
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
195
+ true
196
+ else
197
+ false
198
+ end
199
+ when :Object
200
+ # generic object (usually a Hash), return directly
201
+ value
202
+ when /\AArray<(?<inner_type>.+)>\z/
203
+ inner_type = Regexp.last_match[:inner_type]
204
+ value.map { |v| _deserialize(inner_type, v) }
205
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
206
+ k_type = Regexp.last_match[:k_type]
207
+ v_type = Regexp.last_match[:v_type]
208
+ {}.tap do |hash|
209
+ value.each do |k, v|
210
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
211
+ end
212
+ end
213
+ else # model
214
+ # models (e.g. Pet) or oneOf
215
+ klass = Fastly.const_get(type)
216
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
217
+ end
218
+ end
219
+
220
+ # Returns the string representation of the object
221
+ # @return [String] String presentation of the object
222
+ def to_s
223
+ to_hash.to_s
224
+ end
225
+
226
+ # to_body is an alias to to_hash (backward compatibility)
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_body
229
+ to_hash
230
+ end
231
+
232
+ # Returns the object in the form of hash
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_hash
235
+ hash = {}
236
+ self.class.attribute_map.each_pair do |attr, param|
237
+ value = self.send(attr)
238
+ if value.nil?
239
+ is_nullable = self.class.fastly_nullable.include?(attr)
240
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
241
+ end
242
+
243
+ hash[param] = _to_hash(value)
244
+ end
245
+ hash
246
+ end
247
+
248
+ # Outputs non-array value in the form of hash
249
+ # For object, use to_hash. Otherwise, just return the value
250
+ # @param [Object] value Any valid value
251
+ # @return [Hash] Returns the value in the form of hash
252
+ def _to_hash(value)
253
+ if value.is_a?(Array)
254
+ value.compact.map { |v| _to_hash(v) }
255
+ elsif value.is_a?(Hash)
256
+ {}.tap do |hash|
257
+ value.each { |k, v| hash[k] = _to_hash(v) }
258
+ end
259
+ elsif value.respond_to? :to_hash
260
+ value.to_hash
261
+ else
262
+ value
263
+ end
264
+ end
265
+
266
+ end
267
+
268
+ end
@@ -0,0 +1,255 @@
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
+ # All attributes for a suggested domain.
16
+ class Suggestion
17
+ # The suggested domain, consisting of a subdomain and zone.
18
+ attr_accessor :domain
19
+
20
+ # The subdomain of the suggested domain.
21
+ attr_accessor :subdomain
22
+
23
+ # The zone of the suggested domain.
24
+ attr_accessor :zone
25
+
26
+ # If present, the path is to be appended to the domain to complete the suggestion.
27
+ attr_accessor :path
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'domain' => :'domain',
33
+ :'subdomain' => :'subdomain',
34
+ :'zone' => :'zone',
35
+ :'path' => :'path'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.fastly_types
46
+ {
47
+ :'domain' => :'String',
48
+ :'subdomain' => :'String',
49
+ :'zone' => :'String',
50
+ :'path' => :'String'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.fastly_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # List of class defined in allOf (OpenAPI v3)
61
+ def self.fastly_all_of
62
+ [
63
+ :'SuggestionAllOf'
64
+ ]
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Suggestion` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!self.class.attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Suggestion`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'domain')
83
+ self.domain = attributes[:'domain']
84
+ end
85
+
86
+ if attributes.key?(:'subdomain')
87
+ self.subdomain = attributes[:'subdomain']
88
+ end
89
+
90
+ if attributes.key?(:'zone')
91
+ self.zone = attributes[:'zone']
92
+ end
93
+
94
+ if attributes.key?(:'path')
95
+ self.path = attributes[:'path']
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ invalid_properties
104
+ end
105
+
106
+ # Check to see if the all the properties in the model are valid
107
+ # @return true if the model is valid
108
+ def valid?
109
+ true
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ domain == o.domain &&
118
+ subdomain == o.subdomain &&
119
+ zone == o.zone &&
120
+ path == o.path
121
+ end
122
+
123
+ # @see the `==` method
124
+ # @param [Object] Object to be compared
125
+ def eql?(o)
126
+ self == o
127
+ end
128
+
129
+ # Calculates hash code according to all attributes.
130
+ # @return [Integer] Hash code
131
+ def hash
132
+ [domain, subdomain, zone, path].hash
133
+ end
134
+
135
+ # Builds the object from hash
136
+ # @param [Hash] attributes Model attributes in the form of hash
137
+ # @return [Object] Returns the model itself
138
+ def self.build_from_hash(attributes)
139
+ new.build_from_hash(attributes)
140
+ end
141
+
142
+ # Builds the object from hash
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ # @return [Object] Returns the model itself
145
+ def build_from_hash(attributes)
146
+ return nil unless attributes.is_a?(Hash)
147
+ self.class.fastly_types.each_pair do |key, type|
148
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
149
+ self.send("#{key}=", nil)
150
+ elsif type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = Fastly.const_get(type)
203
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.fastly_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end