fastly 12.0.0 → 13.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 (194) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +30 -14
  5. data/docs/Backend.md +2 -2
  6. data/docs/BackendApi.md +8 -8
  7. data/docs/BackendResponse.md +2 -2
  8. data/docs/Invitation.md +1 -1
  9. data/docs/InvitationCreateData.md +12 -0
  10. data/docs/InvitationCreateDataAllOf.md +10 -0
  11. data/docs/{InvitationResponse.md → InvitationCreateResponse.md} +1 -1
  12. data/docs/{InvitationResponseAllOf.md → InvitationCreateResponseAllOf.md} +1 -1
  13. data/docs/InvitationData.md +0 -1
  14. data/docs/InvitationResponseData.md +1 -1
  15. data/docs/InvitationsApi.md +2 -2
  16. data/docs/LoggingAzureblobApi.md +8 -4
  17. data/docs/LoggingAzureblobResponse.md +2 -1
  18. data/docs/LoggingBigqueryAdditional.md +1 -1
  19. data/docs/LoggingBigqueryApi.md +8 -4
  20. data/docs/LoggingBigqueryResponse.md +2 -1
  21. data/docs/LoggingCloudfilesApi.md +8 -4
  22. data/docs/LoggingCloudfilesResponse.md +2 -1
  23. data/docs/LoggingCommon.md +2 -1
  24. data/docs/LoggingCommonResponse.md +2 -1
  25. data/docs/LoggingCommonResponseAllOf.md +2 -1
  26. data/docs/LoggingDatadogAdditional.md +1 -1
  27. data/docs/LoggingDatadogApi.md +8 -4
  28. data/docs/LoggingDatadogResponse.md +2 -1
  29. data/docs/LoggingDigitaloceanApi.md +8 -4
  30. data/docs/LoggingDigitaloceanResponse.md +2 -1
  31. data/docs/LoggingElasticsearchAdditional.md +1 -1
  32. data/docs/LoggingElasticsearchApi.md +8 -4
  33. data/docs/LoggingElasticsearchResponse.md +2 -1
  34. data/docs/LoggingFtpApi.md +8 -4
  35. data/docs/LoggingFtpResponse.md +2 -1
  36. data/docs/LoggingGcsApi.md +8 -4
  37. data/docs/LoggingGcsResponse.md +2 -1
  38. data/docs/LoggingGooglePubsubAdditional.md +1 -1
  39. data/docs/LoggingGooglePubsubResponse.md +2 -1
  40. data/docs/LoggingGrafanacloudlogsAdditional.md +1 -1
  41. data/docs/LoggingGrafanacloudlogsApi.md +8 -4
  42. data/docs/LoggingGrafanacloudlogsResponse.md +2 -1
  43. data/docs/LoggingHerokuApi.md +8 -4
  44. data/docs/LoggingHerokuResponse.md +2 -1
  45. data/docs/LoggingHoneycombAdditional.md +1 -1
  46. data/docs/LoggingHoneycombApi.md +8 -4
  47. data/docs/LoggingHoneycombResponse.md +2 -1
  48. data/docs/LoggingHttpsAdditional.md +1 -1
  49. data/docs/LoggingHttpsApi.md +8 -4
  50. data/docs/LoggingHttpsResponse.md +2 -1
  51. data/docs/LoggingKafkaApi.md +4 -2
  52. data/docs/LoggingKafkaResponse.md +2 -1
  53. data/docs/LoggingKafkaResponsePost.md +2 -1
  54. data/docs/LoggingKinesisAdditional.md +1 -1
  55. data/docs/LoggingKinesisApi.md +2 -2
  56. data/docs/LoggingKinesisResponse.md +1 -1
  57. data/docs/LoggingLogentriesApi.md +8 -4
  58. data/docs/LoggingLogentriesResponse.md +2 -1
  59. data/docs/LoggingLogglyApi.md +8 -4
  60. data/docs/LoggingLogglyResponse.md +2 -1
  61. data/docs/LoggingLogshuttleApi.md +8 -4
  62. data/docs/LoggingLogshuttleResponse.md +2 -1
  63. data/docs/LoggingNewrelicAdditional.md +1 -1
  64. data/docs/LoggingNewrelicApi.md +8 -4
  65. data/docs/LoggingNewrelicResponse.md +2 -1
  66. data/docs/LoggingNewrelicotlpAdditional.md +1 -1
  67. data/docs/LoggingNewrelicotlpApi.md +8 -4
  68. data/docs/LoggingNewrelicotlpResponse.md +2 -1
  69. data/docs/LoggingOpenstackApi.md +8 -4
  70. data/docs/LoggingOpenstackResponse.md +2 -1
  71. data/docs/LoggingPapertrailApi.md +8 -4
  72. data/docs/LoggingPapertrailResponse.md +2 -1
  73. data/docs/LoggingPubsubApi.md +8 -4
  74. data/docs/LoggingS3Api.md +8 -4
  75. data/docs/LoggingS3Response.md +2 -1
  76. data/docs/LoggingScalyrApi.md +8 -4
  77. data/docs/LoggingScalyrResponse.md +2 -1
  78. data/docs/LoggingSftpApi.md +8 -4
  79. data/docs/LoggingSftpResponse.md +2 -1
  80. data/docs/LoggingSplunkApi.md +8 -4
  81. data/docs/LoggingSplunkResponse.md +2 -1
  82. data/docs/LoggingSumologicApi.md +8 -4
  83. data/docs/LoggingSumologicResponse.md +2 -1
  84. data/docs/LoggingSyslogApi.md +8 -4
  85. data/docs/LoggingSyslogResponse.md +2 -1
  86. data/docs/PoolAdditional.md +1 -1
  87. data/docs/PoolApi.md +4 -4
  88. data/docs/PoolResponse.md +1 -1
  89. data/docs/PoolResponsePost.md +1 -1
  90. data/docs/PurgeApi.md +1 -1
  91. data/docs/Results.md +2 -2
  92. data/docs/ServiceApi.md +2 -0
  93. data/docs/TlsCertificateDataAttributes.md +1 -0
  94. data/docs/TlsCsrData.md +0 -1
  95. data/docs/TlsCsrDataAttributes.md +1 -0
  96. data/lib/fastly/api/backend_api.rb +8 -8
  97. data/lib/fastly/api/invitations_api.rb +3 -3
  98. data/lib/fastly/api/logging_azureblob_api.rb +20 -6
  99. data/lib/fastly/api/logging_bigquery_api.rb +20 -6
  100. data/lib/fastly/api/logging_cloudfiles_api.rb +20 -6
  101. data/lib/fastly/api/logging_datadog_api.rb +20 -6
  102. data/lib/fastly/api/logging_digitalocean_api.rb +20 -6
  103. data/lib/fastly/api/logging_elasticsearch_api.rb +20 -6
  104. data/lib/fastly/api/logging_ftp_api.rb +20 -6
  105. data/lib/fastly/api/logging_gcs_api.rb +20 -6
  106. data/lib/fastly/api/logging_grafanacloudlogs_api.rb +20 -6
  107. data/lib/fastly/api/logging_heroku_api.rb +20 -6
  108. data/lib/fastly/api/logging_honeycomb_api.rb +20 -6
  109. data/lib/fastly/api/logging_https_api.rb +20 -6
  110. data/lib/fastly/api/logging_kafka_api.rb +10 -3
  111. data/lib/fastly/api/logging_kinesis_api.rb +2 -2
  112. data/lib/fastly/api/logging_logentries_api.rb +20 -6
  113. data/lib/fastly/api/logging_loggly_api.rb +20 -6
  114. data/lib/fastly/api/logging_logshuttle_api.rb +20 -6
  115. data/lib/fastly/api/logging_newrelic_api.rb +20 -6
  116. data/lib/fastly/api/logging_newrelicotlp_api.rb +20 -6
  117. data/lib/fastly/api/logging_openstack_api.rb +20 -6
  118. data/lib/fastly/api/logging_papertrail_api.rb +20 -6
  119. data/lib/fastly/api/logging_pubsub_api.rb +20 -6
  120. data/lib/fastly/api/logging_s3_api.rb +20 -6
  121. data/lib/fastly/api/logging_scalyr_api.rb +20 -6
  122. data/lib/fastly/api/logging_sftp_api.rb +20 -6
  123. data/lib/fastly/api/logging_splunk_api.rb +20 -6
  124. data/lib/fastly/api/logging_sumologic_api.rb +20 -6
  125. data/lib/fastly/api/logging_syslog_api.rb +20 -6
  126. data/lib/fastly/api/pool_api.rb +4 -4
  127. data/lib/fastly/api/purge_api.rb +2 -2
  128. data/lib/fastly/api/service_api.rb +3 -0
  129. data/lib/fastly/models/backend.rb +2 -2
  130. data/lib/fastly/models/backend_response.rb +2 -2
  131. data/lib/fastly/models/invitation.rb +1 -1
  132. data/lib/fastly/models/invitation_create_data.rb +244 -0
  133. data/lib/fastly/models/invitation_create_data_all_of.rb +216 -0
  134. data/lib/fastly/models/{invitation_response.rb → invitation_create_response.rb} +4 -4
  135. data/lib/fastly/models/{invitation_response_all_of.rb → invitation_create_response_all_of.rb} +3 -3
  136. data/lib/fastly/models/invitation_data.rb +4 -13
  137. data/lib/fastly/models/invitation_response_data.rb +13 -13
  138. data/lib/fastly/models/logging_azureblob_response.rb +28 -4
  139. data/lib/fastly/models/logging_bigquery_additional.rb +1 -1
  140. data/lib/fastly/models/logging_bigquery_response.rb +28 -4
  141. data/lib/fastly/models/logging_cloudfiles_response.rb +28 -4
  142. data/lib/fastly/models/logging_common.rb +31 -7
  143. data/lib/fastly/models/logging_common_response.rb +28 -4
  144. data/lib/fastly/models/logging_common_response_all_of.rb +31 -7
  145. data/lib/fastly/models/logging_datadog_additional.rb +1 -1
  146. data/lib/fastly/models/logging_datadog_response.rb +28 -4
  147. data/lib/fastly/models/logging_digitalocean_response.rb +28 -4
  148. data/lib/fastly/models/logging_elasticsearch_additional.rb +1 -1
  149. data/lib/fastly/models/logging_elasticsearch_response.rb +28 -4
  150. data/lib/fastly/models/logging_ftp_response.rb +28 -4
  151. data/lib/fastly/models/logging_gcs_response.rb +28 -4
  152. data/lib/fastly/models/logging_google_pubsub_additional.rb +1 -1
  153. data/lib/fastly/models/logging_google_pubsub_response.rb +28 -4
  154. data/lib/fastly/models/logging_grafanacloudlogs_additional.rb +1 -1
  155. data/lib/fastly/models/logging_grafanacloudlogs_response.rb +28 -4
  156. data/lib/fastly/models/logging_heroku_response.rb +28 -4
  157. data/lib/fastly/models/logging_honeycomb_additional.rb +1 -1
  158. data/lib/fastly/models/logging_honeycomb_response.rb +28 -4
  159. data/lib/fastly/models/logging_https_additional.rb +1 -1
  160. data/lib/fastly/models/logging_https_response.rb +28 -4
  161. data/lib/fastly/models/logging_kafka_response.rb +28 -4
  162. data/lib/fastly/models/logging_kafka_response_post.rb +28 -4
  163. data/lib/fastly/models/logging_kinesis_additional.rb +1 -1
  164. data/lib/fastly/models/logging_kinesis_response.rb +1 -1
  165. data/lib/fastly/models/logging_logentries_response.rb +28 -4
  166. data/lib/fastly/models/logging_loggly_response.rb +28 -4
  167. data/lib/fastly/models/logging_logshuttle_response.rb +28 -4
  168. data/lib/fastly/models/logging_newrelic_additional.rb +1 -1
  169. data/lib/fastly/models/logging_newrelic_response.rb +28 -4
  170. data/lib/fastly/models/logging_newrelicotlp_additional.rb +1 -1
  171. data/lib/fastly/models/logging_newrelicotlp_response.rb +28 -4
  172. data/lib/fastly/models/logging_openstack_response.rb +28 -4
  173. data/lib/fastly/models/logging_papertrail_response.rb +28 -4
  174. data/lib/fastly/models/logging_placement.rb +0 -1
  175. data/lib/fastly/models/logging_s3_response.rb +28 -4
  176. data/lib/fastly/models/logging_scalyr_response.rb +28 -4
  177. data/lib/fastly/models/logging_sftp_response.rb +28 -4
  178. data/lib/fastly/models/logging_splunk_response.rb +28 -4
  179. data/lib/fastly/models/logging_sumologic_response.rb +28 -4
  180. data/lib/fastly/models/logging_syslog_response.rb +28 -4
  181. data/lib/fastly/models/pool_additional.rb +1 -1
  182. data/lib/fastly/models/pool_response.rb +1 -1
  183. data/lib/fastly/models/pool_response_post.rb +1 -1
  184. data/lib/fastly/models/relationship_service_invitations.rb +1 -0
  185. data/lib/fastly/models/relationship_service_invitations_service_invitations.rb +1 -0
  186. data/lib/fastly/models/relationships_for_invitation.rb +1 -0
  187. data/lib/fastly/models/results.rb +2 -2
  188. data/lib/fastly/models/tls_certificate_data_attributes.rb +14 -4
  189. data/lib/fastly/models/tls_csr_data.rb +4 -13
  190. data/lib/fastly/models/tls_csr_data_attributes.rb +14 -4
  191. data/lib/fastly/version.rb +1 -1
  192. data/lib/fastly.rb +4 -2
  193. data/sig.json +1 -1
  194. metadata +10 -6
@@ -24,7 +24,8 @@ module Fastly
24
24
  # @option opts [String] :name The name for the real-time logging configuration.
25
25
  # @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
26
26
  # @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
27
- # @option opts [String] :format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (default to '%h %l %u %t \"%r\" %>s %b')
27
+ # @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (default to '%h %l %u %t \"%r\" %>s %b')
28
+ # @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
28
29
  # @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
29
30
  # @option opts [LoggingMessageType] :message_type (default to 'classic')
30
31
  # @option opts [String] :url The URL to post logs to.
@@ -41,7 +42,8 @@ module Fastly
41
42
  # @option opts [String] :name The name for the real-time logging configuration.
42
43
  # @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
43
44
  # @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
44
- # @option opts [String] :format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (default to '%h %l %u %t \"%r\" %>s %b')
45
+ # @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (default to '%h %l %u %t \"%r\" %>s %b')
46
+ # @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
45
47
  # @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
46
48
  # @option opts [LoggingMessageType] :message_type (default to 'classic')
47
49
  # @option opts [String] :url The URL to post logs to.
@@ -61,10 +63,14 @@ module Fastly
61
63
  if @api_client.config.client_side_validation && version_id.nil?
62
64
  fail ArgumentError, "Missing the required parameter 'version_id' when calling LoggingSumologicApi.create_log_sumologic"
63
65
  end
64
- allowable_values = ["none", "waf_debug", "null"]
66
+ allowable_values = ["none", "null"]
65
67
  if @api_client.config.client_side_validation && opts[:'placement'] && !allowable_values.include?(opts[:'placement'])
66
68
  fail ArgumentError, "invalid value for \"placement\", must be one of #{allowable_values}"
67
69
  end
70
+ allowable_values = ["none", "eu", "us"]
71
+ if @api_client.config.client_side_validation && opts[:'log_processing_region'] && !allowable_values.include?(opts[:'log_processing_region'])
72
+ fail ArgumentError, "invalid value for \"log_processing_region\", must be one of #{allowable_values}"
73
+ end
68
74
  allowable_values = [1, 2]
69
75
  if @api_client.config.client_side_validation && opts[:'format_version'] && !allowable_values.include?(opts[:'format_version'])
70
76
  fail ArgumentError, "invalid value for \"format_version\", must be one of #{allowable_values}"
@@ -91,6 +97,7 @@ module Fastly
91
97
  form_params['placement'] = opts[:'placement'] if !opts[:'placement'].nil?
92
98
  form_params['response_condition'] = opts[:'response_condition'] if !opts[:'response_condition'].nil?
93
99
  form_params['format'] = opts[:'format'] if !opts[:'format'].nil?
100
+ form_params['log_processing_region'] = opts[:'log_processing_region'] if !opts[:'log_processing_region'].nil?
94
101
  form_params['format_version'] = opts[:'format_version'] if !opts[:'format_version'].nil?
95
102
  form_params['message_type'] = opts[:'message_type'] if !opts[:'message_type'].nil?
96
103
  form_params['url'] = opts[:'url'] if !opts[:'url'].nil?
@@ -353,7 +360,8 @@ module Fastly
353
360
  # @option opts [String] :name The name for the real-time logging configuration.
354
361
  # @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
355
362
  # @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
356
- # @option opts [String] :format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (default to '%h %l %u %t \"%r\" %>s %b')
363
+ # @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (default to '%h %l %u %t \"%r\" %>s %b')
364
+ # @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
357
365
  # @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
358
366
  # @option opts [LoggingMessageType] :message_type (default to 'classic')
359
367
  # @option opts [String] :url The URL to post logs to.
@@ -371,7 +379,8 @@ module Fastly
371
379
  # @option opts [String] :name The name for the real-time logging configuration.
372
380
  # @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
373
381
  # @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
374
- # @option opts [String] :format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (default to '%h %l %u %t \"%r\" %>s %b')
382
+ # @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (default to '%h %l %u %t \"%r\" %>s %b')
383
+ # @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
375
384
  # @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
376
385
  # @option opts [LoggingMessageType] :message_type (default to 'classic')
377
386
  # @option opts [String] :url The URL to post logs to.
@@ -396,10 +405,14 @@ module Fastly
396
405
  if @api_client.config.client_side_validation && logging_sumologic_name.nil?
397
406
  fail ArgumentError, "Missing the required parameter 'logging_sumologic_name' when calling LoggingSumologicApi.update_log_sumologic"
398
407
  end
399
- allowable_values = ["none", "waf_debug", "null"]
408
+ allowable_values = ["none", "null"]
400
409
  if @api_client.config.client_side_validation && opts[:'placement'] && !allowable_values.include?(opts[:'placement'])
401
410
  fail ArgumentError, "invalid value for \"placement\", must be one of #{allowable_values}"
402
411
  end
412
+ allowable_values = ["none", "eu", "us"]
413
+ if @api_client.config.client_side_validation && opts[:'log_processing_region'] && !allowable_values.include?(opts[:'log_processing_region'])
414
+ fail ArgumentError, "invalid value for \"log_processing_region\", must be one of #{allowable_values}"
415
+ end
403
416
  allowable_values = [1, 2]
404
417
  if @api_client.config.client_side_validation && opts[:'format_version'] && !allowable_values.include?(opts[:'format_version'])
405
418
  fail ArgumentError, "invalid value for \"format_version\", must be one of #{allowable_values}"
@@ -426,6 +439,7 @@ module Fastly
426
439
  form_params['placement'] = opts[:'placement'] if !opts[:'placement'].nil?
427
440
  form_params['response_condition'] = opts[:'response_condition'] if !opts[:'response_condition'].nil?
428
441
  form_params['format'] = opts[:'format'] if !opts[:'format'].nil?
442
+ form_params['log_processing_region'] = opts[:'log_processing_region'] if !opts[:'log_processing_region'].nil?
429
443
  form_params['format_version'] = opts[:'format_version'] if !opts[:'format_version'].nil?
430
444
  form_params['message_type'] = opts[:'message_type'] if !opts[:'message_type'].nil?
431
445
  form_params['url'] = opts[:'url'] if !opts[:'url'].nil?
@@ -24,7 +24,8 @@ module Fastly
24
24
  # @option opts [String] :name The name for the real-time logging configuration.
25
25
  # @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
26
26
  # @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
27
- # @option opts [String] :format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (default to '%h %l %u %t \"%r\" %>s %b')
27
+ # @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (default to '%h %l %u %t \"%r\" %>s %b')
28
+ # @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
28
29
  # @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
29
30
  # @option opts [String] :tls_ca_cert A secure certificate to authenticate a server with. Must be in PEM format. (default to 'null')
30
31
  # @option opts [String] :tls_client_cert The client certificate used to make authenticated requests. Must be in PEM format. (default to 'null')
@@ -50,7 +51,8 @@ module Fastly
50
51
  # @option opts [String] :name The name for the real-time logging configuration.
51
52
  # @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
52
53
  # @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
53
- # @option opts [String] :format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (default to '%h %l %u %t \"%r\" %>s %b')
54
+ # @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (default to '%h %l %u %t \"%r\" %>s %b')
55
+ # @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
54
56
  # @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
55
57
  # @option opts [String] :tls_ca_cert A secure certificate to authenticate a server with. Must be in PEM format. (default to 'null')
56
58
  # @option opts [String] :tls_client_cert The client certificate used to make authenticated requests. Must be in PEM format. (default to 'null')
@@ -79,10 +81,14 @@ module Fastly
79
81
  if @api_client.config.client_side_validation && version_id.nil?
80
82
  fail ArgumentError, "Missing the required parameter 'version_id' when calling LoggingSyslogApi.create_log_syslog"
81
83
  end
82
- allowable_values = ["none", "waf_debug", "null"]
84
+ allowable_values = ["none", "null"]
83
85
  if @api_client.config.client_side_validation && opts[:'placement'] && !allowable_values.include?(opts[:'placement'])
84
86
  fail ArgumentError, "invalid value for \"placement\", must be one of #{allowable_values}"
85
87
  end
88
+ allowable_values = ["none", "eu", "us"]
89
+ if @api_client.config.client_side_validation && opts[:'log_processing_region'] && !allowable_values.include?(opts[:'log_processing_region'])
90
+ fail ArgumentError, "invalid value for \"log_processing_region\", must be one of #{allowable_values}"
91
+ end
86
92
  allowable_values = [1, 2]
87
93
  if @api_client.config.client_side_validation && opts[:'format_version'] && !allowable_values.include?(opts[:'format_version'])
88
94
  fail ArgumentError, "invalid value for \"format_version\", must be one of #{allowable_values}"
@@ -109,6 +115,7 @@ module Fastly
109
115
  form_params['placement'] = opts[:'placement'] if !opts[:'placement'].nil?
110
116
  form_params['response_condition'] = opts[:'response_condition'] if !opts[:'response_condition'].nil?
111
117
  form_params['format'] = opts[:'format'] if !opts[:'format'].nil?
118
+ form_params['log_processing_region'] = opts[:'log_processing_region'] if !opts[:'log_processing_region'].nil?
112
119
  form_params['format_version'] = opts[:'format_version'] if !opts[:'format_version'].nil?
113
120
  form_params['tls_ca_cert'] = opts[:'tls_ca_cert'] if !opts[:'tls_ca_cert'].nil?
114
121
  form_params['tls_client_cert'] = opts[:'tls_client_cert'] if !opts[:'tls_client_cert'].nil?
@@ -380,7 +387,8 @@ module Fastly
380
387
  # @option opts [String] :name The name for the real-time logging configuration.
381
388
  # @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
382
389
  # @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
383
- # @option opts [String] :format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (default to '%h %l %u %t \"%r\" %>s %b')
390
+ # @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (default to '%h %l %u %t \"%r\" %>s %b')
391
+ # @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
384
392
  # @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
385
393
  # @option opts [String] :tls_ca_cert A secure certificate to authenticate a server with. Must be in PEM format. (default to 'null')
386
394
  # @option opts [String] :tls_client_cert The client certificate used to make authenticated requests. Must be in PEM format. (default to 'null')
@@ -407,7 +415,8 @@ module Fastly
407
415
  # @option opts [String] :name The name for the real-time logging configuration.
408
416
  # @option opts [String] :placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
409
417
  # @option opts [String] :response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute.
410
- # @option opts [String] :format A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). (default to '%h %l %u %t \"%r\" %>s %b')
418
+ # @option opts [String] :format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (default to '%h %l %u %t \"%r\" %>s %b')
419
+ # @option opts [String] :log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (default to 'none')
411
420
  # @option opts [Integer] :format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (default to FORMAT_VERSION::v2)
412
421
  # @option opts [String] :tls_ca_cert A secure certificate to authenticate a server with. Must be in PEM format. (default to 'null')
413
422
  # @option opts [String] :tls_client_cert The client certificate used to make authenticated requests. Must be in PEM format. (default to 'null')
@@ -441,10 +450,14 @@ module Fastly
441
450
  if @api_client.config.client_side_validation && logging_syslog_name.nil?
442
451
  fail ArgumentError, "Missing the required parameter 'logging_syslog_name' when calling LoggingSyslogApi.update_log_syslog"
443
452
  end
444
- allowable_values = ["none", "waf_debug", "null"]
453
+ allowable_values = ["none", "null"]
445
454
  if @api_client.config.client_side_validation && opts[:'placement'] && !allowable_values.include?(opts[:'placement'])
446
455
  fail ArgumentError, "invalid value for \"placement\", must be one of #{allowable_values}"
447
456
  end
457
+ allowable_values = ["none", "eu", "us"]
458
+ if @api_client.config.client_side_validation && opts[:'log_processing_region'] && !allowable_values.include?(opts[:'log_processing_region'])
459
+ fail ArgumentError, "invalid value for \"log_processing_region\", must be one of #{allowable_values}"
460
+ end
448
461
  allowable_values = [1, 2]
449
462
  if @api_client.config.client_side_validation && opts[:'format_version'] && !allowable_values.include?(opts[:'format_version'])
450
463
  fail ArgumentError, "invalid value for \"format_version\", must be one of #{allowable_values}"
@@ -471,6 +484,7 @@ module Fastly
471
484
  form_params['placement'] = opts[:'placement'] if !opts[:'placement'].nil?
472
485
  form_params['response_condition'] = opts[:'response_condition'] if !opts[:'response_condition'].nil?
473
486
  form_params['format'] = opts[:'format'] if !opts[:'format'].nil?
487
+ form_params['log_processing_region'] = opts[:'log_processing_region'] if !opts[:'log_processing_region'].nil?
474
488
  form_params['format_version'] = opts[:'format_version'] if !opts[:'format_version'].nil?
475
489
  form_params['tls_ca_cert'] = opts[:'tls_ca_cert'] if !opts[:'tls_ca_cert'].nil?
476
490
  form_params['tls_client_cert'] = opts[:'tls_client_cert'] if !opts[:'tls_client_cert'].nil?
@@ -41,7 +41,7 @@ module Fastly
41
41
  # @option opts [String] :healthcheck Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools.
42
42
  # @option opts [String] :comment A freeform descriptive note.
43
43
  # @option opts [String] :type What type of load balance group to use.
44
- # @option opts [String] :override_host The hostname to [override the Host header](https://docs.fastly.com/en/guides/specifying-an-override-host). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to 'null')
44
+ # @option opts [String] :override_host The hostname to [override the Host header](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/specifying-an-override-host/). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to 'null')
45
45
  # @option opts [Integer] :between_bytes_timeout Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`. (default to 10000)
46
46
  # @option opts [Integer] :connect_timeout How long to wait for a timeout in milliseconds. Optional.
47
47
  # @option opts [Integer] :first_byte_timeout How long to wait for the first byte in milliseconds. Optional.
@@ -78,7 +78,7 @@ module Fastly
78
78
  # @option opts [String] :healthcheck Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools.
79
79
  # @option opts [String] :comment A freeform descriptive note.
80
80
  # @option opts [String] :type What type of load balance group to use.
81
- # @option opts [String] :override_host The hostname to [override the Host header](https://docs.fastly.com/en/guides/specifying-an-override-host). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to 'null')
81
+ # @option opts [String] :override_host The hostname to [override the Host header](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/specifying-an-override-host/). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to 'null')
82
82
  # @option opts [Integer] :between_bytes_timeout Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`. (default to 10000)
83
83
  # @option opts [Integer] :connect_timeout How long to wait for a timeout in milliseconds. Optional.
84
84
  # @option opts [Integer] :first_byte_timeout How long to wait for the first byte in milliseconds. Optional.
@@ -438,7 +438,7 @@ module Fastly
438
438
  # @option opts [String] :healthcheck Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools.
439
439
  # @option opts [String] :comment A freeform descriptive note.
440
440
  # @option opts [String] :type What type of load balance group to use.
441
- # @option opts [String] :override_host The hostname to [override the Host header](https://docs.fastly.com/en/guides/specifying-an-override-host). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to 'null')
441
+ # @option opts [String] :override_host The hostname to [override the Host header](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/specifying-an-override-host/). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to 'null')
442
442
  # @option opts [Integer] :between_bytes_timeout Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`. (default to 10000)
443
443
  # @option opts [Integer] :connect_timeout How long to wait for a timeout in milliseconds. Optional.
444
444
  # @option opts [Integer] :first_byte_timeout How long to wait for the first byte in milliseconds. Optional.
@@ -476,7 +476,7 @@ module Fastly
476
476
  # @option opts [String] :healthcheck Name of the healthcheck to use with this pool. Can be empty and could be reused across multiple backend and pools.
477
477
  # @option opts [String] :comment A freeform descriptive note.
478
478
  # @option opts [String] :type What type of load balance group to use.
479
- # @option opts [String] :override_host The hostname to [override the Host header](https://docs.fastly.com/en/guides/specifying-an-override-host). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to 'null')
479
+ # @option opts [String] :override_host The hostname to [override the Host header](https://www.fastly.com/documentation/guides/full-site-delivery/domains-and-origins/specifying-an-override-host/). Defaults to `null` meaning no override of the Host header will occur. This setting can also be added to a Server definition. If the field is set on a Server definition it will override the Pool setting. (default to 'null')
480
480
  # @option opts [Integer] :between_bytes_timeout Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using `bereq.between_bytes_timeout`. (default to 10000)
481
481
  # @option opts [Integer] :connect_timeout How long to wait for a timeout in milliseconds. Optional.
482
482
  # @option opts [Integer] :first_byte_timeout How long to wait for the first byte in milliseconds. Optional.
@@ -94,7 +94,7 @@ module Fastly
94
94
  end
95
95
 
96
96
  # Purge everything from a service
97
- # Instant Purge everything from a service. Purge-all requests cannot be done in soft mode and will always immediately invalidate all cached content associated with the service. To do a soft-purge-all, consider applying a constant [surrogate key](https://docs.fastly.com/en/guides/getting-started-with-surrogate-keys) tag (e.g., `\"all\"`) to all objects.
97
+ # Instant Purge everything from a service. Purge-all requests cannot be done in soft mode and will always immediately invalidate all cached content associated with the service. To do a soft-purge-all, consider applying a constant [surrogate key](https://www.fastly.com/documentation/guides/full-site-delivery/purging/working-with-surrogate-keys/) tag (e.g., `\"all\"`) to all objects.
98
98
  # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
99
99
  # @return [InlineResponse200]
100
100
  def purge_all(opts = {})
@@ -103,7 +103,7 @@ module Fastly
103
103
  end
104
104
 
105
105
  # Purge everything from a service
106
- # Instant Purge everything from a service. Purge-all requests cannot be done in soft mode and will always immediately invalidate all cached content associated with the service. To do a soft-purge-all, consider applying a constant [surrogate key](https://docs.fastly.com/en/guides/getting-started-with-surrogate-keys) tag (e.g., `\"all\"`) to all objects.
106
+ # Instant Purge everything from a service. Purge-all requests cannot be done in soft mode and will always immediately invalidate all cached content associated with the service. To do a soft-purge-all, consider applying a constant [surrogate key](https://www.fastly.com/documentation/guides/full-site-delivery/purging/working-with-surrogate-keys/) tag (e.g., `\"all\"`) to all objects.
107
107
  # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
108
108
  # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
109
109
  def purge_all_with_http_info(opts = {})
@@ -224,6 +224,7 @@ module Fastly
224
224
  # List detailed information on a specified service.
225
225
  # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
226
226
  # @option opts [Integer] :version Number identifying a version of the service.
227
+ # @option opts [Boolean] :filter_versions_active Limits the versions array to the active versions. Accepts &#x60;true&#x60; or &#x60;false&#x60; (defaults to false).
227
228
  # @return [ServiceDetail]
228
229
  def get_service_detail(opts = {})
229
230
  data, _status_code, _headers = get_service_detail_with_http_info(opts)
@@ -234,6 +235,7 @@ module Fastly
234
235
  # List detailed information on a specified service.
235
236
  # @option opts [String] :service_id Alphanumeric string identifying the service. (required)
236
237
  # @option opts [Integer] :version Number identifying a version of the service.
238
+ # @option opts [Boolean] :filter_versions_active Limits the versions array to the active versions. Accepts &#x60;true&#x60; or &#x60;false&#x60; (defaults to false).
237
239
  # @return [Array<(ServiceDetail, Integer, Hash)>] ServiceDetail data, response status code and response headers
238
240
  def get_service_detail_with_http_info(opts = {})
239
241
  if @api_client.config.debugging
@@ -255,6 +257,7 @@ module Fastly
255
257
  # query parameters
256
258
  query_params = opts[:query_params] || {}
257
259
  query_params[:'version'] = opts[:'version'] if !opts[:'version'].nil?
260
+ query_params[:'filter[versions.active]'] = opts[:'filter_versions_active'] if !opts[:'filter_versions_active'].nil?
258
261
 
259
262
  # header parameters
260
263
  header_params = opts[:header_params] || {}
@@ -67,7 +67,7 @@ module Fastly
67
67
  # Port on which the backend server is listening for connections from Fastly. Setting `port` to 80 or 443 will also set `use_ssl` automatically (to false and true respectively), unless explicitly overridden by setting `use_ssl` in the same request.
68
68
  attr_accessor :port
69
69
 
70
- # Prefer IPv6 connections for DNS hostname lookups.
70
+ # Prefer IPv6 connections to origins for hostname backends. Default is 'false' for Delivery services and 'true' for Compute services.
71
71
  attr_accessor :prefer_ipv6
72
72
 
73
73
  # Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests.
@@ -76,7 +76,7 @@ module Fastly
76
76
  # Value that when shared across backends will enable those backends to share the same health check.
77
77
  attr_accessor :share_key
78
78
 
79
- # Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding).
79
+ # Identifier of the POP to use as a [shield](https://www.fastly.com/documentation/guides/getting-started/hosts/shielding/).
80
80
  attr_accessor :shield
81
81
 
82
82
  # CA certificate attached to origin.
@@ -67,7 +67,7 @@ module Fastly
67
67
  # Port on which the backend server is listening for connections from Fastly. Setting `port` to 80 or 443 will also set `use_ssl` automatically (to false and true respectively), unless explicitly overridden by setting `use_ssl` in the same request.
68
68
  attr_accessor :port
69
69
 
70
- # Prefer IPv6 connections for DNS hostname lookups.
70
+ # Prefer IPv6 connections to origins for hostname backends. Default is 'false' for Delivery services and 'true' for Compute services.
71
71
  attr_accessor :prefer_ipv6
72
72
 
73
73
  # Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any `auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests.
@@ -76,7 +76,7 @@ module Fastly
76
76
  # Value that when shared across backends will enable those backends to share the same health check.
77
77
  attr_accessor :share_key
78
78
 
79
- # Identifier of the POP to use as a [shield](https://docs.fastly.com/en/guides/shielding).
79
+ # Identifier of the POP to use as a [shield](https://www.fastly.com/documentation/guides/getting-started/hosts/shielding/).
80
80
  attr_accessor :shield
81
81
 
82
82
  # CA certificate attached to origin.
@@ -30,7 +30,7 @@ module Fastly
30
30
  # Attribute type mapping.
31
31
  def self.fastly_types
32
32
  {
33
- :'data' => :'InvitationData'
33
+ :'data' => :'InvitationCreateData'
34
34
  }
35
35
  end
36
36
 
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #Fastly API
3
+
4
+ #Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://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 InvitationCreateData
16
+ attr_accessor :type
17
+
18
+ attr_accessor :attributes
19
+
20
+ attr_accessor :relationships
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'type' => :'type',
26
+ :'attributes' => :'attributes',
27
+ :'relationships' => :'relationships'
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.fastly_types
38
+ {
39
+ :'type' => :'TypeInvitation',
40
+ :'attributes' => :'InvitationDataAttributes',
41
+ :'relationships' => :'RelationshipServiceInvitationsCreate'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.fastly_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # List of class defined in allOf (OpenAPI v3)
52
+ def self.fastly_all_of
53
+ [
54
+ :'InvitationCreateDataAllOf',
55
+ :'InvitationData'
56
+ ]
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ if (!attributes.is_a?(Hash))
63
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::InvitationCreateData` initialize method"
64
+ end
65
+
66
+ # check to see if the attribute exists and convert string to symbol for hash key
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!self.class.attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::InvitationCreateData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'type')
75
+ self.type = attributes[:'type']
76
+ else
77
+ self.type = 'invitation'
78
+ end
79
+
80
+ if attributes.key?(:'attributes')
81
+ self.attributes = attributes[:'attributes']
82
+ end
83
+
84
+ if attributes.key?(:'relationships')
85
+ self.relationships = attributes[:'relationships']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ invalid_properties
94
+ end
95
+
96
+ # Check to see if the all the properties in the model are valid
97
+ # @return true if the model is valid
98
+ def valid?
99
+ true
100
+ end
101
+
102
+ # Checks equality by comparing each attribute.
103
+ # @param [Object] Object to be compared
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ type == o.type &&
108
+ attributes == o.attributes &&
109
+ relationships == o.relationships
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [type, attributes, relationships].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ new.build_from_hash(attributes)
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ self.class.fastly_types.each_pair do |key, type|
137
+ if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key)
138
+ self.send("#{key}=", nil)
139
+ elsif type =~ /\AArray<(.*)>/i
140
+ # check to ensure the input is an array given that the attribute
141
+ # is documented as an array but the input is not
142
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
143
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
144
+ end
145
+ elsif !attributes[self.class.attribute_map[key]].nil?
146
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
+ end
148
+ end
149
+
150
+ self
151
+ end
152
+
153
+ # Deserializes the data based on type
154
+ # @param string type Data type
155
+ # @param string value Value to be deserialized
156
+ # @return [Object] Deserialized data
157
+ def _deserialize(type, value)
158
+ case type.to_sym
159
+ when :Time
160
+ Time.parse(value)
161
+ when :Date
162
+ Date.parse(value)
163
+ when :String
164
+ value.to_s
165
+ when :Integer
166
+ value.to_i
167
+ when :Float
168
+ value.to_f
169
+ when :Boolean
170
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
171
+ true
172
+ else
173
+ false
174
+ end
175
+ when :Object
176
+ # generic object (usually a Hash), return directly
177
+ value
178
+ when /\AArray<(?<inner_type>.+)>\z/
179
+ inner_type = Regexp.last_match[:inner_type]
180
+ value.map { |v| _deserialize(inner_type, v) }
181
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
182
+ k_type = Regexp.last_match[:k_type]
183
+ v_type = Regexp.last_match[:v_type]
184
+ {}.tap do |hash|
185
+ value.each do |k, v|
186
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
187
+ end
188
+ end
189
+ else # model
190
+ # models (e.g. Pet) or oneOf
191
+ klass = Fastly.const_get(type)
192
+ klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
+ end
194
+ end
195
+
196
+ # Returns the string representation of the object
197
+ # @return [String] String presentation of the object
198
+ def to_s
199
+ to_hash.to_s
200
+ end
201
+
202
+ # to_body is an alias to to_hash (backward compatibility)
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_body
205
+ to_hash
206
+ end
207
+
208
+ # Returns the object in the form of hash
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_hash
211
+ hash = {}
212
+ self.class.attribute_map.each_pair do |attr, param|
213
+ value = self.send(attr)
214
+ if value.nil?
215
+ is_nullable = self.class.fastly_nullable.include?(attr)
216
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
217
+ end
218
+
219
+ hash[param] = _to_hash(value)
220
+ end
221
+ hash
222
+ end
223
+
224
+ # Outputs non-array value in the form of hash
225
+ # For object, use to_hash. Otherwise, just return the value
226
+ # @param [Object] value Any valid value
227
+ # @return [Hash] Returns the value in the form of hash
228
+ def _to_hash(value)
229
+ if value.is_a?(Array)
230
+ value.compact.map { |v| _to_hash(v) }
231
+ elsif value.is_a?(Hash)
232
+ {}.tap do |hash|
233
+ value.each { |k, v| hash[k] = _to_hash(v) }
234
+ end
235
+ elsif value.respond_to? :to_hash
236
+ value.to_hash
237
+ else
238
+ value
239
+ end
240
+ end
241
+
242
+ end
243
+
244
+ end