oci 2.5.10 → 2.5.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -1
  3. data/lib/oci.rb +3 -0
  4. data/lib/oci/budget/budget.rb +1 -0
  5. data/lib/oci/budget/budget_client.rb +21 -1
  6. data/lib/oci/budget/models/budget.rb +52 -2
  7. data/lib/oci/budget/models/budget_summary.rb +52 -2
  8. data/lib/oci/budget/models/create_budget_details.rb +55 -2
  9. data/lib/oci/budget/models/target_type.rb +10 -0
  10. data/lib/oci/core/blockstorage_client.rb +18 -6
  11. data/lib/oci/core/compute_client.rb +75 -0
  12. data/lib/oci/core/compute_management_client.rb +4 -1
  13. data/lib/oci/core/core.rb +12 -0
  14. data/lib/oci/core/models/add_security_rule_details.rb +2 -2
  15. data/lib/oci/core/models/boot_volume_backup.rb +19 -1
  16. data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +2 -2
  17. data/lib/oci/core/models/change_boot_volume_compartment_details.rb +2 -2
  18. data/lib/oci/core/models/change_cpe_compartment_details.rb +155 -0
  19. data/lib/oci/core/models/change_cross_connect_compartment_details.rb +155 -0
  20. data/lib/oci/core/models/change_cross_connect_group_compartment_details.rb +155 -0
  21. data/lib/oci/core/models/change_instance_compartment_details.rb +154 -0
  22. data/lib/oci/core/models/change_ip_sec_connection_compartment_details.rb +155 -0
  23. data/lib/oci/core/models/change_remote_peering_connection_compartment_details.rb +155 -0
  24. data/lib/oci/core/models/change_virtual_circuit_compartment_details.rb +155 -0
  25. data/lib/oci/core/models/change_volume_backup_compartment_details.rb +2 -2
  26. data/lib/oci/core/models/change_volume_compartment_details.rb +2 -2
  27. data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +2 -2
  28. data/lib/oci/core/models/change_volume_group_compartment_details.rb +2 -2
  29. data/lib/oci/core/models/copy_volume_backup_details.rb +27 -4
  30. data/lib/oci/core/models/create_cross_connect_details.rb +37 -1
  31. data/lib/oci/core/models/create_cross_connect_group_details.rb +40 -4
  32. data/lib/oci/core/models/create_instance_configuration_base.rb +250 -0
  33. data/lib/oci/core/models/create_instance_configuration_details.rb +15 -57
  34. data/lib/oci/core/models/create_instance_configuration_from_instance_details.rb +179 -0
  35. data/lib/oci/core/models/create_ipv6_details.rb +249 -0
  36. data/lib/oci/core/models/create_remote_peering_connection_details.rb +40 -4
  37. data/lib/oci/core/models/create_service_gateway_details.rb +23 -1
  38. data/lib/oci/core/models/create_subnet_details.rb +24 -1
  39. data/lib/oci/core/models/create_vcn_details.rb +56 -4
  40. data/lib/oci/core/models/create_virtual_circuit_details.rb +38 -2
  41. data/lib/oci/core/models/cross_connect.rb +37 -1
  42. data/lib/oci/core/models/cross_connect_group.rb +37 -1
  43. data/lib/oci/core/models/cross_connect_mapping.rb +50 -1
  44. data/lib/oci/core/models/egress_security_rule.rb +10 -7
  45. data/lib/oci/core/models/ingress_security_rule.rb +10 -7
  46. data/lib/oci/core/models/instance.rb +1 -0
  47. data/lib/oci/core/models/ipv6.rb +375 -0
  48. data/lib/oci/core/models/private_ip.rb +1 -0
  49. data/lib/oci/core/models/remote_peering_connection.rb +37 -1
  50. data/lib/oci/core/models/route_rule.rb +4 -1
  51. data/lib/oci/core/models/security_rule.rb +2 -2
  52. data/lib/oci/core/models/service_gateway.rb +18 -1
  53. data/lib/oci/core/models/subnet.rb +56 -1
  54. data/lib/oci/core/models/update_cross_connect_details.rb +37 -1
  55. data/lib/oci/core/models/update_cross_connect_group_details.rb +40 -4
  56. data/lib/oci/core/models/update_ipv6_details.rb +229 -0
  57. data/lib/oci/core/models/update_remote_peering_connection_details.rb +40 -4
  58. data/lib/oci/core/models/update_security_rule_details.rb +2 -2
  59. data/lib/oci/core/models/update_service_gateway_details.rb +18 -1
  60. data/lib/oci/core/models/update_virtual_circuit_details.rb +37 -1
  61. data/lib/oci/core/models/vcn.rb +42 -1
  62. data/lib/oci/core/models/virtual_circuit.rb +37 -1
  63. data/lib/oci/core/models/volume_backup.rb +19 -1
  64. data/lib/oci/core/virtual_network_client.rb +744 -10
  65. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  66. data/lib/oci/database/database.rb +3 -0
  67. data/lib/oci/database/database_client.rb +320 -36
  68. data/lib/oci/database/models/autonomous_data_warehouse.rb +1 -0
  69. data/lib/oci/database/models/autonomous_data_warehouse_console_token_details.rb +164 -0
  70. data/lib/oci/database/models/autonomous_data_warehouse_summary.rb +1 -0
  71. data/lib/oci/database/models/autonomous_database.rb +5 -3
  72. data/lib/oci/database/models/autonomous_database_connection_urls.rb +1 -1
  73. data/lib/oci/database/models/autonomous_database_console_token_details.rb +163 -0
  74. data/lib/oci/database/models/autonomous_database_summary.rb +5 -3
  75. data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +1 -3
  76. data/lib/oci/database/models/change_compartment_details.rb +155 -0
  77. data/lib/oci/database/models/create_autonomous_database_base.rb +5 -4
  78. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +2 -5
  79. data/lib/oci/database/models/create_database_details.rb +1 -1
  80. data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +2 -1
  81. data/lib/oci/database/models/create_db_home_with_db_system_id_from_backup_details.rb +2 -1
  82. data/lib/oci/database/models/db_system.rb +2 -5
  83. data/lib/oci/database/models/db_system_summary.rb +2 -5
  84. data/lib/oci/database/models/launch_db_system_base.rb +3 -5
  85. data/lib/oci/database/models/maintenance_window.rb +2 -1
  86. data/lib/oci/database/models/update_autonomous_database_details.rb +5 -3
  87. data/lib/oci/database/models/update_db_system_details.rb +2 -5
  88. data/lib/oci/dns/dns.rb +2 -0
  89. data/lib/oci/dns/dns_client.rb +138 -1
  90. data/lib/oci/dns/models/change_steering_policy_compartment_details.rb +155 -0
  91. data/lib/oci/dns/models/change_zone_compartment_details.rb +155 -0
  92. data/lib/oci/events/events.rb +34 -0
  93. data/lib/oci/events/events_client.rb +537 -0
  94. data/lib/oci/events/events_client_composite_operations.rb +145 -0
  95. data/lib/oci/events/models/action.rb +275 -0
  96. data/lib/oci/events/models/action_details.rb +222 -0
  97. data/lib/oci/events/models/action_details_list.rb +150 -0
  98. data/lib/oci/events/models/action_list.rb +151 -0
  99. data/lib/oci/events/models/change_rule_compartment_details.rb +156 -0
  100. data/lib/oci/events/models/create_faa_s_action_details.rb +170 -0
  101. data/lib/oci/events/models/create_notification_service_action_details.rb +170 -0
  102. data/lib/oci/events/models/create_rule_details.rb +284 -0
  103. data/lib/oci/events/models/create_streaming_service_action_details.rb +170 -0
  104. data/lib/oci/events/models/faa_s_action.rb +178 -0
  105. data/lib/oci/events/models/notification_service_action.rb +179 -0
  106. data/lib/oci/events/models/rule.rb +372 -0
  107. data/lib/oci/events/models/rule_summary.rb +321 -0
  108. data/lib/oci/events/models/streaming_service_action.rb +178 -0
  109. data/lib/oci/events/models/update_rule_details.rb +266 -0
  110. data/lib/oci/events/util.rb +2 -0
  111. data/lib/oci/functions/functions.rb +29 -0
  112. data/lib/oci/functions/functions_invoke_client.rb +237 -0
  113. data/lib/oci/functions/functions_invoke_client_composite_operations.rb +24 -0
  114. data/lib/oci/functions/functions_management_client.rb +851 -0
  115. data/lib/oci/functions/functions_management_client_composite_operations.rb +266 -0
  116. data/lib/oci/functions/models/application.rb +322 -0
  117. data/lib/oci/functions/models/application_summary.rb +281 -0
  118. data/lib/oci/functions/models/change_application_compartment_details.rb +156 -0
  119. data/lib/oci/functions/models/create_application_details.rb +236 -0
  120. data/lib/oci/functions/models/create_function_details.rb +280 -0
  121. data/lib/oci/functions/models/function.rb +397 -0
  122. data/lib/oci/functions/models/function_summary.rb +381 -0
  123. data/lib/oci/functions/models/update_application_details.rb +191 -0
  124. data/lib/oci/functions/models/update_function_details.rb +250 -0
  125. data/lib/oci/functions/util.rb +2 -0
  126. data/lib/oci/healthchecks/health_checks_client.rb +147 -1
  127. data/lib/oci/healthchecks/healthchecks.rb +2 -0
  128. data/lib/oci/healthchecks/models/change_http_monitor_compartment_details.rb +155 -0
  129. data/lib/oci/healthchecks/models/change_ping_monitor_compartment_details.rb +155 -0
  130. data/lib/oci/healthchecks/models/create_http_monitor_details.rb +2 -1
  131. data/lib/oci/healthchecks/models/create_on_demand_http_probe_details.rb +2 -1
  132. data/lib/oci/healthchecks/models/create_on_demand_ping_probe_details.rb +2 -1
  133. data/lib/oci/healthchecks/models/create_ping_monitor_details.rb +2 -1
  134. data/lib/oci/healthchecks/models/http_monitor.rb +2 -0
  135. data/lib/oci/healthchecks/models/http_probe.rb +2 -0
  136. data/lib/oci/healthchecks/models/ping_monitor.rb +2 -0
  137. data/lib/oci/healthchecks/models/ping_probe.rb +2 -0
  138. data/lib/oci/healthchecks/models/update_http_monitor_details.rb +2 -0
  139. data/lib/oci/healthchecks/models/update_ping_monitor_details.rb +2 -0
  140. data/lib/oci/identity/identity.rb +1 -0
  141. data/lib/oci/identity/identity_client.rb +70 -0
  142. data/lib/oci/identity/identity_client_composite_operations.rb +50 -0
  143. data/lib/oci/identity/models/move_compartment_details.rb +155 -0
  144. data/lib/oci/key_management/key_management.rb +2 -0
  145. data/lib/oci/key_management/kms_management_client.rb +73 -0
  146. data/lib/oci/key_management/kms_vault_client.rb +73 -0
  147. data/lib/oci/key_management/models/change_key_compartment_details.rb +153 -0
  148. data/lib/oci/key_management/models/change_vault_compartment_details.rb +153 -0
  149. data/lib/oci/key_management/models/key.rb +1 -0
  150. data/lib/oci/key_management/models/key_summary.rb +1 -0
  151. data/lib/oci/key_management/models/vault.rb +1 -0
  152. data/lib/oci/key_management/models/vault_summary.rb +1 -0
  153. data/lib/oci/limits/limits.rb +23 -0
  154. data/lib/oci/limits/models/create_quota_details.rb +220 -0
  155. data/lib/oci/limits/models/quota.rb +287 -0
  156. data/lib/oci/limits/models/quota_summary.rb +273 -0
  157. data/lib/oci/limits/models/update_quota_details.rb +194 -0
  158. data/lib/oci/limits/quotas_client.rb +439 -0
  159. data/lib/oci/limits/quotas_client_composite_operations.rb +143 -0
  160. data/lib/oci/limits/util.rb +2 -0
  161. data/lib/oci/load_balancer/load_balancer.rb +9 -0
  162. data/lib/oci/load_balancer/load_balancer_client.rb +139 -0
  163. data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
  164. data/lib/oci/load_balancer/models/allow_rule.rb +181 -0
  165. data/lib/oci/load_balancer/models/backend_set.rb +21 -4
  166. data/lib/oci/load_balancer/models/backend_set_details.rb +21 -4
  167. data/lib/oci/load_balancer/models/change_load_balancer_compartment_details.rb +156 -0
  168. data/lib/oci/load_balancer/models/control_access_using_http_methods_rule.rb +205 -0
  169. data/lib/oci/load_balancer/models/create_backend_set_details.rb +21 -4
  170. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +37 -1
  171. data/lib/oci/load_balancer/models/lb_cookie_session_persistence_configuration_details.rb +334 -0
  172. data/lib/oci/load_balancer/models/listener_rule_summary.rb +166 -0
  173. data/lib/oci/load_balancer/models/rule.rb +4 -0
  174. data/lib/oci/load_balancer/models/rule_condition.rb +192 -0
  175. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +6 -0
  176. data/lib/oci/load_balancer/models/source_ip_address_condition.rb +167 -0
  177. data/lib/oci/load_balancer/models/source_vcn_id_condition.rb +169 -0
  178. data/lib/oci/load_balancer/models/source_vcn_ip_address_condition.rb +171 -0
  179. data/lib/oci/load_balancer/models/update_backend_set_details.rb +21 -4
  180. data/lib/oci/monitoring/models/alarm.rb +4 -3
  181. data/lib/oci/monitoring/models/alarm_summary.rb +4 -3
  182. data/lib/oci/monitoring/models/change_alarm_compartment_details.rb +155 -0
  183. data/lib/oci/monitoring/models/create_alarm_details.rb +4 -3
  184. data/lib/oci/monitoring/models/datapoint.rb +1 -1
  185. data/lib/oci/monitoring/models/list_metrics_details.rb +4 -4
  186. data/lib/oci/monitoring/models/metric_data.rb +14 -0
  187. data/lib/oci/monitoring/models/metric_data_details.rb +6 -4
  188. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +3 -0
  189. data/lib/oci/monitoring/models/update_alarm_details.rb +4 -3
  190. data/lib/oci/monitoring/monitoring.rb +1 -0
  191. data/lib/oci/monitoring/monitoring_client.rb +140 -5
  192. data/lib/oci/ons/models/backoff_retry_policy.rb +2 -2
  193. data/lib/oci/ons/models/change_compartment_details.rb +156 -0
  194. data/lib/oci/ons/models/confirmation_result.rb +5 -6
  195. data/lib/oci/ons/models/create_topic_details.rb +1 -1
  196. data/lib/oci/ons/models/notification_topic.rb +2 -2
  197. data/lib/oci/ons/models/notification_topic_summary.rb +2 -2
  198. data/lib/oci/ons/models/subscription.rb +47 -4
  199. data/lib/oci/ons/models/subscription_summary.rb +19 -3
  200. data/lib/oci/ons/notification_control_plane_client.rb +95 -8
  201. data/lib/oci/ons/notification_data_plane_client.rb +109 -8
  202. data/lib/oci/ons/ons.rb +1 -0
  203. data/lib/oci/regions.rb +3 -0
  204. data/lib/oci/streaming/models/change_stream_compartment_details.rb +155 -0
  205. data/lib/oci/streaming/stream_admin_client.rb +58 -0
  206. data/lib/oci/streaming/streaming.rb +1 -0
  207. data/lib/oci/version.rb +1 -1
  208. data/lib/oci/waas/models/access_rule_criteria.rb +14 -2
  209. data/lib/oci/waas/models/change_certificate_compartment_details.rb +154 -0
  210. data/lib/oci/waas/models/change_waas_policy_compartment_details.rb +154 -0
  211. data/lib/oci/waas/models/create_certificate_details.rb +2 -2
  212. data/lib/oci/waas/models/protection_rule_exclusion.rb +16 -1
  213. data/lib/oci/waas/models/protection_settings.rb +9 -5
  214. data/lib/oci/waas/models/waas_policy.rb +1 -1
  215. data/lib/oci/waas/models/waf_config_details.rb +8 -8
  216. data/lib/oci/waas/models/waf_log.rb +40 -19
  217. data/lib/oci/waas/waas.rb +2 -0
  218. data/lib/oci/waas/waas_client.rb +155 -27
  219. data/lib/oci/work_requests/models/work_request.rb +14 -8
  220. data/lib/oci/work_requests/models/work_request_error.rb +3 -3
  221. data/lib/oci/work_requests/models/work_request_log_entry.rb +2 -2
  222. data/lib/oci/work_requests/models/work_request_resource.rb +9 -7
  223. data/lib/oci/work_requests/models/work_request_summary.rb +12 -6
  224. data/lib/oci/work_requests/work_request_client.rb +33 -16
  225. metadata +81 -2
@@ -0,0 +1,237 @@
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
+ # API for the Functions service.
9
+ class Functions::FunctionsInvokeClient
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 FunctionsInvokeClient.
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 + '/20181201'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "FunctionsInvokeClient 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://functions.{region}.{secondLevelDomain}') + '/20181201'
98
+ logger.info "FunctionsInvokeClient 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
+
110
+
111
+ # Invokes a function
112
+ # @param [String] function_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function.
113
+ #
114
+ # @param [Hash] opts the optional parameters
115
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
116
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
117
+ # @option opts [OCI::Functions::Models::Stream] :invoke_function_body The body of the function invocation.
118
+ # Note: The maximum size of the request is limited. This limit is currently 6MB and the endpoint will not accept requests that are bigger than this limit.
119
+ #
120
+ # @option opts [String] :fn_intent An optional intent header that indicates to the FDK the way the event should be interpreted. E.g. 'httprequest', 'cloudevent'.
121
+ #
122
+ # Allowed values are: httprequest, cloudevent
123
+ # @option opts [String] :fn_invoke_type Indicates whether the functions platform should execute the request directly and return the result ('sync') or
124
+ # whether the platform should enqueue the request for later processing and acknowledge that it has been processed ('detached').
125
+ # (default to sync)
126
+ # Allowed values are: detached, sync
127
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
128
+ # particular request, please provide the request ID.
129
+ #
130
+ # @option opts [String, IO] :response_target Streaming http body into a file (specified by file name or File object) or IO object if the block is not given
131
+ # @option [Block] &block Streaming http body to the block
132
+ # @return [Response] A Response object with data of type String if response_target and block are not given, otherwise with nil data
133
+ def invoke_function(function_id, opts = {}, &block)
134
+ logger.debug 'Calling operation FunctionsInvokeClient#invoke_function.' if logger
135
+
136
+ raise "Missing the required parameter 'function_id' when calling invoke_function." if function_id.nil?
137
+
138
+ if opts[:fn_intent] && !%w[httprequest cloudevent].include?(opts[:fn_intent])
139
+ raise 'Invalid value for "fn_intent", must be one of httprequest, cloudevent.'
140
+ end
141
+
142
+ if opts[:fn_invoke_type] && !%w[detached sync].include?(opts[:fn_invoke_type])
143
+ raise 'Invalid value for "fn_invoke_type", must be one of detached, sync.'
144
+ end
145
+ raise "Parameter value for 'function_id' must not be blank" if OCI::Internal::Util.blank_string?(function_id)
146
+
147
+ path = '/functions/{functionId}/actions/invoke'.sub('{functionId}', function_id.to_s)
148
+ operation_signing_strategy = :standard
149
+
150
+ # rubocop:disable Style/NegatedIf
151
+ # Query Params
152
+ query_params = {}
153
+
154
+ # Header Params
155
+ header_params = {}
156
+ header_params[:accept] = opts[:accept] if opts[:accept]
157
+ header_params[:accept] ||= '*/*'
158
+ header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding]
159
+ header_params[:'fn-intent'] = opts[:fn_intent] if opts[:fn_intent]
160
+ header_params[:'fn-invoke-type'] = opts[:fn_invoke_type] if opts[:fn_invoke_type]
161
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
162
+ # rubocop:enable Style/NegatedIf
163
+ header_params[:'content-type'] ||= 'application/octet-stream'
164
+
165
+ post_body = @api_client.object_to_http_body(opts[:invoke_function_body])
166
+
167
+ # rubocop:disable Metrics/BlockLength
168
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsInvokeClient#invoke_function') do
169
+ if !block.nil?
170
+ @api_client.call_api(
171
+ :POST,
172
+ path,
173
+ endpoint,
174
+ header_params: header_params,
175
+ query_params: query_params,
176
+ operation_signing_strategy: operation_signing_strategy,
177
+ body: post_body,
178
+ return_type: 'Stream',
179
+ &block
180
+ )
181
+ elsif opts[:response_target]
182
+ if opts[:response_target].respond_to? :write
183
+ @api_client.call_api(
184
+ :POST,
185
+ path,
186
+ endpoint,
187
+ header_params: header_params,
188
+ query_params: query_params,
189
+ operation_signing_strategy: operation_signing_strategy,
190
+ body: post_body,
191
+ return_type: 'Stream',
192
+ &proc { |chunk, _response| opts[:response_target].write(chunk) }
193
+ )
194
+ elsif opts[:response_target].is_a?(String)
195
+ File.open(opts[:response_target], 'wb') do |output|
196
+ return @api_client.call_api(
197
+ :POST,
198
+ path,
199
+ endpoint,
200
+ header_params: header_params,
201
+ query_params: query_params,
202
+ operation_signing_strategy: operation_signing_strategy,
203
+ body: post_body,
204
+ return_type: 'Stream',
205
+ &proc { |chunk, _response| output.write(chunk) }
206
+ )
207
+ end
208
+ end
209
+ else
210
+ @api_client.call_api(
211
+ :POST,
212
+ path,
213
+ endpoint,
214
+ header_params: header_params,
215
+ query_params: query_params,
216
+ operation_signing_strategy: operation_signing_strategy,
217
+ body: post_body,
218
+ return_type: 'String'
219
+ )
220
+ end
221
+ end
222
+ # rubocop:enable Metrics/BlockLength
223
+ end
224
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
225
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
226
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
227
+
228
+ private
229
+
230
+ def applicable_retry_config(opts = {})
231
+ return @retry_config unless opts.key?(:retry_config)
232
+
233
+ opts[:retry_config]
234
+ end
235
+ end
236
+ end
237
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,24 @@
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::Functions::FunctionsInvokeClient} 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 Functions::FunctionsInvokeClientCompositeOperations
10
+ # The {OCI::Functions::FunctionsInvokeClient} used to communicate with the service_client
11
+ #
12
+ # @return [OCI::Functions::FunctionsInvokeClient]
13
+ attr_reader :service_client
14
+
15
+ # Initializes a new FunctionsInvokeClientCompositeOperations
16
+ #
17
+ # @param [OCI::Functions::FunctionsInvokeClient] service_client The client used to communicate with the service.
18
+ # Defaults to a new service client created via {OCI::Functions::FunctionsInvokeClient#initialize} with no arguments
19
+ def initialize(service_client = OCI::Functions::FunctionsInvokeClient.new)
20
+ @service_client = service_client
21
+ end
22
+ end
23
+ end
24
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,851 @@
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
+ # API for the Functions service.
9
+ class Functions::FunctionsManagementClient
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 FunctionsManagementClient.
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 + '/20181201'
80
+ else
81
+ region ||= config.region
82
+ region ||= signer.region if signer.respond_to?(:region)
83
+ self.region = region
84
+ end
85
+ logger.info "FunctionsManagementClient 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://functions.{region}.{secondLevelDomain}') + '/20181201'
98
+ logger.info "FunctionsManagementClient 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
+
110
+
111
+ # Moves an application into a different compartment within the same tenancy.
112
+ # For information about moving resources between compartments, see [Moving Resources Between Compartments](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
113
+ #
114
+ # @param [String] application_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application.
115
+ #
116
+ # @param [OCI::Functions::Models::ChangeApplicationCompartmentDetails] change_application_compartment_details Properties to change the compartment of an application.
117
+ # @param [Hash] opts the optional parameters
118
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
119
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
120
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
121
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
122
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
123
+ #
124
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
125
+ # particular request, please provide the request ID.
126
+ #
127
+ # @return [Response] A Response object with data of type nil
128
+ def change_application_compartment(application_id, change_application_compartment_details, opts = {})
129
+ logger.debug 'Calling operation FunctionsManagementClient#change_application_compartment.' if logger
130
+
131
+ raise "Missing the required parameter 'application_id' when calling change_application_compartment." if application_id.nil?
132
+ raise "Missing the required parameter 'change_application_compartment_details' when calling change_application_compartment." if change_application_compartment_details.nil?
133
+ raise "Parameter value for 'application_id' must not be blank" if OCI::Internal::Util.blank_string?(application_id)
134
+
135
+ path = '/applications/{applicationId}/actions/changeCompartment'.sub('{applicationId}', application_id.to_s)
136
+ operation_signing_strategy = :standard
137
+
138
+ # rubocop:disable Style/NegatedIf
139
+ # Query Params
140
+ query_params = {}
141
+
142
+ # Header Params
143
+ header_params = {}
144
+ header_params[:accept] = 'application/json'
145
+ header_params[:'content-type'] = 'application/json'
146
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
147
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
148
+ # rubocop:enable Style/NegatedIf
149
+
150
+ post_body = @api_client.object_to_http_body(change_application_compartment_details)
151
+
152
+ # rubocop:disable Metrics/BlockLength
153
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#change_application_compartment') do
154
+ @api_client.call_api(
155
+ :POST,
156
+ path,
157
+ endpoint,
158
+ header_params: header_params,
159
+ query_params: query_params,
160
+ operation_signing_strategy: operation_signing_strategy,
161
+ body: post_body
162
+ )
163
+ end
164
+ # rubocop:enable Metrics/BlockLength
165
+ end
166
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
167
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
168
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
169
+
170
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
171
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
172
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
173
+
174
+
175
+ # Creates a new application.
176
+ # @param [OCI::Functions::Models::CreateApplicationDetails] create_application_details Specification of the application to create
177
+ # @param [Hash] opts the optional parameters
178
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
179
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
180
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
181
+ # particular request, please provide the request ID.
182
+ #
183
+ # @return [Response] A Response object with data of type {OCI::Functions::Models::Application Application}
184
+ def create_application(create_application_details, opts = {})
185
+ logger.debug 'Calling operation FunctionsManagementClient#create_application.' if logger
186
+
187
+ raise "Missing the required parameter 'create_application_details' when calling create_application." if create_application_details.nil?
188
+
189
+ path = '/applications'
190
+ operation_signing_strategy = :standard
191
+
192
+ # rubocop:disable Style/NegatedIf
193
+ # Query Params
194
+ query_params = {}
195
+
196
+ # Header Params
197
+ header_params = {}
198
+ header_params[:accept] = 'application/json'
199
+ header_params[:'content-type'] = 'application/json'
200
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
201
+ # rubocop:enable Style/NegatedIf
202
+
203
+ post_body = @api_client.object_to_http_body(create_application_details)
204
+
205
+ # rubocop:disable Metrics/BlockLength
206
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#create_application') do
207
+ @api_client.call_api(
208
+ :POST,
209
+ path,
210
+ endpoint,
211
+ header_params: header_params,
212
+ query_params: query_params,
213
+ operation_signing_strategy: operation_signing_strategy,
214
+ body: post_body,
215
+ return_type: 'OCI::Functions::Models::Application'
216
+ )
217
+ end
218
+ # rubocop:enable Metrics/BlockLength
219
+ end
220
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
221
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
222
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
223
+
224
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
225
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
226
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
227
+
228
+
229
+ # Creates a new function.
230
+ # @param [OCI::Functions::Models::CreateFunctionDetails] create_function_details Specification of the function to create
231
+ # @param [Hash] opts the optional parameters
232
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
233
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
234
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
235
+ # particular request, please provide the request ID.
236
+ #
237
+ # @return [Response] A Response object with data of type {OCI::Functions::Models::Function Function}
238
+ def create_function(create_function_details, opts = {})
239
+ logger.debug 'Calling operation FunctionsManagementClient#create_function.' if logger
240
+
241
+ raise "Missing the required parameter 'create_function_details' when calling create_function." if create_function_details.nil?
242
+
243
+ path = '/functions'
244
+ operation_signing_strategy = :standard
245
+
246
+ # rubocop:disable Style/NegatedIf
247
+ # Query Params
248
+ query_params = {}
249
+
250
+ # Header Params
251
+ header_params = {}
252
+ header_params[:accept] = 'application/json'
253
+ header_params[:'content-type'] = 'application/json'
254
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
255
+ # rubocop:enable Style/NegatedIf
256
+
257
+ post_body = @api_client.object_to_http_body(create_function_details)
258
+
259
+ # rubocop:disable Metrics/BlockLength
260
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#create_function') do
261
+ @api_client.call_api(
262
+ :POST,
263
+ path,
264
+ endpoint,
265
+ header_params: header_params,
266
+ query_params: query_params,
267
+ operation_signing_strategy: operation_signing_strategy,
268
+ body: post_body,
269
+ return_type: 'OCI::Functions::Models::Function'
270
+ )
271
+ end
272
+ # rubocop:enable Metrics/BlockLength
273
+ end
274
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
275
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
276
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
277
+
278
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
279
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
280
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
281
+
282
+
283
+ # Deletes an application.
284
+ # @param [String] application_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application.
285
+ #
286
+ # @param [Hash] opts the optional parameters
287
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
288
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
289
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
290
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
291
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
292
+ #
293
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
294
+ # particular request, please provide the request ID.
295
+ #
296
+ # @return [Response] A Response object with data of type nil
297
+ def delete_application(application_id, opts = {})
298
+ logger.debug 'Calling operation FunctionsManagementClient#delete_application.' if logger
299
+
300
+ raise "Missing the required parameter 'application_id' when calling delete_application." if application_id.nil?
301
+ raise "Parameter value for 'application_id' must not be blank" if OCI::Internal::Util.blank_string?(application_id)
302
+
303
+ path = '/applications/{applicationId}'.sub('{applicationId}', application_id.to_s)
304
+ operation_signing_strategy = :standard
305
+
306
+ # rubocop:disable Style/NegatedIf
307
+ # Query Params
308
+ query_params = {}
309
+
310
+ # Header Params
311
+ header_params = {}
312
+ header_params[:accept] = 'application/json'
313
+ header_params[:'content-type'] = 'application/json'
314
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
315
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
316
+ # rubocop:enable Style/NegatedIf
317
+
318
+ post_body = nil
319
+
320
+ # rubocop:disable Metrics/BlockLength
321
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#delete_application') do
322
+ @api_client.call_api(
323
+ :DELETE,
324
+ path,
325
+ endpoint,
326
+ header_params: header_params,
327
+ query_params: query_params,
328
+ operation_signing_strategy: operation_signing_strategy,
329
+ body: post_body
330
+ )
331
+ end
332
+ # rubocop:enable Metrics/BlockLength
333
+ end
334
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
335
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
336
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
337
+
338
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
339
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
340
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
341
+
342
+
343
+ # Deletes a function.
344
+ # @param [String] function_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function.
345
+ #
346
+ # @param [Hash] opts the optional parameters
347
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
348
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
349
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
350
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
351
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
352
+ #
353
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
354
+ # particular request, please provide the request ID.
355
+ #
356
+ # @return [Response] A Response object with data of type nil
357
+ def delete_function(function_id, opts = {})
358
+ logger.debug 'Calling operation FunctionsManagementClient#delete_function.' if logger
359
+
360
+ raise "Missing the required parameter 'function_id' when calling delete_function." if function_id.nil?
361
+ raise "Parameter value for 'function_id' must not be blank" if OCI::Internal::Util.blank_string?(function_id)
362
+
363
+ path = '/functions/{functionId}'.sub('{functionId}', function_id.to_s)
364
+ operation_signing_strategy = :standard
365
+
366
+ # rubocop:disable Style/NegatedIf
367
+ # Query Params
368
+ query_params = {}
369
+
370
+ # Header Params
371
+ header_params = {}
372
+ header_params[:accept] = 'application/json'
373
+ header_params[:'content-type'] = 'application/json'
374
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
375
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
376
+ # rubocop:enable Style/NegatedIf
377
+
378
+ post_body = nil
379
+
380
+ # rubocop:disable Metrics/BlockLength
381
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#delete_function') do
382
+ @api_client.call_api(
383
+ :DELETE,
384
+ path,
385
+ endpoint,
386
+ header_params: header_params,
387
+ query_params: query_params,
388
+ operation_signing_strategy: operation_signing_strategy,
389
+ body: post_body
390
+ )
391
+ end
392
+ # rubocop:enable Metrics/BlockLength
393
+ end
394
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
395
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
396
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
397
+
398
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
399
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
400
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
401
+
402
+
403
+ # Retrieves an application.
404
+ # @param [String] application_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application.
405
+ #
406
+ # @param [Hash] opts the optional parameters
407
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
408
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
409
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
410
+ # particular request, please provide the request ID.
411
+ #
412
+ # @return [Response] A Response object with data of type {OCI::Functions::Models::Application Application}
413
+ def get_application(application_id, opts = {})
414
+ logger.debug 'Calling operation FunctionsManagementClient#get_application.' if logger
415
+
416
+ raise "Missing the required parameter 'application_id' when calling get_application." if application_id.nil?
417
+ raise "Parameter value for 'application_id' must not be blank" if OCI::Internal::Util.blank_string?(application_id)
418
+
419
+ path = '/applications/{applicationId}'.sub('{applicationId}', application_id.to_s)
420
+ operation_signing_strategy = :standard
421
+
422
+ # rubocop:disable Style/NegatedIf
423
+ # Query Params
424
+ query_params = {}
425
+
426
+ # Header Params
427
+ header_params = {}
428
+ header_params[:accept] = 'application/json'
429
+ header_params[:'content-type'] = 'application/json'
430
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
431
+ # rubocop:enable Style/NegatedIf
432
+
433
+ post_body = nil
434
+
435
+ # rubocop:disable Metrics/BlockLength
436
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#get_application') do
437
+ @api_client.call_api(
438
+ :GET,
439
+ path,
440
+ endpoint,
441
+ header_params: header_params,
442
+ query_params: query_params,
443
+ operation_signing_strategy: operation_signing_strategy,
444
+ body: post_body,
445
+ return_type: 'OCI::Functions::Models::Application'
446
+ )
447
+ end
448
+ # rubocop:enable Metrics/BlockLength
449
+ end
450
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
451
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
452
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
453
+
454
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
455
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
456
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
457
+
458
+
459
+ # Retrieves a function.
460
+ # @param [String] function_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function.
461
+ #
462
+ # @param [Hash] opts the optional parameters
463
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
464
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
465
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
466
+ # particular request, please provide the request ID.
467
+ #
468
+ # @return [Response] A Response object with data of type {OCI::Functions::Models::Function Function}
469
+ def get_function(function_id, opts = {})
470
+ logger.debug 'Calling operation FunctionsManagementClient#get_function.' if logger
471
+
472
+ raise "Missing the required parameter 'function_id' when calling get_function." if function_id.nil?
473
+ raise "Parameter value for 'function_id' must not be blank" if OCI::Internal::Util.blank_string?(function_id)
474
+
475
+ path = '/functions/{functionId}'.sub('{functionId}', function_id.to_s)
476
+ operation_signing_strategy = :standard
477
+
478
+ # rubocop:disable Style/NegatedIf
479
+ # Query Params
480
+ query_params = {}
481
+
482
+ # Header Params
483
+ header_params = {}
484
+ header_params[:accept] = 'application/json'
485
+ header_params[:'content-type'] = 'application/json'
486
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
487
+ # rubocop:enable Style/NegatedIf
488
+
489
+ post_body = nil
490
+
491
+ # rubocop:disable Metrics/BlockLength
492
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#get_function') do
493
+ @api_client.call_api(
494
+ :GET,
495
+ path,
496
+ endpoint,
497
+ header_params: header_params,
498
+ query_params: query_params,
499
+ operation_signing_strategy: operation_signing_strategy,
500
+ body: post_body,
501
+ return_type: 'OCI::Functions::Models::Function'
502
+ )
503
+ end
504
+ # rubocop:enable Metrics/BlockLength
505
+ end
506
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
507
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
508
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
509
+
510
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
511
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
512
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
513
+
514
+
515
+ # Lists applications for a compartment.
516
+ # @param [String] compartment_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to which this resource belongs.
517
+ #
518
+ # @param [Hash] opts the optional parameters
519
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
520
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
521
+ # @option opts [Integer] :limit The maximum number of items to return. 1 is the minimum, 50 is the maximum.
522
+ #
523
+ # Default: 10
524
+ # (default to 5)
525
+ # @option opts [String] :page The pagination token for a list query returned by a previous operation
526
+ #
527
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
528
+ # particular request, please provide the request ID.
529
+ #
530
+ # @option opts [String] :lifecycle_state A filter to return only applications that match the lifecycle state in this parameter.
531
+ # Example: `Creating`
532
+ #
533
+ # @option opts [String] :display_name A filter to return only applications with display names that match the display name string. Matching is exact.
534
+ #
535
+ # @option opts [String] :id A filter to return only applications with the specfied OCID.
536
+ #
537
+ # @option opts [String] :sort_order Specifies sort order.
538
+ #
539
+ # * **ASC:** Ascending sort order.
540
+ # * **DESC:** Descending sort order.
541
+ # (default to ASC)
542
+ # Allowed values are: ASC, DESC
543
+ # @option opts [String] :sort_by Specifies the attribute with which to sort the rules.
544
+ #
545
+ # Default: `displayName`
546
+ #
547
+ # * **timeCreated:** Sorts by timeCreated.
548
+ # * **displayName:** Sorts by displayName.
549
+ # * **id:** Sorts by id.
550
+ # (default to displayName)
551
+ # Allowed values are: timeCreated, id, displayName
552
+ # @return [Response] A Response object with data of type Array<{OCI::Functions::Models::ApplicationSummary ApplicationSummary}>
553
+ def list_applications(compartment_id, opts = {})
554
+ logger.debug 'Calling operation FunctionsManagementClient#list_applications.' if logger
555
+
556
+ raise "Missing the required parameter 'compartment_id' when calling list_applications." if compartment_id.nil?
557
+
558
+ if opts[:lifecycle_state] && !OCI::Functions::Models::Application::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
559
+ raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Functions::Models::Application::LIFECYCLE_STATE_ENUM.'
560
+ end
561
+
562
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
563
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
564
+ end
565
+
566
+ if opts[:sort_by] && !%w[timeCreated id displayName].include?(opts[:sort_by])
567
+ raise 'Invalid value for "sort_by", must be one of timeCreated, id, displayName.'
568
+ end
569
+
570
+ path = '/applications'
571
+ operation_signing_strategy = :standard
572
+
573
+ # rubocop:disable Style/NegatedIf
574
+ # Query Params
575
+ query_params = {}
576
+ query_params[:compartmentId] = compartment_id
577
+ query_params[:limit] = opts[:limit] if opts[:limit]
578
+ query_params[:page] = opts[:page] if opts[:page]
579
+ query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
580
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
581
+ query_params[:id] = opts[:id] if opts[:id]
582
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
583
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
584
+
585
+ # Header Params
586
+ header_params = {}
587
+ header_params[:accept] = 'application/json'
588
+ header_params[:'content-type'] = 'application/json'
589
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
590
+ # rubocop:enable Style/NegatedIf
591
+
592
+ post_body = nil
593
+
594
+ # rubocop:disable Metrics/BlockLength
595
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#list_applications') do
596
+ @api_client.call_api(
597
+ :GET,
598
+ path,
599
+ endpoint,
600
+ header_params: header_params,
601
+ query_params: query_params,
602
+ operation_signing_strategy: operation_signing_strategy,
603
+ body: post_body,
604
+ return_type: 'Array<OCI::Functions::Models::ApplicationSummary>'
605
+ )
606
+ end
607
+ # rubocop:enable Metrics/BlockLength
608
+ end
609
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
610
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
611
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
612
+
613
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
614
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
615
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
616
+
617
+
618
+ # Lists functions for an application.
619
+ # @param [String] application_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the application to which this function belongs.
620
+ #
621
+ # @param [Hash] opts the optional parameters
622
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
623
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
624
+ # @option opts [Integer] :limit The maximum number of items to return. 1 is the minimum, 50 is the maximum.
625
+ #
626
+ # Default: 10
627
+ # (default to 5)
628
+ # @option opts [String] :page The pagination token for a list query returned by a previous operation
629
+ #
630
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
631
+ # particular request, please provide the request ID.
632
+ #
633
+ # @option opts [String] :lifecycle_state A filter to return only functions that match the lifecycle state in this parameter.
634
+ # Example: `Creating`
635
+ #
636
+ # @option opts [String] :display_name A filter to return only functions with display names that match the display name string. Matching is exact.
637
+ #
638
+ # @option opts [String] :id A filter to return only functions with the specified OCID.
639
+ #
640
+ # @option opts [String] :sort_order Specifies sort order.
641
+ #
642
+ # * **ASC:** Ascending sort order.
643
+ # * **DESC:** Descending sort order.
644
+ # (default to ASC)
645
+ # Allowed values are: ASC, DESC
646
+ # @option opts [String] :sort_by Specifies the attribute with which to sort the rules.
647
+ #
648
+ # Default: `displayName`
649
+ #
650
+ # * **timeCreated:** Sorts by timeCreated.
651
+ # * **displayName:** Sorts by displayName.
652
+ # * **id:** Sorts by id.
653
+ # (default to displayName)
654
+ # Allowed values are: timeCreated, id, displayName
655
+ # @return [Response] A Response object with data of type Array<{OCI::Functions::Models::FunctionSummary FunctionSummary}>
656
+ def list_functions(application_id, opts = {})
657
+ logger.debug 'Calling operation FunctionsManagementClient#list_functions.' if logger
658
+
659
+ raise "Missing the required parameter 'application_id' when calling list_functions." if application_id.nil?
660
+
661
+ if opts[:lifecycle_state] && !OCI::Functions::Models::Function::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
662
+ raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Functions::Models::Function::LIFECYCLE_STATE_ENUM.'
663
+ end
664
+
665
+ if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
666
+ raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
667
+ end
668
+
669
+ if opts[:sort_by] && !%w[timeCreated id displayName].include?(opts[:sort_by])
670
+ raise 'Invalid value for "sort_by", must be one of timeCreated, id, displayName.'
671
+ end
672
+
673
+ path = '/functions'
674
+ operation_signing_strategy = :standard
675
+
676
+ # rubocop:disable Style/NegatedIf
677
+ # Query Params
678
+ query_params = {}
679
+ query_params[:applicationId] = application_id
680
+ query_params[:limit] = opts[:limit] if opts[:limit]
681
+ query_params[:page] = opts[:page] if opts[:page]
682
+ query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
683
+ query_params[:displayName] = opts[:display_name] if opts[:display_name]
684
+ query_params[:id] = opts[:id] if opts[:id]
685
+ query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
686
+ query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
687
+
688
+ # Header Params
689
+ header_params = {}
690
+ header_params[:accept] = 'application/json'
691
+ header_params[:'content-type'] = 'application/json'
692
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
693
+ # rubocop:enable Style/NegatedIf
694
+
695
+ post_body = nil
696
+
697
+ # rubocop:disable Metrics/BlockLength
698
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#list_functions') do
699
+ @api_client.call_api(
700
+ :GET,
701
+ path,
702
+ endpoint,
703
+ header_params: header_params,
704
+ query_params: query_params,
705
+ operation_signing_strategy: operation_signing_strategy,
706
+ body: post_body,
707
+ return_type: 'Array<OCI::Functions::Models::FunctionSummary>'
708
+ )
709
+ end
710
+ # rubocop:enable Metrics/BlockLength
711
+ end
712
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
713
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
714
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
715
+
716
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
717
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
718
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
719
+
720
+
721
+ # Modifies an application
722
+ # @param [String] application_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this application.
723
+ #
724
+ # @param [OCI::Functions::Models::UpdateApplicationDetails] update_application_details The new application spec to apply
725
+ # @param [Hash] opts the optional parameters
726
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
727
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
728
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
729
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
730
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
731
+ #
732
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
733
+ # particular request, please provide the request ID.
734
+ #
735
+ # @return [Response] A Response object with data of type {OCI::Functions::Models::Application Application}
736
+ def update_application(application_id, update_application_details, opts = {})
737
+ logger.debug 'Calling operation FunctionsManagementClient#update_application.' if logger
738
+
739
+ raise "Missing the required parameter 'application_id' when calling update_application." if application_id.nil?
740
+ raise "Missing the required parameter 'update_application_details' when calling update_application." if update_application_details.nil?
741
+ raise "Parameter value for 'application_id' must not be blank" if OCI::Internal::Util.blank_string?(application_id)
742
+
743
+ path = '/applications/{applicationId}'.sub('{applicationId}', application_id.to_s)
744
+ operation_signing_strategy = :standard
745
+
746
+ # rubocop:disable Style/NegatedIf
747
+ # Query Params
748
+ query_params = {}
749
+
750
+ # Header Params
751
+ header_params = {}
752
+ header_params[:accept] = 'application/json'
753
+ header_params[:'content-type'] = 'application/json'
754
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
755
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
756
+ # rubocop:enable Style/NegatedIf
757
+
758
+ post_body = @api_client.object_to_http_body(update_application_details)
759
+
760
+ # rubocop:disable Metrics/BlockLength
761
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#update_application') do
762
+ @api_client.call_api(
763
+ :PUT,
764
+ path,
765
+ endpoint,
766
+ header_params: header_params,
767
+ query_params: query_params,
768
+ operation_signing_strategy: operation_signing_strategy,
769
+ body: post_body,
770
+ return_type: 'OCI::Functions::Models::Application'
771
+ )
772
+ end
773
+ # rubocop:enable Metrics/BlockLength
774
+ end
775
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
776
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
777
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
778
+
779
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
780
+ # rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
781
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines
782
+
783
+
784
+ # Modifies a function
785
+ # @param [String] function_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this function.
786
+ #
787
+ # @param [OCI::Functions::Models::UpdateFunctionDetails] update_function_details The new function spec to apply
788
+ # @param [Hash] opts the optional parameters
789
+ # @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
790
+ # retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
791
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
792
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
793
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
794
+ #
795
+ # @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
796
+ # particular request, please provide the request ID.
797
+ #
798
+ # @return [Response] A Response object with data of type {OCI::Functions::Models::Function Function}
799
+ def update_function(function_id, update_function_details, opts = {})
800
+ logger.debug 'Calling operation FunctionsManagementClient#update_function.' if logger
801
+
802
+ raise "Missing the required parameter 'function_id' when calling update_function." if function_id.nil?
803
+ raise "Missing the required parameter 'update_function_details' when calling update_function." if update_function_details.nil?
804
+ raise "Parameter value for 'function_id' must not be blank" if OCI::Internal::Util.blank_string?(function_id)
805
+
806
+ path = '/functions/{functionId}'.sub('{functionId}', function_id.to_s)
807
+ operation_signing_strategy = :standard
808
+
809
+ # rubocop:disable Style/NegatedIf
810
+ # Query Params
811
+ query_params = {}
812
+
813
+ # Header Params
814
+ header_params = {}
815
+ header_params[:accept] = 'application/json'
816
+ header_params[:'content-type'] = 'application/json'
817
+ header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
818
+ header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
819
+ # rubocop:enable Style/NegatedIf
820
+
821
+ post_body = @api_client.object_to_http_body(update_function_details)
822
+
823
+ # rubocop:disable Metrics/BlockLength
824
+ OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'FunctionsManagementClient#update_function') do
825
+ @api_client.call_api(
826
+ :PUT,
827
+ path,
828
+ endpoint,
829
+ header_params: header_params,
830
+ query_params: query_params,
831
+ operation_signing_strategy: operation_signing_strategy,
832
+ body: post_body,
833
+ return_type: 'OCI::Functions::Models::Function'
834
+ )
835
+ end
836
+ # rubocop:enable Metrics/BlockLength
837
+ end
838
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
839
+ # rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
840
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines
841
+
842
+ private
843
+
844
+ def applicable_retry_config(opts = {})
845
+ return @retry_config unless opts.key?(:retry_config)
846
+
847
+ opts[:retry_config]
848
+ end
849
+ end
850
+ end
851
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength