oci 2.5.11 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/oci.rb +1 -0
  4. data/lib/oci/auth/federation_client.rb +2 -1
  5. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +6 -1
  6. data/lib/oci/auth/url_based_certificate_retriever.rb +6 -2
  7. data/lib/oci/auth/util.rb +18 -0
  8. data/lib/oci/core/compute_client.rb +730 -48
  9. data/lib/oci/core/compute_client_composite_operations.rb +119 -0
  10. data/lib/oci/core/compute_management_client.rb +11 -4
  11. data/lib/oci/core/core.rb +13 -0
  12. data/lib/oci/core/models/add_security_rule_details.rb +4 -2
  13. data/lib/oci/core/models/attach_vnic_details.rb +1 -0
  14. data/lib/oci/core/models/capture_console_history_details.rb +1 -0
  15. data/lib/oci/core/models/change_dedicated_vm_host_compartment_details.rb +155 -0
  16. data/lib/oci/core/models/change_dhcp_options_compartment_details.rb +155 -0
  17. data/lib/oci/core/models/change_internet_gateway_compartment_details.rb +155 -0
  18. data/lib/oci/core/models/change_local_peering_gateway_compartment_details.rb +155 -0
  19. data/lib/oci/core/models/change_network_security_group_compartment_details.rb +155 -0
  20. data/lib/oci/core/models/change_public_ip_compartment_details.rb +155 -0
  21. data/lib/oci/core/models/create_dedicated_vm_host_details.rb +262 -0
  22. data/lib/oci/core/models/create_drg_attachment_details.rb +4 -2
  23. data/lib/oci/core/models/create_image_details.rb +1 -1
  24. data/lib/oci/core/models/create_instance_configuration_base.rb +16 -6
  25. data/lib/oci/core/models/create_instance_configuration_details.rb +1 -1
  26. data/lib/oci/core/models/create_instance_configuration_from_instance_details.rb +3 -2
  27. data/lib/oci/core/models/create_instance_pool_details.rb +3 -1
  28. data/lib/oci/core/models/create_local_peering_gateway_details.rb +1 -1
  29. data/lib/oci/core/models/create_service_gateway_details.rb +1 -1
  30. data/lib/oci/core/models/create_volume_group_backup_details.rb +3 -1
  31. data/lib/oci/core/models/create_volume_group_details.rb +1 -1
  32. data/lib/oci/core/models/cross_connect_mapping.rb +4 -0
  33. data/lib/oci/core/models/dedicated_vm_host.rb +359 -0
  34. data/lib/oci/core/models/dedicated_vm_host_instance_shape_summary.rb +170 -0
  35. data/lib/oci/core/models/dedicated_vm_host_instance_summary.rb +215 -0
  36. data/lib/oci/core/models/dedicated_vm_host_shape_summary.rb +171 -0
  37. data/lib/oci/core/models/dedicated_vm_host_summary.rb +325 -0
  38. data/lib/oci/core/models/drg_attachment.rb +6 -3
  39. data/lib/oci/core/models/egress_security_rule.rb +1 -0
  40. data/lib/oci/core/models/image.rb +2 -0
  41. data/lib/oci/core/models/ingress_security_rule.rb +2 -1
  42. data/lib/oci/core/models/instance.rb +16 -1
  43. data/lib/oci/core/models/instance_configuration.rb +10 -7
  44. data/lib/oci/core/models/ipv6.rb +2 -0
  45. data/lib/oci/core/models/launch_instance_details.rb +16 -1
  46. data/lib/oci/core/models/launch_options.rb +3 -2
  47. data/lib/oci/core/models/local_peering_gateway.rb +4 -3
  48. data/lib/oci/core/models/route_rule.rb +2 -1
  49. data/lib/oci/core/models/security_rule.rb +3 -1
  50. data/lib/oci/core/models/service_gateway.rb +4 -3
  51. data/lib/oci/core/models/subnet.rb +2 -1
  52. data/lib/oci/core/models/update_console_history_details.rb +1 -0
  53. data/lib/oci/core/models/update_dedicated_vm_host_details.rb +194 -0
  54. data/lib/oci/core/models/update_drg_attachment_details.rb +6 -3
  55. data/lib/oci/core/models/update_instance_pool_details.rb +3 -1
  56. data/lib/oci/core/models/update_local_peering_gateway_details.rb +4 -3
  57. data/lib/oci/core/models/update_network_security_group_details.rb +2 -0
  58. data/lib/oci/core/models/update_security_rule_details.rb +4 -2
  59. data/lib/oci/core/models/update_service_gateway_details.rb +4 -3
  60. data/lib/oci/core/models/update_vnic_details.rb +2 -0
  61. data/lib/oci/core/models/update_volume_backup_details.rb +1 -1
  62. data/lib/oci/core/models/update_volume_group_backup_details.rb +2 -1
  63. data/lib/oci/core/models/update_volume_group_details.rb +2 -1
  64. data/lib/oci/core/models/vcn.rb +2 -1
  65. data/lib/oci/core/models/volume_backup_schedule.rb +1 -1
  66. data/lib/oci/core/virtual_network_client.rb +396 -59
  67. data/lib/oci/dts/dts.rb +57 -0
  68. data/lib/oci/dts/models/attach_devices_details.rb +153 -0
  69. data/lib/oci/dts/models/change_transfer_job_compartment_details.rb +154 -0
  70. data/lib/oci/dts/models/create_transfer_appliance_details.rb +152 -0
  71. data/lib/oci/dts/models/create_transfer_appliance_entitlement_details.rb +178 -0
  72. data/lib/oci/dts/models/create_transfer_device_details.rb +165 -0
  73. data/lib/oci/dts/models/create_transfer_job_details.rb +238 -0
  74. data/lib/oci/dts/models/create_transfer_package_details.rb +178 -0
  75. data/lib/oci/dts/models/detach_devices_details.rb +153 -0
  76. data/lib/oci/dts/models/multiple_transfer_appliances.rb +153 -0
  77. data/lib/oci/dts/models/multiple_transfer_devices.rb +153 -0
  78. data/lib/oci/dts/models/multiple_transfer_packages.rb +153 -0
  79. data/lib/oci/dts/models/new_transfer_device.rb +246 -0
  80. data/lib/oci/dts/models/shipping_address.rb +263 -0
  81. data/lib/oci/dts/models/shipping_vendors.rb +149 -0
  82. data/lib/oci/dts/models/transfer_appliance.rb +367 -0
  83. data/lib/oci/dts/models/transfer_appliance_certificate.rb +148 -0
  84. data/lib/oci/dts/models/transfer_appliance_encryption_passphrase.rb +152 -0
  85. data/lib/oci/dts/models/transfer_appliance_entitlement.rb +240 -0
  86. data/lib/oci/dts/models/transfer_appliance_public_key.rb +152 -0
  87. data/lib/oci/dts/models/transfer_appliance_summary.rb +223 -0
  88. data/lib/oci/dts/models/transfer_device.rb +268 -0
  89. data/lib/oci/dts/models/transfer_device_summary.rb +254 -0
  90. data/lib/oci/dts/models/transfer_job.rb +356 -0
  91. data/lib/oci/dts/models/transfer_job_summary.rb +296 -0
  92. data/lib/oci/dts/models/transfer_package.rb +281 -0
  93. data/lib/oci/dts/models/transfer_package_summary.rb +201 -0
  94. data/lib/oci/dts/models/update_transfer_appliance_details.rb +180 -0
  95. data/lib/oci/dts/models/update_transfer_device_details.rb +166 -0
  96. data/lib/oci/dts/models/update_transfer_job_details.rb +237 -0
  97. data/lib/oci/dts/models/update_transfer_package_details.rb +204 -0
  98. data/lib/oci/dts/shipping_vendors_client.rb +165 -0
  99. data/lib/oci/dts/shipping_vendors_client_composite_operations.rb +24 -0
  100. data/lib/oci/dts/transfer_appliance_client.rb +569 -0
  101. data/lib/oci/dts/transfer_appliance_client_composite_operations.rb +104 -0
  102. data/lib/oci/dts/transfer_appliance_entitlement_client.rb +223 -0
  103. data/lib/oci/dts/transfer_appliance_entitlement_client_composite_operations.rb +24 -0
  104. data/lib/oci/dts/transfer_device_client.rb +402 -0
  105. data/lib/oci/dts/transfer_device_client_composite_operations.rb +65 -0
  106. data/lib/oci/dts/transfer_job_client.rb +458 -0
  107. data/lib/oci/dts/transfer_job_client_composite_operations.rb +143 -0
  108. data/lib/oci/dts/transfer_package_client.rb +515 -0
  109. data/lib/oci/dts/transfer_package_client_composite_operations.rb +104 -0
  110. data/lib/oci/dts/util.rb +2 -0
  111. data/lib/oci/file_storage/models/create_file_system_details.rb +19 -4
  112. data/lib/oci/file_storage/models/file_system.rb +19 -4
  113. data/lib/oci/file_storage/models/file_system_summary.rb +19 -4
  114. data/lib/oci/file_storage/models/update_file_system_details.rb +22 -4
  115. data/lib/oci/limits/limits.rb +5 -0
  116. data/lib/oci/limits/limits_client.rb +444 -0
  117. data/lib/oci/limits/limits_client_composite_operations.rb +24 -0
  118. data/lib/oci/limits/models/create_quota_details.rb +1 -1
  119. data/lib/oci/limits/models/limit_definition_summary.rb +241 -0
  120. data/lib/oci/limits/models/limit_value_summary.rb +210 -0
  121. data/lib/oci/limits/models/quota.rb +1 -1
  122. data/lib/oci/limits/models/resource_availability.rb +163 -0
  123. data/lib/oci/limits/models/service_summary.rb +159 -0
  124. data/lib/oci/limits/models/update_quota_details.rb +1 -1
  125. data/lib/oci/limits/quotas_client.rb +12 -11
  126. data/lib/oci/monitoring/models/alarm.rb +20 -1
  127. data/lib/oci/monitoring/models/create_alarm_details.rb +20 -1
  128. data/lib/oci/monitoring/models/list_metrics_details.rb +23 -3
  129. data/lib/oci/monitoring/models/metric.rb +20 -1
  130. data/lib/oci/monitoring/models/metric_data.rb +20 -1
  131. data/lib/oci/monitoring/models/metric_data_details.rb +20 -1
  132. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +20 -1
  133. data/lib/oci/monitoring/models/update_alarm_details.rb +20 -1
  134. data/lib/oci/regions.rb +14 -8
  135. data/lib/oci/streaming/models/archiver.rb +291 -0
  136. data/lib/oci/streaming/models/archiver_error.rb +159 -0
  137. data/lib/oci/streaming/models/archiver_lifecycle_state.rb +14 -0
  138. data/lib/oci/streaming/models/archiver_start_position.rb +10 -0
  139. data/lib/oci/streaming/models/create_archiver_details.rb +223 -0
  140. data/lib/oci/streaming/models/update_archiver_details.rb +222 -0
  141. data/lib/oci/streaming/stream_admin_client.rb +304 -0
  142. data/lib/oci/streaming/stream_admin_client_composite_operations.rb +162 -0
  143. data/lib/oci/streaming/streaming.rb +6 -0
  144. data/lib/oci/version.rb +1 -1
  145. data/lib/oci/waas/models/access_rule.rb +121 -4
  146. data/lib/oci/waas/models/access_rule_criteria.rb +12 -0
  147. data/lib/oci/waas/models/address_list.rb +289 -0
  148. data/lib/oci/waas/models/address_list_summary.rb +279 -0
  149. data/lib/oci/waas/models/caching_rule.rb +243 -0
  150. data/lib/oci/waas/models/caching_rule_criteria.rb +194 -0
  151. data/lib/oci/waas/models/caching_rule_summary.rb +246 -0
  152. data/lib/oci/waas/models/certificate.rb +22 -9
  153. data/lib/oci/waas/models/certificate_extensions.rb +3 -0
  154. data/lib/oci/waas/models/certificate_issuer_name.rb +225 -0
  155. data/lib/oci/waas/models/certificate_public_key_info.rb +4 -1
  156. data/lib/oci/waas/models/certificate_subject_name.rb +8 -1
  157. data/lib/oci/waas/models/certificate_summary.rb +10 -2
  158. data/lib/oci/waas/models/change_address_list_compartment_details.rb +154 -0
  159. data/lib/oci/waas/models/change_custom_protection_rule_compartment_details.rb +154 -0
  160. data/lib/oci/waas/models/create_address_list_details.rb +213 -0
  161. data/lib/oci/waas/models/create_certificate_details.rb +22 -3
  162. data/lib/oci/waas/models/create_custom_protection_rule_details.rb +251 -0
  163. data/lib/oci/waas/models/create_waas_policy_details.rb +26 -4
  164. data/lib/oci/waas/models/custom_protection_rule.rb +326 -0
  165. data/lib/oci/waas/models/custom_protection_rule_setting.rb +180 -0
  166. data/lib/oci/waas/models/custom_protection_rule_summary.rb +279 -0
  167. data/lib/oci/waas/models/origin_group.rb +149 -0
  168. data/lib/oci/waas/models/origin_group_origins.rb +159 -0
  169. data/lib/oci/waas/models/policy_config.rb +201 -4
  170. data/lib/oci/waas/models/protection_rule_exclusion.rb +2 -2
  171. data/lib/oci/waas/models/purge_cache.rb +149 -0
  172. data/lib/oci/waas/models/update_address_list_details.rb +199 -0
  173. data/lib/oci/waas/models/update_certificate_details.rb +10 -2
  174. data/lib/oci/waas/models/update_custom_protection_rule_details.rb +237 -0
  175. data/lib/oci/waas/models/update_waas_policy_details.rb +26 -4
  176. data/lib/oci/waas/models/waas_policy.rb +25 -3
  177. data/lib/oci/waas/models/waas_policy_custom_protection_rule_summary.rb +207 -0
  178. data/lib/oci/waas/models/waas_policy_summary.rb +10 -2
  179. data/lib/oci/waas/models/waf_config.rb +43 -1
  180. data/lib/oci/waas/models/waf_config_details.rb +43 -1
  181. data/lib/oci/waas/models/waf_log.rb +3 -3
  182. data/lib/oci/waas/models/work_request.rb +4 -1
  183. data/lib/oci/waas/models/work_request_operation_types.rb +4 -1
  184. data/lib/oci/waas/models/work_request_summary.rb +4 -1
  185. data/lib/oci/waas/waas.rb +19 -0
  186. data/lib/oci/waas/waas_client.rb +1147 -61
  187. data/lib/oci/waas/waas_client_composite_operations.rb +386 -0
  188. metadata +90 -2
@@ -1,11 +1,34 @@
1
1
  # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
+ require 'logger'
4
5
 
5
6
  # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
7
  module OCI
7
8
  # The configuration details for the WAAS policy.
8
9
  class Waas::Models::PolicyConfig
10
+ TLS_PROTOCOLS_ENUM = [
11
+ TLS_PROTOCOLS_TLS_V1 = 'TLS_V1'.freeze,
12
+ TLS_PROTOCOLS_TLS_V1_1 = 'TLS_V1_1'.freeze,
13
+ TLS_PROTOCOLS_TLS_V1_2 = 'TLS_V1_2'.freeze,
14
+ TLS_PROTOCOLS_TLS_V1_3 = 'TLS_V1_3'.freeze,
15
+ TLS_PROTOCOLS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
16
+ ].freeze
17
+
18
+ CLIENT_ADDRESS_HEADER_ENUM = [
19
+ CLIENT_ADDRESS_HEADER_X_FORWARDED_FOR = 'X_FORWARDED_FOR'.freeze,
20
+ CLIENT_ADDRESS_HEADER_X_CLIENT_IP = 'X_CLIENT_IP'.freeze,
21
+ CLIENT_ADDRESS_HEADER_X_REAL_IP = 'X_REAL_IP'.freeze,
22
+ CLIENT_ADDRESS_HEADER_CLIENT_IP = 'CLIENT_IP'.freeze,
23
+ CLIENT_ADDRESS_HEADER_TRUE_CLIENT_IP = 'TRUE_CLIENT_IP'.freeze,
24
+ CLIENT_ADDRESS_HEADER_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
25
+ ].freeze
26
+
27
+ CIPHER_GROUP_ENUM = [
28
+ CIPHER_GROUP_DEFAULT = 'DEFAULT'.freeze,
29
+ CIPHER_GROUP_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
30
+ ].freeze
31
+
9
32
  # The OCID of the SSL certificate to use if HTTPS is supported.
10
33
  # @return [String]
11
34
  attr_accessor :certificate_id
@@ -18,13 +41,68 @@ module OCI
18
41
  # @return [BOOLEAN]
19
42
  attr_accessor :is_https_forced
20
43
 
44
+ # A list of allowed TLS protocols. Only applicable when HTTPS support is enabled. It affects client's connection to the edge nodes. The most secure TLS version will be chosen.
45
+ # - **TLS_V1:** corresponds to TLS 1.0 specification.
46
+ #
47
+ # - **TLS_V1_1:** corresponds to TLS 1.1 specification.
48
+ #
49
+ # - **TLS_V1_2:** corresponds to TLS 1.2 specification.
50
+ #
51
+ # - **TLS_V1_3:** corresponds to TLS 1.3 specification.
52
+ #
53
+ # Enabled TLS protocols must go in a row. For example if TLS_v1_1 and TLS_V1_3 are enabled, TLS_V1_2 must be enabled too.
54
+ # @return [Array<String>]
55
+ attr_reader :tls_protocols
56
+
57
+ # Enable or disable GZIP compression of origin responses. If enabled, the header `Accept-Encoding: gzip` is sent to origin, otherwise - empty `Accept-Encoding:` header is used.
58
+ # @return [BOOLEAN]
59
+ attr_accessor :is_origin_compression_enabled
60
+
61
+ # Enable or disable the use of CDN. It allows to specify true client IP address if clients do not connect directly to us.
62
+ # @return [BOOLEAN]
63
+ attr_accessor :is_behind_cdn
64
+
65
+ # The HTTP header used to pass the client IP address from the CDN if `isBehindCdn` is enabled. This feature consumes the header and its value as the true client IP address. It does not create the header. Using trusted chains (for example `X-Client-Ip: 11.1.1.1, 13.3.3.3`), the last IP address in the list will be used as true client IP address. In case of multiple headers with the same name, the first one will be used. If the header is not present it will use the connecting IP address as the true client IP address. It's assumed that CDN sets the correct client IP address and prevents spoofing.
66
+ #
67
+ # - **X_FORWARDED_FOR:** Corresponds to `X-Forwarded-For` header name.
68
+ #
69
+ # - **X_CLIENT_IP:** Corresponds to `X-Client-Ip` header name.
70
+ #
71
+ # - **X_REAL_IP:** Corresponds to `X-Real-Ip` header name.
72
+ #
73
+ # - **CLIENT_IP:** Corresponds to `Client-Ip` header name.
74
+ #
75
+ # - **TRUE_CLIENT_IP:** Corresponds to `True-Client-Ip` header name.
76
+ # @return [String]
77
+ attr_reader :client_address_header
78
+
79
+ # Enable or disable automatic content caching based on the response `cache-control` header. This feature enables the origin to act as a proxy cache. Caching policies are usually defined using `cache-control` header. For example `cache-control: max-age=120` means that the returned resource is valid for 120 seconds. Caching rules will overwrite this setting.
80
+ # @return [BOOLEAN]
81
+ attr_accessor :is_cache_control_respected
82
+
83
+ # Enable or disable buffering of responses from the origin. Buffering improves overall stability in case of network issues, but slightly increases Time To First Byte.
84
+ # @return [BOOLEAN]
85
+ attr_accessor :is_response_buffering_enabled
86
+
87
+ # The cipher group
88
+ # - **DEFAULT:** Cipher group supports TLS 1.0, TLS 1.1, TLS 1.2, TLS 1.3 protocols. It has the following ciphers enabled: `ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:!DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA`
89
+ # @return [String]
90
+ attr_reader :cipher_group
91
+
21
92
  # Attribute mapping from ruby-style variable name to JSON key.
22
93
  def self.attribute_map
23
94
  {
24
95
  # rubocop:disable Style/SymbolLiteral
25
96
  'certificate_id': :'certificateId',
26
97
  'is_https_enabled': :'isHttpsEnabled',
27
- 'is_https_forced': :'isHttpsForced'
98
+ 'is_https_forced': :'isHttpsForced',
99
+ 'tls_protocols': :'tlsProtocols',
100
+ 'is_origin_compression_enabled': :'isOriginCompressionEnabled',
101
+ 'is_behind_cdn': :'isBehindCdn',
102
+ 'client_address_header': :'clientAddressHeader',
103
+ 'is_cache_control_respected': :'isCacheControlRespected',
104
+ 'is_response_buffering_enabled': :'isResponseBufferingEnabled',
105
+ 'cipher_group': :'cipherGroup'
28
106
  # rubocop:enable Style/SymbolLiteral
29
107
  }
30
108
  end
@@ -35,7 +113,14 @@ module OCI
35
113
  # rubocop:disable Style/SymbolLiteral
36
114
  'certificate_id': :'String',
37
115
  'is_https_enabled': :'BOOLEAN',
38
- 'is_https_forced': :'BOOLEAN'
116
+ 'is_https_forced': :'BOOLEAN',
117
+ 'tls_protocols': :'Array<String>',
118
+ 'is_origin_compression_enabled': :'BOOLEAN',
119
+ 'is_behind_cdn': :'BOOLEAN',
120
+ 'client_address_header': :'String',
121
+ 'is_cache_control_respected': :'BOOLEAN',
122
+ 'is_response_buffering_enabled': :'BOOLEAN',
123
+ 'cipher_group': :'String'
39
124
  # rubocop:enable Style/SymbolLiteral
40
125
  }
41
126
  end
@@ -49,6 +134,13 @@ module OCI
49
134
  # @option attributes [String] :certificate_id The value to assign to the {#certificate_id} property
50
135
  # @option attributes [BOOLEAN] :is_https_enabled The value to assign to the {#is_https_enabled} property
51
136
  # @option attributes [BOOLEAN] :is_https_forced The value to assign to the {#is_https_forced} property
137
+ # @option attributes [Array<String>] :tls_protocols The value to assign to the {#tls_protocols} property
138
+ # @option attributes [BOOLEAN] :is_origin_compression_enabled The value to assign to the {#is_origin_compression_enabled} property
139
+ # @option attributes [BOOLEAN] :is_behind_cdn The value to assign to the {#is_behind_cdn} property
140
+ # @option attributes [String] :client_address_header The value to assign to the {#client_address_header} property
141
+ # @option attributes [BOOLEAN] :is_cache_control_respected The value to assign to the {#is_cache_control_respected} property
142
+ # @option attributes [BOOLEAN] :is_response_buffering_enabled The value to assign to the {#is_response_buffering_enabled} property
143
+ # @option attributes [String] :cipher_group The value to assign to the {#cipher_group} property
52
144
  def initialize(attributes = {})
53
145
  return unless attributes.is_a?(Hash)
54
146
 
@@ -72,10 +164,108 @@ module OCI
72
164
  raise 'You cannot provide both :isHttpsForced and :is_https_forced' if attributes.key?(:'isHttpsForced') && attributes.key?(:'is_https_forced')
73
165
 
74
166
  self.is_https_forced = attributes[:'is_https_forced'] unless attributes[:'is_https_forced'].nil?
167
+
168
+ self.tls_protocols = attributes[:'tlsProtocols'] if attributes[:'tlsProtocols']
169
+
170
+ raise 'You cannot provide both :tlsProtocols and :tls_protocols' if attributes.key?(:'tlsProtocols') && attributes.key?(:'tls_protocols')
171
+
172
+ self.tls_protocols = attributes[:'tls_protocols'] if attributes[:'tls_protocols']
173
+
174
+ self.is_origin_compression_enabled = attributes[:'isOriginCompressionEnabled'] unless attributes[:'isOriginCompressionEnabled'].nil?
175
+ self.is_origin_compression_enabled = true if is_origin_compression_enabled.nil? && !attributes.key?(:'isOriginCompressionEnabled') # rubocop:disable Style/StringLiterals
176
+
177
+ raise 'You cannot provide both :isOriginCompressionEnabled and :is_origin_compression_enabled' if attributes.key?(:'isOriginCompressionEnabled') && attributes.key?(:'is_origin_compression_enabled')
178
+
179
+ self.is_origin_compression_enabled = attributes[:'is_origin_compression_enabled'] unless attributes[:'is_origin_compression_enabled'].nil?
180
+ self.is_origin_compression_enabled = true if is_origin_compression_enabled.nil? && !attributes.key?(:'isOriginCompressionEnabled') && !attributes.key?(:'is_origin_compression_enabled') # rubocop:disable Style/StringLiterals
181
+
182
+ self.is_behind_cdn = attributes[:'isBehindCdn'] unless attributes[:'isBehindCdn'].nil?
183
+ self.is_behind_cdn = false if is_behind_cdn.nil? && !attributes.key?(:'isBehindCdn') # rubocop:disable Style/StringLiterals
184
+
185
+ raise 'You cannot provide both :isBehindCdn and :is_behind_cdn' if attributes.key?(:'isBehindCdn') && attributes.key?(:'is_behind_cdn')
186
+
187
+ self.is_behind_cdn = attributes[:'is_behind_cdn'] unless attributes[:'is_behind_cdn'].nil?
188
+ self.is_behind_cdn = false if is_behind_cdn.nil? && !attributes.key?(:'isBehindCdn') && !attributes.key?(:'is_behind_cdn') # rubocop:disable Style/StringLiterals
189
+
190
+ self.client_address_header = attributes[:'clientAddressHeader'] if attributes[:'clientAddressHeader']
191
+
192
+ raise 'You cannot provide both :clientAddressHeader and :client_address_header' if attributes.key?(:'clientAddressHeader') && attributes.key?(:'client_address_header')
193
+
194
+ self.client_address_header = attributes[:'client_address_header'] if attributes[:'client_address_header']
195
+
196
+ self.is_cache_control_respected = attributes[:'isCacheControlRespected'] unless attributes[:'isCacheControlRespected'].nil?
197
+ self.is_cache_control_respected = false if is_cache_control_respected.nil? && !attributes.key?(:'isCacheControlRespected') # rubocop:disable Style/StringLiterals
198
+
199
+ raise 'You cannot provide both :isCacheControlRespected and :is_cache_control_respected' if attributes.key?(:'isCacheControlRespected') && attributes.key?(:'is_cache_control_respected')
200
+
201
+ self.is_cache_control_respected = attributes[:'is_cache_control_respected'] unless attributes[:'is_cache_control_respected'].nil?
202
+ self.is_cache_control_respected = false if is_cache_control_respected.nil? && !attributes.key?(:'isCacheControlRespected') && !attributes.key?(:'is_cache_control_respected') # rubocop:disable Style/StringLiterals
203
+
204
+ self.is_response_buffering_enabled = attributes[:'isResponseBufferingEnabled'] unless attributes[:'isResponseBufferingEnabled'].nil?
205
+ self.is_response_buffering_enabled = false if is_response_buffering_enabled.nil? && !attributes.key?(:'isResponseBufferingEnabled') # rubocop:disable Style/StringLiterals
206
+
207
+ raise 'You cannot provide both :isResponseBufferingEnabled and :is_response_buffering_enabled' if attributes.key?(:'isResponseBufferingEnabled') && attributes.key?(:'is_response_buffering_enabled')
208
+
209
+ self.is_response_buffering_enabled = attributes[:'is_response_buffering_enabled'] unless attributes[:'is_response_buffering_enabled'].nil?
210
+ self.is_response_buffering_enabled = false if is_response_buffering_enabled.nil? && !attributes.key?(:'isResponseBufferingEnabled') && !attributes.key?(:'is_response_buffering_enabled') # rubocop:disable Style/StringLiterals
211
+
212
+ self.cipher_group = attributes[:'cipherGroup'] if attributes[:'cipherGroup']
213
+ self.cipher_group = "DEFAULT" if cipher_group.nil? && !attributes.key?(:'cipherGroup') # rubocop:disable Style/StringLiterals
214
+
215
+ raise 'You cannot provide both :cipherGroup and :cipher_group' if attributes.key?(:'cipherGroup') && attributes.key?(:'cipher_group')
216
+
217
+ self.cipher_group = attributes[:'cipher_group'] if attributes[:'cipher_group']
218
+ self.cipher_group = "DEFAULT" if cipher_group.nil? && !attributes.key?(:'cipherGroup') && !attributes.key?(:'cipher_group') # rubocop:disable Style/StringLiterals
75
219
  end
76
220
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
77
221
  # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
78
222
 
223
+ # Custom attribute writer method checking allowed values (enum).
224
+ # @param [Object] tls_protocols Object to be assigned
225
+ def tls_protocols=(tls_protocols)
226
+ # rubocop:disable Style/ConditionalAssignment
227
+ if tls_protocols.nil?
228
+ @tls_protocols = nil
229
+ else
230
+ @tls_protocols =
231
+ tls_protocols.collect do |item|
232
+ if TLS_PROTOCOLS_ENUM.include?(item)
233
+ item
234
+ else
235
+ OCI.logger.debug("Unknown value for 'tls_protocols' [#{item}]. Mapping to 'TLS_PROTOCOLS_UNKNOWN_ENUM_VALUE'") if OCI.logger
236
+ TLS_PROTOCOLS_UNKNOWN_ENUM_VALUE
237
+ end
238
+ end
239
+ end
240
+ # rubocop:enable Style/ConditionalAssignment
241
+ end
242
+
243
+ # Custom attribute writer method checking allowed values (enum).
244
+ # @param [Object] client_address_header Object to be assigned
245
+ def client_address_header=(client_address_header)
246
+ # rubocop:disable Style/ConditionalAssignment
247
+ if client_address_header && !CLIENT_ADDRESS_HEADER_ENUM.include?(client_address_header)
248
+ OCI.logger.debug("Unknown value for 'client_address_header' [" + client_address_header + "]. Mapping to 'CLIENT_ADDRESS_HEADER_UNKNOWN_ENUM_VALUE'") if OCI.logger
249
+ @client_address_header = CLIENT_ADDRESS_HEADER_UNKNOWN_ENUM_VALUE
250
+ else
251
+ @client_address_header = client_address_header
252
+ end
253
+ # rubocop:enable Style/ConditionalAssignment
254
+ end
255
+
256
+ # Custom attribute writer method checking allowed values (enum).
257
+ # @param [Object] cipher_group Object to be assigned
258
+ def cipher_group=(cipher_group)
259
+ # rubocop:disable Style/ConditionalAssignment
260
+ if cipher_group && !CIPHER_GROUP_ENUM.include?(cipher_group)
261
+ OCI.logger.debug("Unknown value for 'cipher_group' [" + cipher_group + "]. Mapping to 'CIPHER_GROUP_UNKNOWN_ENUM_VALUE'") if OCI.logger
262
+ @cipher_group = CIPHER_GROUP_UNKNOWN_ENUM_VALUE
263
+ else
264
+ @cipher_group = cipher_group
265
+ end
266
+ # rubocop:enable Style/ConditionalAssignment
267
+ end
268
+
79
269
  # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
80
270
 
81
271
 
@@ -87,7 +277,14 @@ module OCI
87
277
  self.class == other.class &&
88
278
  certificate_id == other.certificate_id &&
89
279
  is_https_enabled == other.is_https_enabled &&
90
- is_https_forced == other.is_https_forced
280
+ is_https_forced == other.is_https_forced &&
281
+ tls_protocols == other.tls_protocols &&
282
+ is_origin_compression_enabled == other.is_origin_compression_enabled &&
283
+ is_behind_cdn == other.is_behind_cdn &&
284
+ client_address_header == other.client_address_header &&
285
+ is_cache_control_respected == other.is_cache_control_respected &&
286
+ is_response_buffering_enabled == other.is_response_buffering_enabled &&
287
+ cipher_group == other.cipher_group
91
288
  end
92
289
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
93
290
 
@@ -103,7 +300,7 @@ module OCI
103
300
  # Calculates hash code according to all attributes.
104
301
  # @return [Fixnum] Hash code
105
302
  def hash
106
- [certificate_id, is_https_enabled, is_https_forced].hash
303
+ [certificate_id, is_https_enabled, is_https_forced, tls_protocols, is_origin_compression_enabled, is_behind_cdn, client_address_header, is_cache_control_respected, is_response_buffering_enabled, cipher_group].hash
107
304
  end
108
305
  # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
109
306
 
@@ -11,11 +11,11 @@ module OCI
11
11
  # \"exclusions\": [
12
12
  # {
13
13
  # \"target\":\"REQUEST_COOKIES\",
14
- # \"exclusions\":[\"yourcompany.com\", \"Wed, 21 Oct 2015 07:28:00 GMT\", \"12345\", \"219ffwef9w0f\"]
14
+ # \"exclusions\":[\"example.com\", \"Wed, 21 Oct 2015 07:28:00 GMT\", \"12345\", \"219ffwef9w0f\"]
15
15
  # },
16
16
  # {
17
17
  # \"target\":\"REQUEST_COOKIES_NAMES\",
18
- # \"exclusions\":[\"domain\", \"expires\", \"id\", \"sessionid\"]
18
+ # \"exclusions\":[\"OAMAuthnCookie\", \"JSESSIONID\", \"HCM-PSJSESSIONID\"]
19
19
  # }
20
20
  # ],
21
21
  # \"key\": \"1000000\",
@@ -0,0 +1,149 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # The list of resources for cache purge. If a resources property is not provided, the purge targets all resources in a policy.
8
+ class Waas::Models::PurgeCache
9
+ # A resource to purge, identified by either a hostless absolute path starting with a single slash (e.g., \"/path/to/resource\") or by a relative path in which the first component will be interpreted as a domain protected by this policy (e.g., \"example.com/path/to/resource\").
10
+ # @return [Array<String>]
11
+ attr_accessor :resources
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ # rubocop:disable Style/SymbolLiteral
17
+ 'resources': :'resources'
18
+ # rubocop:enable Style/SymbolLiteral
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.swagger_types
24
+ {
25
+ # rubocop:disable Style/SymbolLiteral
26
+ 'resources': :'Array<String>'
27
+ # rubocop:enable Style/SymbolLiteral
28
+ }
29
+ end
30
+
31
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
32
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
33
+
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ # @option attributes [Array<String>] :resources The value to assign to the {#resources} property
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
43
+
44
+ self.resources = attributes[:'resources'] if attributes[:'resources']
45
+ end
46
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
47
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
48
+
49
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
50
+
51
+
52
+ # Checks equality by comparing each attribute.
53
+ # @param [Object] other the other object to be compared
54
+ def ==(other)
55
+ return true if equal?(other)
56
+
57
+ self.class == other.class &&
58
+ resources == other.resources
59
+ end
60
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
61
+
62
+ # @see the `==` method
63
+ # @param [Object] other the other object to be compared
64
+ def eql?(other)
65
+ self == other
66
+ end
67
+
68
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
69
+
70
+
71
+ # Calculates hash code according to all attributes.
72
+ # @return [Fixnum] Hash code
73
+ def hash
74
+ [resources].hash
75
+ end
76
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
77
+
78
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
79
+
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+
87
+ self.class.swagger_types.each_pair do |key, type|
88
+ if type =~ /^Array<(.*)>/i
89
+ # check to ensure the input is an array given that the the attribute
90
+ # is documented as an array but the input is not
91
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
92
+ public_method("#{key}=").call(
93
+ attributes[self.class.attribute_map[key]]
94
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
95
+ )
96
+ end
97
+ elsif !attributes[self.class.attribute_map[key]].nil?
98
+ public_method("#{key}=").call(
99
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
100
+ )
101
+ end
102
+ # or else data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+
105
+ self
106
+ end
107
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
108
+
109
+ # Returns the string representation of the object
110
+ # @return [String] String presentation of the object
111
+ def to_s
112
+ to_hash.to_s
113
+ end
114
+
115
+ # Returns the object in the form of hash
116
+ # @return [Hash] Returns the object in the form of hash
117
+ def to_hash
118
+ hash = {}
119
+ self.class.attribute_map.each_pair do |attr, param|
120
+ value = public_method(attr).call
121
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
122
+
123
+ hash[param] = _to_hash(value)
124
+ end
125
+ hash
126
+ end
127
+
128
+ private
129
+
130
+ # Outputs non-array value in the form of hash
131
+ # For object, use to_hash. Otherwise, just return the value
132
+ # @param [Object] value Any valid value
133
+ # @return [Hash] Returns the value in the form of hash
134
+ def _to_hash(value)
135
+ if value.is_a?(Array)
136
+ value.compact.map { |v| _to_hash(v) }
137
+ elsif value.is_a?(Hash)
138
+ {}.tap do |hash|
139
+ value.each { |k, v| hash[k] = _to_hash(v) }
140
+ end
141
+ elsif value.respond_to? :to_hash
142
+ value.to_hash
143
+ else
144
+ value
145
+ end
146
+ end
147
+ end
148
+ end
149
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,199 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # The data used to update the address list.
8
+ class Waas::Models::UpdateAddressListDetails
9
+ # A unique user-friendly name for the address list.
10
+ # @return [String]
11
+ attr_accessor :display_name
12
+
13
+ # A list of IP addresses or CIDR notations.
14
+ # @return [Array<String>]
15
+ attr_accessor :addresses
16
+
17
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
18
+ # For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
19
+ #
20
+ # Example: `{\"Department\": \"Finance\"}`
21
+ #
22
+ # @return [Hash<String, String>]
23
+ attr_accessor :freeform_tags
24
+
25
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
26
+ # For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
27
+ #
28
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
29
+ #
30
+ # @return [Hash<String, Hash<String, Object>>]
31
+ attr_accessor :defined_tags
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ # rubocop:disable Style/SymbolLiteral
37
+ 'display_name': :'displayName',
38
+ 'addresses': :'addresses',
39
+ 'freeform_tags': :'freeformTags',
40
+ 'defined_tags': :'definedTags'
41
+ # rubocop:enable Style/SymbolLiteral
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.swagger_types
47
+ {
48
+ # rubocop:disable Style/SymbolLiteral
49
+ 'display_name': :'String',
50
+ 'addresses': :'Array<String>',
51
+ 'freeform_tags': :'Hash<String, String>',
52
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
53
+ # rubocop:enable Style/SymbolLiteral
54
+ }
55
+ end
56
+
57
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
58
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
59
+
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
64
+ # @option attributes [Array<String>] :addresses The value to assign to the {#addresses} property
65
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
66
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
67
+ def initialize(attributes = {})
68
+ return unless attributes.is_a?(Hash)
69
+
70
+ # convert string to symbol for hash key
71
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
72
+
73
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
74
+
75
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
76
+
77
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
78
+
79
+ self.addresses = attributes[:'addresses'] if attributes[:'addresses']
80
+
81
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
82
+
83
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
84
+
85
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
86
+
87
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
88
+
89
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
90
+
91
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
92
+ end
93
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
94
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
95
+
96
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
97
+
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] other the other object to be compared
101
+ def ==(other)
102
+ return true if equal?(other)
103
+
104
+ self.class == other.class &&
105
+ display_name == other.display_name &&
106
+ addresses == other.addresses &&
107
+ freeform_tags == other.freeform_tags &&
108
+ defined_tags == other.defined_tags
109
+ end
110
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
111
+
112
+ # @see the `==` method
113
+ # @param [Object] other the other object to be compared
114
+ def eql?(other)
115
+ self == other
116
+ end
117
+
118
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
119
+
120
+
121
+ # Calculates hash code according to all attributes.
122
+ # @return [Fixnum] Hash code
123
+ def hash
124
+ [display_name, addresses, freeform_tags, defined_tags].hash
125
+ end
126
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
127
+
128
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
129
+
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
+
137
+ self.class.swagger_types.each_pair do |key, type|
138
+ if type =~ /^Array<(.*)>/i
139
+ # check to ensure the input is an array given that the the attribute
140
+ # is documented as an array but the input is not
141
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
142
+ public_method("#{key}=").call(
143
+ attributes[self.class.attribute_map[key]]
144
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
145
+ )
146
+ end
147
+ elsif !attributes[self.class.attribute_map[key]].nil?
148
+ public_method("#{key}=").call(
149
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
150
+ )
151
+ end
152
+ # or else data not found in attributes(hash), not an issue as the data can be optional
153
+ end
154
+
155
+ self
156
+ end
157
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
158
+
159
+ # Returns the string representation of the object
160
+ # @return [String] String presentation of the object
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # Returns the object in the form of hash
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_hash
168
+ hash = {}
169
+ self.class.attribute_map.each_pair do |attr, param|
170
+ value = public_method(attr).call
171
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
172
+
173
+ hash[param] = _to_hash(value)
174
+ end
175
+ hash
176
+ end
177
+
178
+ private
179
+
180
+ # Outputs non-array value in the form of hash
181
+ # For object, use to_hash. Otherwise, just return the value
182
+ # @param [Object] value Any valid value
183
+ # @return [Hash] Returns the value in the form of hash
184
+ def _to_hash(value)
185
+ if value.is_a?(Array)
186
+ value.compact.map { |v| _to_hash(v) }
187
+ elsif value.is_a?(Hash)
188
+ {}.tap do |hash|
189
+ value.each { |k, v| hash[k] = _to_hash(v) }
190
+ end
191
+ elsif value.respond_to? :to_hash
192
+ value.to_hash
193
+ else
194
+ value
195
+ end
196
+ end
197
+ end
198
+ end
199
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength