oci 2.5.11 → 2.6.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 (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
@@ -0,0 +1,143 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
4
+ module OCI
5
+ # This class provides a wrapper around {OCI::Dts::TransferJobClient} and offers convenience methods
6
+ # for operations that would otherwise need to be chained together. For example, instead of performing an action
7
+ # on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource
8
+ # to enter a given state, you can call a single method in this class to accomplish the same functionality
9
+ class Dts::TransferJobClientCompositeOperations
10
+ # The {OCI::Dts::TransferJobClient} used to communicate with the service_client
11
+ #
12
+ # @return [OCI::Dts::TransferJobClient]
13
+ attr_reader :service_client
14
+
15
+ # Initializes a new TransferJobClientCompositeOperations
16
+ #
17
+ # @param [OCI::Dts::TransferJobClient] service_client The client used to communicate with the service.
18
+ # Defaults to a new service client created via {OCI::Dts::TransferJobClient#initialize} with no arguments
19
+ def initialize(service_client = OCI::Dts::TransferJobClient.new)
20
+ @service_client = service_client
21
+ end
22
+
23
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
24
+ # rubocop:disable Layout/EmptyLines
25
+
26
+
27
+ # Calls {OCI::Dts::TransferJobClient#create_transfer_job} and then waits for the {OCI::Dts::Models::TransferJob} acted upon
28
+ # to enter the given state(s).
29
+ #
30
+ # @param [OCI::Dts::Models::CreateTransferJobDetails] create_transfer_job_details Creates a New Transfer Job
31
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Dts::Models::TransferJob#lifecycle_state}
32
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Dts::TransferJobClient#create_transfer_job}
33
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
34
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
35
+ # * max_wait_seconds The maximum time to wait, in seconds
36
+ #
37
+ # @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Dts::Models::TransferJob}
38
+ def create_transfer_job_and_wait_for_state(create_transfer_job_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
39
+ operation_result = @service_client.create_transfer_job(create_transfer_job_details, base_operation_opts)
40
+
41
+ return operation_result if wait_for_states.empty?
42
+
43
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
44
+ wait_for_resource_id = operation_result.data.id
45
+
46
+ begin
47
+ waiter_result = @service_client.get_transfer_job(wait_for_resource_id).wait_until(
48
+ eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
49
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
50
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
51
+ )
52
+ result_to_return = waiter_result
53
+
54
+ return result_to_return
55
+ rescue StandardError
56
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
57
+ end
58
+ end
59
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
60
+ # rubocop:enable Layout/EmptyLines
61
+
62
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
63
+ # rubocop:disable Layout/EmptyLines
64
+
65
+
66
+ # Calls {OCI::Dts::TransferJobClient#delete_transfer_job} and then waits for the {OCI::Dts::Models::TransferJob} acted upon
67
+ # to enter the given state(s).
68
+ #
69
+ # @param [String] id ID of the Transfer Job
70
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Dts::Models::TransferJob#lifecycle_state}
71
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Dts::TransferJobClient#delete_transfer_job}
72
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
73
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
74
+ # * max_wait_seconds The maximum time to wait, in seconds
75
+ #
76
+ # @return [OCI::Response] A {OCI::Response} object with data of type nil
77
+ def delete_transfer_job_and_wait_for_state(id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
78
+ initial_get_result = @service_client.get_transfer_job(id)
79
+ operation_result = @service_client.delete_transfer_job(id, base_operation_opts)
80
+
81
+ return operation_result if wait_for_states.empty?
82
+
83
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
84
+
85
+ begin
86
+ waiter_result = initial_get_result.wait_until(
87
+ eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
88
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
89
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
90
+ succeed_on_not_found: true
91
+ )
92
+ result_to_return = waiter_result
93
+
94
+ return result_to_return
95
+ rescue StandardError
96
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
97
+ end
98
+ end
99
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
100
+ # rubocop:enable Layout/EmptyLines
101
+
102
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
103
+ # rubocop:disable Layout/EmptyLines
104
+
105
+
106
+ # Calls {OCI::Dts::TransferJobClient#update_transfer_job} and then waits for the {OCI::Dts::Models::TransferJob} acted upon
107
+ # to enter the given state(s).
108
+ #
109
+ # @param [String] id ID of the Transfer Job
110
+ # @param [OCI::Dts::Models::UpdateTransferJobDetails] update_transfer_job_details fields to update
111
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Dts::Models::TransferJob#lifecycle_state}
112
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Dts::TransferJobClient#update_transfer_job}
113
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
114
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
115
+ # * max_wait_seconds The maximum time to wait, in seconds
116
+ #
117
+ # @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Dts::Models::TransferJob}
118
+ def update_transfer_job_and_wait_for_state(id, update_transfer_job_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
119
+ operation_result = @service_client.update_transfer_job(id, update_transfer_job_details, base_operation_opts)
120
+
121
+ return operation_result if wait_for_states.empty?
122
+
123
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
124
+ wait_for_resource_id = operation_result.data.id
125
+
126
+ begin
127
+ waiter_result = @service_client.get_transfer_job(wait_for_resource_id).wait_until(
128
+ eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
129
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
130
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
131
+ )
132
+ result_to_return = waiter_result
133
+
134
+ return result_to_return
135
+ rescue StandardError
136
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
137
+ end
138
+ end
139
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
140
+ # rubocop:enable Layout/EmptyLines
141
+ end
142
+ end
143
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,515 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'uri'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
+ module OCI
8
+ # A description of the DTS API
9
+ class Dts::TransferPackageClient
10
+ # Client used to make HTTP requests.
11
+ # @return [OCI::ApiClient]
12
+ attr_reader :api_client
13
+
14
+ # Fully qualified endpoint URL
15
+ # @return [String]
16
+ attr_reader :endpoint
17
+
18
+ # The default retry configuration to apply to all operations in this service client. This can be overridden
19
+ # on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
20
+ # will not perform any retries
21
+ # @return [OCI::Retry::RetryConfig]
22
+ attr_reader :retry_config
23
+
24
+ # The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
25
+ # @return [String]
26
+ attr_reader :region
27
+
28
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
29
+
30
+
31
+ # Creates a new TransferPackageClient.
32
+ # Notes:
33
+ # If a config is not specified, then the global OCI.config will be used.
34
+ #
35
+ # This client is not thread-safe
36
+ #
37
+ # Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
38
+ # region. A region may be specified in the config or via or the region parameter. If specified in both, then the
39
+ # region parameter will be used.
40
+ # @param [Config] config A Config object.
41
+ # @param [String] region A region used to determine the service endpoint. This will usually
42
+ # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
43
+ # @param [String] endpoint The fully qualified endpoint URL
44
+ # @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
45
+ # a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
46
+ # so that the instance principals signer can be provided to the client
47
+ # @param [OCI::ApiClientProxySettings] proxy_settings If your environment requires you to use a proxy server for outgoing HTTP requests
48
+ # the details for the proxy can be provided in this parameter
49
+ # @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
50
+ # apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
51
+ # will not perform any retries
52
+ def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
53
+ # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
54
+ # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
55
+ # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
56
+ # pass it to this constructor.
57
+ #
58
+ # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
59
+ # so try and load the config from the default file.
60
+ config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
61
+ config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
62
+ config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
63
+
64
+ if signer.nil?
65
+ signer = OCI::Signer.new(
66
+ config.user,
67
+ config.fingerprint,
68
+ config.tenancy,
69
+ config.key_file,
70
+ pass_phrase: config.pass_phrase,
71
+ private_key_content: config.key_content
72
+ )
73
+ end
74
+
75
+ @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
76
+ @retry_config = retry_config
77
+
78
+ if endpoint
79
+ @endpoint = endpoint + '/20171001'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "TransferPackageClient endpoint set to '#{@endpoint}'." if logger
86
+ end
87
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
88
+
89
+ # Set the region that will be used to determine the service endpoint.
90
+ # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
91
+ # but may be an arbitrary string.
92
+ def region=(new_region)
93
+ @region = new_region
94
+
95
+ raise 'A region must be specified.' unless @region
96
+
97
+ @endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://datatransfer.{region}.{secondLevelDomain}') + '/20171001'
98
+ logger.info "TransferPackageClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
99
+ end
100
+
101
+ # @return [Logger] The logger for this client. May be nil.
102
+ def logger
103
+ @api_client.config.logger
104
+ end
105
+
106
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
107
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
108
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
109
+ # rubocop:disable Lint/UnusedMethodArgument
110
+
111
+
112
+ # Attaches Devices to a Transfer Package
113
+ # @param [String] id ID of the Transfer Job
114
+ # @param [String] transfer_package_label Label of the Transfer Package
115
+ # @param [OCI::Dts::Models::AttachDevicesDetails] attach_devices_details Labels of Transfer Devices to attach
116
+ # @param [Hash] opts the optional parameters
117
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
118
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
119
+ # @return [Response] A Response object with data of type nil
120
+ def attach_devices_to_transfer_package(id, transfer_package_label, attach_devices_details, opts = {})
121
+ logger.debug 'Calling operation TransferPackageClient#attach_devices_to_transfer_package.' if logger
122
+
123
+ raise "Missing the required parameter 'id' when calling attach_devices_to_transfer_package." if id.nil?
124
+ raise "Missing the required parameter 'transfer_package_label' when calling attach_devices_to_transfer_package." if transfer_package_label.nil?
125
+ raise "Missing the required parameter 'attach_devices_details' when calling attach_devices_to_transfer_package." if attach_devices_details.nil?
126
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
127
+ raise "Parameter value for 'transfer_package_label' must not be blank" if OCI::Internal::Util.blank_string?(transfer_package_label)
128
+
129
+ path = '/transferJobs/{id}/transferPackages/{transferPackageLabel}/actions/attachDevices'.sub('{id}', id.to_s).sub('{transferPackageLabel}', transfer_package_label.to_s)
130
+ operation_signing_strategy = :standard
131
+
132
+ # rubocop:disable Style/NegatedIf
133
+ # Query Params
134
+ query_params = {}
135
+
136
+ # Header Params
137
+ header_params = {}
138
+ header_params[:accept] = 'application/json'
139
+ header_params[:'content-type'] = 'application/json'
140
+ # rubocop:enable Style/NegatedIf
141
+
142
+ post_body = @api_client.object_to_http_body(attach_devices_details)
143
+
144
+ # rubocop:disable Metrics/BlockLength
145
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferPackageClient#attach_devices_to_transfer_package') do
146
+ @api_client.call_api(
147
+ :POST,
148
+ path,
149
+ endpoint,
150
+ header_params: header_params,
151
+ query_params: query_params,
152
+ operation_signing_strategy: operation_signing_strategy,
153
+ body: post_body
154
+ )
155
+ end
156
+ # rubocop:enable Metrics/BlockLength
157
+ end
158
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
159
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
160
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
161
+ # rubocop:enable Lint/UnusedMethodArgument
162
+
163
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
164
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
165
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
166
+
167
+
168
+ # Create a new Transfer Package
169
+ # @param [String] id ID of the Transfer Job
170
+ # @param [Hash] opts the optional parameters
171
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
172
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
173
+ # @option opts [String] :opc_retry_token
174
+ # @option opts [OCI::Dts::Models::CreateTransferPackageDetails] :create_transfer_package_details Creates a New Transfer Package
175
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferPackage TransferPackage}
176
+ def create_transfer_package(id, opts = {})
177
+ logger.debug 'Calling operation TransferPackageClient#create_transfer_package.' if logger
178
+
179
+ raise "Missing the required parameter 'id' when calling create_transfer_package." if id.nil?
180
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
181
+
182
+ path = '/transferJobs/{id}/transferPackages'.sub('{id}', id.to_s)
183
+ operation_signing_strategy = :standard
184
+
185
+ # rubocop:disable Style/NegatedIf
186
+ # Query Params
187
+ query_params = {}
188
+
189
+ # Header Params
190
+ header_params = {}
191
+ header_params[:accept] = 'application/json'
192
+ header_params[:'content-type'] = 'application/json'
193
+ header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
194
+ # rubocop:enable Style/NegatedIf
195
+ header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
196
+
197
+ post_body = @api_client.object_to_http_body(opts[:create_transfer_package_details])
198
+
199
+ # rubocop:disable Metrics/BlockLength
200
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferPackageClient#create_transfer_package') do
201
+ @api_client.call_api(
202
+ :POST,
203
+ path,
204
+ endpoint,
205
+ header_params: header_params,
206
+ query_params: query_params,
207
+ operation_signing_strategy: operation_signing_strategy,
208
+ body: post_body,
209
+ return_type: 'OCI::Dts::Models::TransferPackage'
210
+ )
211
+ end
212
+ # rubocop:enable Metrics/BlockLength
213
+ end
214
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
215
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
216
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
217
+
218
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
219
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
220
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
221
+ # rubocop:disable Lint/UnusedMethodArgument
222
+
223
+
224
+ # deletes a transfer Package
225
+ # @param [String] id ID of the Transfer Job
226
+ # @param [String] transfer_package_label Label of the Transfer Package
227
+ # @param [Hash] opts the optional parameters
228
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
229
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
230
+ # @return [Response] A Response object with data of type nil
231
+ def delete_transfer_package(id, transfer_package_label, opts = {})
232
+ logger.debug 'Calling operation TransferPackageClient#delete_transfer_package.' if logger
233
+
234
+ raise "Missing the required parameter 'id' when calling delete_transfer_package." if id.nil?
235
+ raise "Missing the required parameter 'transfer_package_label' when calling delete_transfer_package." if transfer_package_label.nil?
236
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
237
+ raise "Parameter value for 'transfer_package_label' must not be blank" if OCI::Internal::Util.blank_string?(transfer_package_label)
238
+
239
+ path = '/transferJobs/{id}/transferPackages/{transferPackageLabel}'.sub('{id}', id.to_s).sub('{transferPackageLabel}', transfer_package_label.to_s)
240
+ operation_signing_strategy = :standard
241
+
242
+ # rubocop:disable Style/NegatedIf
243
+ # Query Params
244
+ query_params = {}
245
+
246
+ # Header Params
247
+ header_params = {}
248
+ header_params[:accept] = 'application/json'
249
+ header_params[:'content-type'] = 'application/json'
250
+ # rubocop:enable Style/NegatedIf
251
+
252
+ post_body = nil
253
+
254
+ # rubocop:disable Metrics/BlockLength
255
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferPackageClient#delete_transfer_package') do
256
+ @api_client.call_api(
257
+ :DELETE,
258
+ path,
259
+ endpoint,
260
+ header_params: header_params,
261
+ query_params: query_params,
262
+ operation_signing_strategy: operation_signing_strategy,
263
+ body: post_body
264
+ )
265
+ end
266
+ # rubocop:enable Metrics/BlockLength
267
+ end
268
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
269
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
270
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
271
+ # rubocop:enable Lint/UnusedMethodArgument
272
+
273
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
274
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
275
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
276
+ # rubocop:disable Lint/UnusedMethodArgument
277
+
278
+
279
+ # Detaches Devices from a Transfer Package
280
+ # @param [String] id ID of the Transfer Job
281
+ # @param [String] transfer_package_label Label of the Transfer Package
282
+ # @param [OCI::Dts::Models::DetachDevicesDetails] detach_devices_details Labels of Transfer Devices to detach
283
+ # @param [Hash] opts the optional parameters
284
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
285
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
286
+ # @return [Response] A Response object with data of type nil
287
+ def detach_devices_from_transfer_package(id, transfer_package_label, detach_devices_details, opts = {})
288
+ logger.debug 'Calling operation TransferPackageClient#detach_devices_from_transfer_package.' if logger
289
+
290
+ raise "Missing the required parameter 'id' when calling detach_devices_from_transfer_package." if id.nil?
291
+ raise "Missing the required parameter 'transfer_package_label' when calling detach_devices_from_transfer_package." if transfer_package_label.nil?
292
+ raise "Missing the required parameter 'detach_devices_details' when calling detach_devices_from_transfer_package." if detach_devices_details.nil?
293
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
294
+ raise "Parameter value for 'transfer_package_label' must not be blank" if OCI::Internal::Util.blank_string?(transfer_package_label)
295
+
296
+ path = '/transferJobs/{id}/transferPackages/{transferPackageLabel}/actions/detachDevices'.sub('{id}', id.to_s).sub('{transferPackageLabel}', transfer_package_label.to_s)
297
+ operation_signing_strategy = :standard
298
+
299
+ # rubocop:disable Style/NegatedIf
300
+ # Query Params
301
+ query_params = {}
302
+
303
+ # Header Params
304
+ header_params = {}
305
+ header_params[:accept] = 'application/json'
306
+ header_params[:'content-type'] = 'application/json'
307
+ # rubocop:enable Style/NegatedIf
308
+
309
+ post_body = @api_client.object_to_http_body(detach_devices_details)
310
+
311
+ # rubocop:disable Metrics/BlockLength
312
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferPackageClient#detach_devices_from_transfer_package') do
313
+ @api_client.call_api(
314
+ :POST,
315
+ path,
316
+ endpoint,
317
+ header_params: header_params,
318
+ query_params: query_params,
319
+ operation_signing_strategy: operation_signing_strategy,
320
+ body: post_body
321
+ )
322
+ end
323
+ # rubocop:enable Metrics/BlockLength
324
+ end
325
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
326
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
327
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
328
+ # rubocop:enable Lint/UnusedMethodArgument
329
+
330
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
331
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
332
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
333
+ # rubocop:disable Lint/UnusedMethodArgument
334
+
335
+
336
+ # Describes a transfer package in detail
337
+ # @param [String] id ID of the Transfer Job
338
+ # @param [String] transfer_package_label Label of the Transfer Package
339
+ # @param [Hash] opts the optional parameters
340
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
341
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
342
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferPackage TransferPackage}
343
+ def get_transfer_package(id, transfer_package_label, opts = {})
344
+ logger.debug 'Calling operation TransferPackageClient#get_transfer_package.' if logger
345
+
346
+ raise "Missing the required parameter 'id' when calling get_transfer_package." if id.nil?
347
+ raise "Missing the required parameter 'transfer_package_label' when calling get_transfer_package." if transfer_package_label.nil?
348
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
349
+ raise "Parameter value for 'transfer_package_label' must not be blank" if OCI::Internal::Util.blank_string?(transfer_package_label)
350
+
351
+ path = '/transferJobs/{id}/transferPackages/{transferPackageLabel}'.sub('{id}', id.to_s).sub('{transferPackageLabel}', transfer_package_label.to_s)
352
+ operation_signing_strategy = :standard
353
+
354
+ # rubocop:disable Style/NegatedIf
355
+ # Query Params
356
+ query_params = {}
357
+
358
+ # Header Params
359
+ header_params = {}
360
+ header_params[:accept] = 'application/json'
361
+ header_params[:'content-type'] = 'application/json'
362
+ # rubocop:enable Style/NegatedIf
363
+
364
+ post_body = nil
365
+
366
+ # rubocop:disable Metrics/BlockLength
367
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferPackageClient#get_transfer_package') do
368
+ @api_client.call_api(
369
+ :GET,
370
+ path,
371
+ endpoint,
372
+ header_params: header_params,
373
+ query_params: query_params,
374
+ operation_signing_strategy: operation_signing_strategy,
375
+ body: post_body,
376
+ return_type: 'OCI::Dts::Models::TransferPackage'
377
+ )
378
+ end
379
+ # rubocop:enable Metrics/BlockLength
380
+ end
381
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
382
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
383
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
384
+ # rubocop:enable Lint/UnusedMethodArgument
385
+
386
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
387
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
388
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
389
+
390
+
391
+ # Lists Transfer Packages associated with a transferJob
392
+ # @param [String] id ID of the Transfer Job
393
+ # @param [Hash] opts the optional parameters
394
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
395
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
396
+ # @option opts [String] :lifecycle_state filtering by lifecycleState
397
+ # Allowed values are: PREPARING, SHIPPING, RECEIVED, PROCESSING, PROCESSED, RETURNED, DELETED, CANCELLED, CANCELLED_RETURNED
398
+ # @option opts [String] :display_name filtering by displayName
399
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::MultipleTransferPackages MultipleTransferPackages}
400
+ def list_transfer_packages(id, opts = {})
401
+ logger.debug 'Calling operation TransferPackageClient#list_transfer_packages.' if logger
402
+
403
+ raise "Missing the required parameter 'id' when calling list_transfer_packages." if id.nil?
404
+
405
+ if opts[:lifecycle_state] && !%w[PREPARING SHIPPING RECEIVED PROCESSING PROCESSED RETURNED DELETED CANCELLED CANCELLED_RETURNED].include?(opts[:lifecycle_state])
406
+ raise 'Invalid value for "lifecycle_state", must be one of PREPARING, SHIPPING, RECEIVED, PROCESSING, PROCESSED, RETURNED, DELETED, CANCELLED, CANCELLED_RETURNED.'
407
+ end
408
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
409
+
410
+ path = '/transferJobs/{id}/transferPackages'.sub('{id}', id.to_s)
411
+ operation_signing_strategy = :standard
412
+
413
+ # rubocop:disable Style/NegatedIf
414
+ # Query Params
415
+ query_params = {}
416
+ query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
417
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
418
+
419
+ # Header Params
420
+ header_params = {}
421
+ header_params[:accept] = 'application/json'
422
+ header_params[:'content-type'] = 'application/json'
423
+ # rubocop:enable Style/NegatedIf
424
+
425
+ post_body = nil
426
+
427
+ # rubocop:disable Metrics/BlockLength
428
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferPackageClient#list_transfer_packages') do
429
+ @api_client.call_api(
430
+ :GET,
431
+ path,
432
+ endpoint,
433
+ header_params: header_params,
434
+ query_params: query_params,
435
+ operation_signing_strategy: operation_signing_strategy,
436
+ body: post_body,
437
+ return_type: 'OCI::Dts::Models::MultipleTransferPackages'
438
+ )
439
+ end
440
+ # rubocop:enable Metrics/BlockLength
441
+ end
442
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
443
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
444
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
445
+
446
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
447
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
448
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
449
+
450
+
451
+ # Updates a Transfer Package
452
+ # @param [String] id ID of the Transfer Job
453
+ # @param [String] transfer_package_label Label of the Transfer Package
454
+ # @param [OCI::Dts::Models::UpdateTransferPackageDetails] update_transfer_package_details fields to update
455
+ # @param [Hash] opts the optional parameters
456
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
457
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
458
+ # @option opts [String] :if_match The entity tag to match. Optional, if set, the update will be successful only if the
459
+ # object's tag matches the tag specified in the request.
460
+ #
461
+ # @return [Response] A Response object with data of type {OCI::Dts::Models::TransferPackage TransferPackage}
462
+ def update_transfer_package(id, transfer_package_label, update_transfer_package_details, opts = {})
463
+ logger.debug 'Calling operation TransferPackageClient#update_transfer_package.' if logger
464
+
465
+ raise "Missing the required parameter 'id' when calling update_transfer_package." if id.nil?
466
+ raise "Missing the required parameter 'transfer_package_label' when calling update_transfer_package." if transfer_package_label.nil?
467
+ raise "Missing the required parameter 'update_transfer_package_details' when calling update_transfer_package." if update_transfer_package_details.nil?
468
+ raise "Parameter value for 'id' must not be blank" if OCI::Internal::Util.blank_string?(id)
469
+ raise "Parameter value for 'transfer_package_label' must not be blank" if OCI::Internal::Util.blank_string?(transfer_package_label)
470
+
471
+ path = '/transferJobs/{id}/transferPackages/{transferPackageLabel}'.sub('{id}', id.to_s).sub('{transferPackageLabel}', transfer_package_label.to_s)
472
+ operation_signing_strategy = :standard
473
+
474
+ # rubocop:disable Style/NegatedIf
475
+ # Query Params
476
+ query_params = {}
477
+
478
+ # Header Params
479
+ header_params = {}
480
+ header_params[:accept] = 'application/json'
481
+ header_params[:'content-type'] = 'application/json'
482
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
483
+ # rubocop:enable Style/NegatedIf
484
+
485
+ post_body = @api_client.object_to_http_body(update_transfer_package_details)
486
+
487
+ # rubocop:disable Metrics/BlockLength
488
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'TransferPackageClient#update_transfer_package') do
489
+ @api_client.call_api(
490
+ :PUT,
491
+ path,
492
+ endpoint,
493
+ header_params: header_params,
494
+ query_params: query_params,
495
+ operation_signing_strategy: operation_signing_strategy,
496
+ body: post_body,
497
+ return_type: 'OCI::Dts::Models::TransferPackage'
498
+ )
499
+ end
500
+ # rubocop:enable Metrics/BlockLength
501
+ end
502
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
503
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
504
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
505
+
506
+ private
507
+
508
+ def applicable_retry_config(opts = {})
509
+ return @retry_config unless opts.key?(:retry_config)
510
+
511
+ opts[:retry_config]
512
+ end
513
+ end
514
+ end
515
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength