fastly 14.0.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 (166) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +13 -11
  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/DdosProtectionResponseConfigure.md +1 -1
  24. data/docs/DdosProtectionResponseEnable.md +1 -1
  25. data/docs/DdosProtectionResponseService.md +1 -1
  26. data/docs/DdosProtectionRuleWithStats.md +23 -0
  27. data/docs/DdosProtectionRuleWithStatsAllOf.md +10 -0
  28. data/docs/DdosProtectionTrafficStats.md +1 -0
  29. data/docs/DdosProtectionTrafficStatsAllOf.md +1 -0
  30. data/docs/DmDomainsApi.md +220 -0
  31. data/docs/DomainInspectorResponseBodyEnable.md +1 -1
  32. data/docs/DomainInspectorResponseService.md +1 -1
  33. data/docs/DomainOwnershipsApi.md +2 -2
  34. data/docs/FanoutResponseBodyEnable.md +1 -1
  35. data/docs/FanoutResponseService.md +1 -1
  36. data/docs/Healthcheck.md +1 -1
  37. data/docs/HealthcheckApi.md +4 -4
  38. data/docs/HealthcheckResponse.md +1 -1
  39. data/docs/IamRolesApi.md +23 -253
  40. data/docs/IamV1RoleListResponse.md +12 -0
  41. data/docs/IamV1RoleResponse.md +13 -0
  42. data/docs/ImageOptimizerResponseBodyEnable.md +1 -1
  43. data/docs/ImageOptimizerResponseService.md +1 -1
  44. data/docs/InlineResponse20010.md +10 -0
  45. data/docs/InlineResponse2003.md +2 -2
  46. data/docs/InlineResponse2004.md +2 -1
  47. data/docs/InlineResponse2005.md +1 -2
  48. data/docs/InlineResponse2006.md +1 -1
  49. data/docs/InlineResponse2007.md +1 -1
  50. data/docs/InlineResponse2008.md +1 -1
  51. data/docs/InlineResponse2009.md +2 -1
  52. data/docs/InvitationDataAttributes.md +1 -0
  53. data/docs/KvStoreApi.md +2 -2
  54. data/docs/KvStoreItemApi.md +2 -2
  55. data/docs/LogExplorerInsightsResponseBodyEnable.md +1 -1
  56. data/docs/LogExplorerInsightsResponseService.md +1 -1
  57. data/docs/LoggingHttpsAdditional.md +1 -0
  58. data/docs/LoggingHttpsApi.md +4 -0
  59. data/docs/LoggingHttpsResponse.md +1 -0
  60. data/docs/NgwafResponseConfigure.md +1 -1
  61. data/docs/NgwafResponseEnable.md +1 -1
  62. data/docs/NgwafResponseService.md +1 -1
  63. data/docs/OriginInspectorResponseBodyEnable.md +1 -1
  64. data/docs/OriginInspectorResponseService.md +1 -1
  65. data/docs/ProductApiDiscoveryApi.md +163 -0
  66. data/docs/RealtimeEntryAggregated.md +1 -0
  67. data/docs/RealtimeMeasurements.md +1 -0
  68. data/docs/RequestBodyForCreate.md +12 -0
  69. data/docs/RequestBodyForUpdate.md +11 -0
  70. data/docs/Results.md +1 -0
  71. data/docs/SchemasUserResponse.md +1 -0
  72. data/docs/SecretStoreApi.md +2 -2
  73. data/docs/SecretStoreItemApi.md +2 -2
  74. data/docs/ServiceAuthorizationsApi.md +2 -2
  75. data/docs/SuccessfulResponseAsObject.md +17 -0
  76. data/docs/SuccessfulResponseAsObjectAllOf.md +15 -0
  77. data/docs/User.md +1 -0
  78. data/docs/UserApi.md +4 -0
  79. data/docs/UserResponse.md +1 -0
  80. data/docs/WebsocketsResponseBodyEnable.md +1 -1
  81. data/docs/WebsocketsResponseService.md +1 -1
  82. data/lib/fastly/api/ddos_protection_api.rb +3 -0
  83. data/lib/fastly/api/dm_domains_api.rb +362 -0
  84. data/lib/fastly/api/domain_ownerships_api.rb +3 -3
  85. data/lib/fastly/api/healthcheck_api.rb +20 -4
  86. data/lib/fastly/api/iam_roles_api.rb +43 -435
  87. data/lib/fastly/api/kv_store_api.rb +3 -3
  88. data/lib/fastly/api/kv_store_item_api.rb +3 -3
  89. data/lib/fastly/api/logging_https_api.rb +6 -0
  90. data/lib/fastly/api/product_api_discovery_api.rb +263 -0
  91. data/lib/fastly/api/secret_store_api.rb +3 -3
  92. data/lib/fastly/api/secret_store_item_api.rb +3 -3
  93. data/lib/fastly/api/service_authorizations_api.rb +3 -3
  94. data/lib/fastly/api/user_api.rb +6 -0
  95. data/lib/fastly/configuration.rb +56 -38
  96. data/lib/fastly/models/api_discovery_response_body_get_all_services.rb +256 -0
  97. data/lib/fastly/models/api_discovery_response_customer.rb +216 -0
  98. data/lib/fastly/models/api_discovery_response_customer_customer.rb +227 -0
  99. data/lib/fastly/models/api_discovery_response_enable.rb +243 -0
  100. data/lib/fastly/models/api_discovery_response_enabled_services.rb +219 -0
  101. data/lib/fastly/models/api_discovery_response_links.rb +216 -0
  102. data/lib/fastly/models/api_discovery_response_links_get_all_services.rb +216 -0
  103. data/lib/fastly/models/api_discovery_response_links_get_all_services_links.rb +217 -0
  104. data/lib/fastly/models/api_discovery_response_links_links.rb +217 -0
  105. data/lib/fastly/models/api_discovery_response_product.rb +216 -0
  106. data/lib/fastly/models/api_discovery_response_product_product.rb +227 -0
  107. data/lib/fastly/models/api_discovery_response_service.rb +216 -0
  108. data/lib/fastly/models/{bot_management_response_service_service.rb → api_discovery_response_service_service.rb} +3 -3
  109. data/lib/fastly/models/bot_management_response_body_enable.rb +1 -1
  110. data/lib/fastly/models/bot_management_response_service.rb +1 -1
  111. data/lib/fastly/models/brotli_compression_response_body_enable.rb +1 -1
  112. data/lib/fastly/models/brotli_compression_response_service.rb +1 -1
  113. data/lib/fastly/models/ddos_protection_response_configure.rb +1 -1
  114. data/lib/fastly/models/ddos_protection_response_enable.rb +1 -1
  115. data/lib/fastly/models/ddos_protection_response_service.rb +1 -1
  116. data/lib/fastly/models/ddos_protection_rule_with_stats.rb +365 -0
  117. data/lib/fastly/models/ddos_protection_rule_with_stats_all_of.rb +216 -0
  118. data/lib/fastly/models/ddos_protection_traffic_stats.rb +20 -4
  119. data/lib/fastly/models/ddos_protection_traffic_stats_all_of.rb +20 -4
  120. data/lib/fastly/models/domain_inspector_response_body_enable.rb +1 -1
  121. data/lib/fastly/models/domain_inspector_response_service.rb +1 -1
  122. data/lib/fastly/models/fanout_response_body_enable.rb +1 -1
  123. data/lib/fastly/models/fanout_response_service.rb +1 -1
  124. data/lib/fastly/models/healthcheck.rb +25 -1
  125. data/lib/fastly/models/healthcheck_response.rb +25 -1
  126. data/lib/fastly/models/iam_v1_role_list_response.rb +240 -0
  127. data/lib/fastly/models/{iam_role_all_of.rb → iam_v1_role_response.rb} +14 -34
  128. data/lib/fastly/models/image_optimizer_response_body_enable.rb +1 -1
  129. data/lib/fastly/models/image_optimizer_response_service.rb +1 -1
  130. data/lib/fastly/models/inline_response20010.rb +218 -0
  131. data/lib/fastly/models/inline_response2003.rb +11 -1
  132. data/lib/fastly/models/inline_response2004.rb +20 -8
  133. data/lib/fastly/models/inline_response2005.rb +8 -18
  134. data/lib/fastly/models/inline_response2006.rb +1 -1
  135. data/lib/fastly/models/inline_response2007.rb +1 -1
  136. data/lib/fastly/models/inline_response2008.rb +1 -1
  137. data/lib/fastly/models/inline_response2009.rb +13 -4
  138. data/lib/fastly/models/invitation_data_attributes.rb +12 -1
  139. data/lib/fastly/models/log_explorer_insights_response_body_enable.rb +1 -1
  140. data/lib/fastly/models/log_explorer_insights_response_service.rb +1 -1
  141. data/lib/fastly/models/logging_https_additional.rb +16 -4
  142. data/lib/fastly/models/logging_https_response.rb +13 -1
  143. data/lib/fastly/models/ngwaf_response_configure.rb +1 -1
  144. data/lib/fastly/models/ngwaf_response_enable.rb +1 -1
  145. data/lib/fastly/models/ngwaf_response_service.rb +1 -1
  146. data/lib/fastly/models/origin_inspector_response_body_enable.rb +1 -1
  147. data/lib/fastly/models/origin_inspector_response_service.rb +1 -1
  148. data/lib/fastly/models/realtime_entry_aggregated.rb +14 -4
  149. data/lib/fastly/models/realtime_measurements.rb +14 -4
  150. data/lib/fastly/models/request_body_for_create.rb +244 -0
  151. data/lib/fastly/models/request_body_for_update.rb +229 -0
  152. data/lib/fastly/models/results.rb +11 -1
  153. data/lib/fastly/models/role_user.rb +2 -0
  154. data/lib/fastly/models/schemas_user_response.rb +13 -1
  155. data/lib/fastly/models/{iam_role.rb → successful_response_as_object.rb} +37 -35
  156. data/lib/fastly/models/successful_response_as_object_all_of.rb +268 -0
  157. data/lib/fastly/models/user.rb +13 -1
  158. data/lib/fastly/models/user_response.rb +13 -1
  159. data/lib/fastly/models/websockets_response_body_enable.rb +1 -1
  160. data/lib/fastly/models/websockets_response_service.rb +1 -1
  161. data/lib/fastly/version.rb +1 -1
  162. data/lib/fastly.rb +24 -3
  163. data/sig.json +1 -1
  164. metadata +50 -8
  165. data/docs/IamRole.md +0 -17
  166. data/docs/IamRoleAllOf.md +0 -15
@@ -21,12 +21,16 @@ module Fastly
21
21
 
22
22
  attr_accessor :attributes
23
23
 
24
+ # Rule traffic percentage for the event.
25
+ attr_accessor :traffic_percentage
26
+
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
27
30
  :'customer_id' => :'customer_id',
28
31
  :'service_id' => :'service_id',
29
- :'attributes' => :'attributes'
32
+ :'attributes' => :'attributes',
33
+ :'traffic_percentage' => :'traffic_percentage'
30
34
  }
31
35
  end
32
36
 
@@ -40,7 +44,8 @@ module Fastly
40
44
  {
41
45
  :'customer_id' => :'String',
42
46
  :'service_id' => :'String',
43
- :'attributes' => :'Array<DdosProtectionAttributeStats>'
47
+ :'attributes' => :'Array<DdosProtectionAttributeStats>',
48
+ :'traffic_percentage' => :'Float'
44
49
  }
45
50
  end
46
51
 
@@ -78,6 +83,10 @@ module Fastly
78
83
  self.attributes = value
79
84
  end
80
85
  end
86
+
87
+ if attributes.key?(:'traffic_percentage')
88
+ self.traffic_percentage = attributes[:'traffic_percentage']
89
+ end
81
90
  end
82
91
 
83
92
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -93,6 +102,12 @@ module Fastly
93
102
  true
94
103
  end
95
104
 
105
+ # Custom attribute writer method with validation
106
+ # @param [Object] traffic_percentage Value to be assigned
107
+ def traffic_percentage=(traffic_percentage)
108
+ @traffic_percentage = traffic_percentage
109
+ end
110
+
96
111
  # Checks equality by comparing each attribute.
97
112
  # @param [Object] Object to be compared
98
113
  def ==(o)
@@ -100,7 +115,8 @@ module Fastly
100
115
  self.class == o.class &&
101
116
  customer_id == o.customer_id &&
102
117
  service_id == o.service_id &&
103
- attributes == o.attributes
118
+ attributes == o.attributes &&
119
+ traffic_percentage == o.traffic_percentage
104
120
  end
105
121
 
106
122
  # @see the `==` method
@@ -112,7 +128,7 @@ module Fastly
112
128
  # Calculates hash code according to all attributes.
113
129
  # @return [Integer] Hash code
114
130
  def hash
115
- [customer_id, service_id, attributes].hash
131
+ [customer_id, service_id, attributes, traffic_percentage].hash
116
132
  end
117
133
 
118
134
  # Builds the object from hash
@@ -37,7 +37,7 @@ module Fastly
37
37
  def self.fastly_types
38
38
  {
39
39
  :'product' => :'DomainInspectorResponseProductProduct',
40
- :'service' => :'BotManagementResponseServiceService',
40
+ :'service' => :'ApiDiscoveryResponseServiceService',
41
41
  :'_links' => :'DomainInspectorResponseLinksLinks'
42
42
  }
43
43
  end
@@ -30,7 +30,7 @@ module Fastly
30
30
  # Attribute type mapping.
31
31
  def self.fastly_types
32
32
  {
33
- :'service' => :'BotManagementResponseServiceService'
33
+ :'service' => :'ApiDiscoveryResponseServiceService'
34
34
  }
35
35
  end
36
36
 
@@ -37,7 +37,7 @@ module Fastly
37
37
  def self.fastly_types
38
38
  {
39
39
  :'product' => :'FanoutResponseProductProduct',
40
- :'service' => :'BotManagementResponseServiceService',
40
+ :'service' => :'ApiDiscoveryResponseServiceService',
41
41
  :'_links' => :'FanoutResponseLinksLinks'
42
42
  }
43
43
  end
@@ -30,7 +30,7 @@ module Fastly
30
30
  # Attribute type mapping.
31
31
  def self.fastly_types
32
32
  {
33
- :'service' => :'BotManagementResponseServiceService'
33
+ :'service' => :'ApiDiscoveryResponseServiceService'
34
34
  }
35
35
  end
36
36
 
@@ -13,7 +13,7 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class Healthcheck
16
- # How often to run the health check in milliseconds.
16
+ # How often to run the health check in milliseconds. Minimum 1 second, maximum 1 hour.
17
17
  attr_accessor :check_interval
18
18
 
19
19
  # A freeform descriptive note.
@@ -176,15 +176,39 @@ module Fastly
176
176
  # @return Array for valid properties with the reasons
177
177
  def list_invalid_properties
178
178
  invalid_properties = Array.new
179
+ if !@check_interval.nil? && @check_interval > 3600000
180
+ invalid_properties.push('invalid value for "check_interval", must be smaller than or equal to 3600000.')
181
+ end
182
+
183
+ if !@check_interval.nil? && @check_interval < 1000
184
+ invalid_properties.push('invalid value for "check_interval", must be greater than or equal to 1000.')
185
+ end
186
+
179
187
  invalid_properties
180
188
  end
181
189
 
182
190
  # Check to see if the all the properties in the model are valid
183
191
  # @return true if the model is valid
184
192
  def valid?
193
+ return false if !@check_interval.nil? && @check_interval > 3600000
194
+ return false if !@check_interval.nil? && @check_interval < 1000
185
195
  true
186
196
  end
187
197
 
198
+ # Custom attribute writer method with validation
199
+ # @param [Object] check_interval Value to be assigned
200
+ def check_interval=(check_interval)
201
+ if !check_interval.nil? && check_interval > 3600000
202
+ fail ArgumentError, 'invalid value for "check_interval", must be smaller than or equal to 3600000.'
203
+ end
204
+
205
+ if !check_interval.nil? && check_interval < 1000
206
+ fail ArgumentError, 'invalid value for "check_interval", must be greater than or equal to 1000.'
207
+ end
208
+
209
+ @check_interval = check_interval
210
+ end
211
+
188
212
  # Checks equality by comparing each attribute.
189
213
  # @param [Object] Object to be compared
190
214
  def ==(o)
@@ -13,7 +13,7 @@ require 'time'
13
13
 
14
14
  module Fastly
15
15
  class HealthcheckResponse
16
- # How often to run the health check in milliseconds.
16
+ # How often to run the health check in milliseconds. Minimum 1 second, maximum 1 hour.
17
17
  attr_accessor :check_interval
18
18
 
19
19
  # A freeform descriptive note.
@@ -231,15 +231,39 @@ module Fastly
231
231
  # @return Array for valid properties with the reasons
232
232
  def list_invalid_properties
233
233
  invalid_properties = Array.new
234
+ if !@check_interval.nil? && @check_interval > 3600000
235
+ invalid_properties.push('invalid value for "check_interval", must be smaller than or equal to 3600000.')
236
+ end
237
+
238
+ if !@check_interval.nil? && @check_interval < 1000
239
+ invalid_properties.push('invalid value for "check_interval", must be greater than or equal to 1000.')
240
+ end
241
+
234
242
  invalid_properties
235
243
  end
236
244
 
237
245
  # Check to see if the all the properties in the model are valid
238
246
  # @return true if the model is valid
239
247
  def valid?
248
+ return false if !@check_interval.nil? && @check_interval > 3600000
249
+ return false if !@check_interval.nil? && @check_interval < 1000
240
250
  true
241
251
  end
242
252
 
253
+ # Custom attribute writer method with validation
254
+ # @param [Object] check_interval Value to be assigned
255
+ def check_interval=(check_interval)
256
+ if !check_interval.nil? && check_interval > 3600000
257
+ fail ArgumentError, 'invalid value for "check_interval", must be smaller than or equal to 3600000.'
258
+ end
259
+
260
+ if !check_interval.nil? && check_interval < 1000
261
+ fail ArgumentError, 'invalid value for "check_interval", must be greater than or equal to 1000.'
262
+ end
263
+
264
+ @check_interval = check_interval
265
+ end
266
+
243
267
  # Checks equality by comparing each attribute.
244
268
  # @param [Object] Object to be compared
245
269
  def ==(o)
@@ -0,0 +1,240 @@
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
+ # Paginated list of IAM roles.
16
+ class IamV1RoleListResponse
17
+ # Maximum number of results returned.
18
+ attr_accessor :limit
19
+
20
+ # Cursor for the next page.
21
+ attr_accessor :next_cursor
22
+
23
+ # Page of IAM roles (length ≤ limit).
24
+ attr_accessor :data
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'limit' => :'limit',
30
+ :'next_cursor' => :'next_cursor',
31
+ :'data' => :'data'
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.fastly_types
42
+ {
43
+ :'limit' => :'Integer',
44
+ :'next_cursor' => :'String',
45
+ :'data' => :'Array<IamV1RoleResponse>'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.fastly_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::IamV1RoleListResponse` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!self.class.attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::IamV1RoleListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'limit')
71
+ self.limit = attributes[:'limit']
72
+ end
73
+
74
+ if attributes.key?(:'next_cursor')
75
+ self.next_cursor = attributes[:'next_cursor']
76
+ end
77
+
78
+ if attributes.key?(:'data')
79
+ if (value = attributes[:'data']).is_a?(Array)
80
+ self.data = value
81
+ end
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ invalid_properties
90
+ end
91
+
92
+ # Check to see if the all the properties in the model are valid
93
+ # @return true if the model is valid
94
+ def valid?
95
+ true
96
+ end
97
+
98
+ # Checks equality by comparing each attribute.
99
+ # @param [Object] Object to be compared
100
+ def ==(o)
101
+ return true if self.equal?(o)
102
+ self.class == o.class &&
103
+ limit == o.limit &&
104
+ next_cursor == o.next_cursor &&
105
+ data == o.data
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(o)
111
+ self == o
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [limit, next_cursor, data].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ new.build_from_hash(attributes)
125
+ end
126
+
127
+ # Builds the object from hash
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ # @return [Object] Returns the model itself
130
+ def build_from_hash(attributes)
131
+ return nil unless attributes.is_a?(Hash)
132
+ self.class.fastly_types.each_pair do |key, type|
133
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
134
+ self.send("#{key}=", nil)
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
139
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
140
+ end
141
+ elsif !attributes[self.class.attribute_map[key]].nil?
142
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
143
+ end
144
+ end
145
+
146
+ self
147
+ end
148
+
149
+ # Deserializes the data based on type
150
+ # @param string type Data type
151
+ # @param string value Value to be deserialized
152
+ # @return [Object] Deserialized data
153
+ def _deserialize(type, value)
154
+ case type.to_sym
155
+ when :Time
156
+ Time.parse(value)
157
+ when :Date
158
+ Date.parse(value)
159
+ when :String
160
+ value.to_s
161
+ when :Integer
162
+ value.to_i
163
+ when :Float
164
+ value.to_f
165
+ when :Boolean
166
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
167
+ true
168
+ else
169
+ false
170
+ end
171
+ when :Object
172
+ # generic object (usually a Hash), return directly
173
+ value
174
+ when /\AArray<(?<inner_type>.+)>\z/
175
+ inner_type = Regexp.last_match[:inner_type]
176
+ value.map { |v| _deserialize(inner_type, v) }
177
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
178
+ k_type = Regexp.last_match[:k_type]
179
+ v_type = Regexp.last_match[:v_type]
180
+ {}.tap do |hash|
181
+ value.each do |k, v|
182
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
183
+ end
184
+ end
185
+ else # model
186
+ # models (e.g. Pet) or oneOf
187
+ klass = Fastly.const_get(type)
188
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
189
+ end
190
+ end
191
+
192
+ # Returns the string representation of the object
193
+ # @return [String] String presentation of the object
194
+ def to_s
195
+ to_hash.to_s
196
+ end
197
+
198
+ # to_body is an alias to to_hash (backward compatibility)
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_body
201
+ to_hash
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.fastly_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+
238
+ end
239
+
240
+ end
@@ -12,34 +12,24 @@ require 'date'
12
12
  require 'time'
13
13
 
14
14
  module Fastly
15
- class IamRoleAllOf
16
- # Alphanumeric string identifying the role.
15
+ # An IAM role.
16
+ class IamV1RoleResponse
17
17
  attr_accessor :id
18
18
 
19
- # The type of the object.
20
- attr_accessor :object
21
-
22
- # Name of the role.
23
19
  attr_accessor :name
24
20
 
25
- # Description of the role.
26
21
  attr_accessor :description
27
22
 
28
- # 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.
29
- attr_accessor :custom
30
-
31
- # Number of permissions assigned to the role.
32
- attr_accessor :permissions_count
23
+ # The set of permissions granted to this role.
24
+ attr_accessor :permissions
33
25
 
34
26
  # Attribute mapping from ruby-style variable name to JSON key.
35
27
  def self.attribute_map
36
28
  {
37
29
  :'id' => :'id',
38
- :'object' => :'object',
39
30
  :'name' => :'name',
40
31
  :'description' => :'description',
41
- :'custom' => :'custom',
42
- :'permissions_count' => :'permissions_count'
32
+ :'permissions' => :'permissions'
43
33
  }
44
34
  end
45
35
 
@@ -52,11 +42,9 @@ module Fastly
52
42
  def self.fastly_types
53
43
  {
54
44
  :'id' => :'String',
55
- :'object' => :'String',
56
45
  :'name' => :'String',
57
46
  :'description' => :'String',
58
- :'custom' => :'Boolean',
59
- :'permissions_count' => :'Integer'
47
+ :'permissions' => :'Array<String>'
60
48
  }
61
49
  end
62
50
 
@@ -70,13 +58,13 @@ module Fastly
70
58
  # @param [Hash] attributes Model attributes in the form of hash
71
59
  def initialize(attributes = {})
72
60
  if (!attributes.is_a?(Hash))
73
- fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::IamRoleAllOf` initialize method"
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::IamV1RoleResponse` initialize method"
74
62
  end
75
63
 
76
64
  # check to see if the attribute exists and convert string to symbol for hash key
77
65
  attributes = attributes.each_with_object({}) { |(k, v), h|
78
66
  if (!self.class.attribute_map.key?(k.to_sym))
79
- fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::IamRoleAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::IamV1RoleResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
68
  end
81
69
  h[k.to_sym] = v
82
70
  }
@@ -85,10 +73,6 @@ module Fastly
85
73
  self.id = attributes[:'id']
86
74
  end
87
75
 
88
- if attributes.key?(:'object')
89
- self.object = attributes[:'object']
90
- end
91
-
92
76
  if attributes.key?(:'name')
93
77
  self.name = attributes[:'name']
94
78
  end
@@ -97,12 +81,10 @@ module Fastly
97
81
  self.description = attributes[:'description']
98
82
  end
99
83
 
100
- if attributes.key?(:'custom')
101
- self.custom = attributes[:'custom']
102
- end
103
-
104
- if attributes.key?(:'permissions_count')
105
- self.permissions_count = attributes[:'permissions_count']
84
+ if attributes.key?(:'permissions')
85
+ if (value = attributes[:'permissions']).is_a?(Array)
86
+ self.permissions = value
87
+ end
106
88
  end
107
89
  end
108
90
 
@@ -125,11 +107,9 @@ module Fastly
125
107
  return true if self.equal?(o)
126
108
  self.class == o.class &&
127
109
  id == o.id &&
128
- object == o.object &&
129
110
  name == o.name &&
130
111
  description == o.description &&
131
- custom == o.custom &&
132
- permissions_count == o.permissions_count
112
+ permissions == o.permissions
133
113
  end
134
114
 
135
115
  # @see the `==` method
@@ -141,7 +121,7 @@ module Fastly
141
121
  # Calculates hash code according to all attributes.
142
122
  # @return [Integer] Hash code
143
123
  def hash
144
- [id, object, name, description, custom, permissions_count].hash
124
+ [id, name, description, permissions].hash
145
125
  end
146
126
 
147
127
  # Builds the object from hash
@@ -37,7 +37,7 @@ module Fastly
37
37
  def self.fastly_types
38
38
  {
39
39
  :'product' => :'ImageOptimizerResponseProductProduct',
40
- :'service' => :'BotManagementResponseServiceService',
40
+ :'service' => :'ApiDiscoveryResponseServiceService',
41
41
  :'_links' => :'ImageOptimizerResponseLinksLinks'
42
42
  }
43
43
  end
@@ -30,7 +30,7 @@ module Fastly
30
30
  # Attribute type mapping.
31
31
  def self.fastly_types
32
32
  {
33
- :'service' => :'BotManagementResponseServiceService'
33
+ :'service' => :'ApiDiscoveryResponseServiceService'
34
34
  }
35
35
  end
36
36