oci 2.5.0 → 2.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/oci.rb +4 -0
  4. data/lib/oci/auth/federation_client.rb +4 -4
  5. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +22 -16
  6. data/lib/oci/autoscaling/auto_scaling_client.rb +774 -0
  7. data/lib/oci/autoscaling/auto_scaling_client_composite_operations.rb +24 -0
  8. data/lib/oci/autoscaling/autoscaling.rb +38 -0
  9. data/lib/oci/autoscaling/models/action.rb +182 -0
  10. data/lib/oci/autoscaling/models/auto_scaling_configuration.rb +282 -0
  11. data/lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb +234 -0
  12. data/lib/oci/autoscaling/models/auto_scaling_policy.rb +222 -0
  13. data/lib/oci/autoscaling/models/auto_scaling_policy_summary.rb +179 -0
  14. data/lib/oci/autoscaling/models/capacity.rb +170 -0
  15. data/lib/oci/autoscaling/models/condition.rb +186 -0
  16. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +256 -0
  17. data/lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb +196 -0
  18. data/lib/oci/autoscaling/models/create_condition_details.rb +176 -0
  19. data/lib/oci/autoscaling/models/create_threshold_policy_details.rb +166 -0
  20. data/lib/oci/autoscaling/models/instance_pool_resource.rb +148 -0
  21. data/lib/oci/autoscaling/models/metric.rb +186 -0
  22. data/lib/oci/autoscaling/models/resource.rb +177 -0
  23. data/lib/oci/autoscaling/models/threshold.rb +188 -0
  24. data/lib/oci/autoscaling/models/threshold_policy.rb +173 -0
  25. data/lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb +219 -0
  26. data/lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb +194 -0
  27. data/lib/oci/autoscaling/models/update_condition_details.rb +176 -0
  28. data/lib/oci/autoscaling/models/update_threshold_policy_details.rb +164 -0
  29. data/lib/oci/autoscaling/util.rb +2 -0
  30. data/lib/oci/core/blockstorage_client.rb +1 -1
  31. data/lib/oci/core/compute_client.rb +1 -1
  32. data/lib/oci/core/compute_management_client.rb +135 -1
  33. data/lib/oci/core/compute_management_client_composite_operations.rb +80 -0
  34. data/lib/oci/core/core.rb +8 -0
  35. data/lib/oci/core/models/attach_load_balancer_details.rb +191 -0
  36. data/lib/oci/core/models/create_instance_pool_details.rb +19 -4
  37. data/lib/oci/core/models/detach_load_balancer_details.rb +167 -0
  38. data/lib/oci/core/models/image.rb +14 -1
  39. data/lib/oci/core/models/instance.rb +18 -2
  40. data/lib/oci/core/models/instance_agent_config.rb +154 -0
  41. data/lib/oci/core/models/instance_agent_features.rb +154 -0
  42. data/lib/oci/core/models/instance_pool.rb +19 -4
  43. data/lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb +219 -0
  44. data/lib/oci/core/models/instance_pool_load_balancer_attachment.rb +253 -0
  45. data/lib/oci/core/models/instance_summary.rb +19 -4
  46. data/lib/oci/core/models/launch_instance_agent_config_details.rb +155 -0
  47. data/lib/oci/core/models/launch_instance_details.rb +14 -1
  48. data/lib/oci/core/models/update_instance_agent_config_details.rb +154 -0
  49. data/lib/oci/core/models/update_instance_details.rb +16 -1
  50. data/lib/oci/core/virtual_network_client.rb +1 -1
  51. data/lib/oci/database/database_client.rb +12 -14
  52. data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +3 -1
  53. data/lib/oci/database/models/autonomous_database_connection_strings.rb +3 -1
  54. data/lib/oci/database/models/create_data_guard_association_details.rb +2 -7
  55. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +5 -1
  56. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +4 -1
  57. data/lib/oci/database/models/database_summary.rb +1 -1
  58. data/lib/oci/database/models/db_node.rb +15 -1
  59. data/lib/oci/database/models/db_node_summary.rb +15 -1
  60. data/lib/oci/database/models/db_system.rb +15 -1
  61. data/lib/oci/database/models/db_system_summary.rb +15 -1
  62. data/lib/oci/database/models/db_version_summary.rb +1 -1
  63. data/lib/oci/database/models/launch_db_system_base.rb +33 -2
  64. data/lib/oci/database/models/launch_db_system_details.rb +5 -1
  65. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +5 -1
  66. data/lib/oci/database/models/update_db_system_details.rb +1 -1
  67. data/lib/oci/identity/identity.rb +4 -0
  68. data/lib/oci/identity/identity_client.rb +468 -12
  69. data/lib/oci/identity/identity_client_composite_operations.rb +79 -0
  70. data/lib/oci/identity/models/change_tag_namespace_compartment_detail.rb +154 -0
  71. data/lib/oci/identity/models/create_identity_provider_details.rb +2 -1
  72. data/lib/oci/identity/models/mfa_totp_device.rb +279 -0
  73. data/lib/oci/identity/models/mfa_totp_device_summary.rb +267 -0
  74. data/lib/oci/identity/models/mfa_totp_token.rb +155 -0
  75. data/lib/oci/identity/models/tag_namespace_summary.rb +1 -1
  76. data/lib/oci/identity/models/user.rb +18 -4
  77. data/lib/oci/monitoring/models/aggregated_datapoint.rb +166 -0
  78. data/lib/oci/monitoring/models/alarm.rb +538 -0
  79. data/lib/oci/monitoring/models/alarm_history_collection.rb +183 -0
  80. data/lib/oci/monitoring/models/alarm_history_entry.rb +187 -0
  81. data/lib/oci/monitoring/models/alarm_status_summary.rb +277 -0
  82. data/lib/oci/monitoring/models/alarm_summary.rb +386 -0
  83. data/lib/oci/monitoring/models/create_alarm_details.rb +423 -0
  84. data/lib/oci/monitoring/models/datapoint.rb +179 -0
  85. data/lib/oci/monitoring/models/failed_metric_record.rb +166 -0
  86. data/lib/oci/monitoring/models/list_metrics_details.rb +271 -0
  87. data/lib/oci/monitoring/models/metric.rb +197 -0
  88. data/lib/oci/monitoring/models/metric_data.rb +243 -0
  89. data/lib/oci/monitoring/models/metric_data_details.rb +227 -0
  90. data/lib/oci/monitoring/models/post_metric_data_details.rb +194 -0
  91. data/lib/oci/monitoring/models/post_metric_data_response_details.rb +170 -0
  92. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +229 -0
  93. data/lib/oci/monitoring/models/suppression.rb +196 -0
  94. data/lib/oci/monitoring/models/update_alarm_details.rb +423 -0
  95. data/lib/oci/monitoring/monitoring.rb +37 -0
  96. data/lib/oci/monitoring/monitoring_client.rb +923 -0
  97. data/lib/oci/monitoring/monitoring_client_composite_operations.rb +145 -0
  98. data/lib/oci/monitoring/util.rb +2 -0
  99. data/lib/oci/ons/models/backoff_retry_policy.rb +192 -0
  100. data/lib/oci/ons/models/confirmation_result.rb +221 -0
  101. data/lib/oci/ons/models/create_subscription_details.rb +238 -0
  102. data/lib/oci/ons/models/create_topic_details.rb +209 -0
  103. data/lib/oci/ons/models/delivery_policy.rb +153 -0
  104. data/lib/oci/ons/models/message_details.rb +163 -0
  105. data/lib/oci/ons/models/notification_topic.rb +302 -0
  106. data/lib/oci/ons/models/notification_topic_summary.rb +303 -0
  107. data/lib/oci/ons/models/publish_result.rb +168 -0
  108. data/lib/oci/ons/models/subscription.rb +273 -0
  109. data/lib/oci/ons/models/subscription_summary.rb +300 -0
  110. data/lib/oci/ons/models/topic_attributes_details.rb +184 -0
  111. data/lib/oci/ons/models/update_subscription_details.rb +188 -0
  112. data/lib/oci/ons/notification_control_plane_client.rb +463 -0
  113. data/lib/oci/ons/notification_control_plane_client_composite_operations.rb +24 -0
  114. data/lib/oci/ons/notification_data_plane_client.rb +680 -0
  115. data/lib/oci/ons/notification_data_plane_client_composite_operations.rb +104 -0
  116. data/lib/oci/ons/ons.rb +33 -0
  117. data/lib/oci/ons/util.rb +2 -0
  118. data/lib/oci/regions.rb +5 -0
  119. data/lib/oci/resource_manager/models/apply_job_plan_resolution.rb +189 -0
  120. data/lib/oci/resource_manager/models/config_source.rb +208 -0
  121. data/lib/oci/resource_manager/models/create_config_source_details.rb +187 -0
  122. data/lib/oci/resource_manager/models/create_job_details.rb +225 -0
  123. data/lib/oci/resource_manager/models/create_stack_details.rb +239 -0
  124. data/lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb +166 -0
  125. data/lib/oci/resource_manager/models/failure_details.rb +185 -0
  126. data/lib/oci/resource_manager/models/job.rb +399 -0
  127. data/lib/oci/resource_manager/models/job_summary.rb +311 -0
  128. data/lib/oci/resource_manager/models/log_entry.rb +225 -0
  129. data/lib/oci/resource_manager/models/stack.rb +305 -0
  130. data/lib/oci/resource_manager/models/stack_summary.rb +249 -0
  131. data/lib/oci/resource_manager/models/update_config_source_details.rb +184 -0
  132. data/lib/oci/resource_manager/models/update_job_details.rb +188 -0
  133. data/lib/oci/resource_manager/models/update_stack_details.rb +225 -0
  134. data/lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb +164 -0
  135. data/lib/oci/resource_manager/models/zip_upload_config_source.rb +149 -0
  136. data/lib/oci/resource_manager/resource_manager.rb +36 -0
  137. data/lib/oci/resource_manager/resource_manager_client.rb +1264 -0
  138. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +263 -0
  139. data/lib/oci/resource_manager/util.rb +2 -0
  140. data/lib/oci/version.rb +1 -1
  141. metadata +100 -2
@@ -0,0 +1,145 @@
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::Monitoring::MonitoringClient} 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 Monitoring::MonitoringClientCompositeOperations
10
+ # The {OCI::Monitoring::MonitoringClient} used to communicate with the service_client
11
+ #
12
+ # @return [OCI::Monitoring::MonitoringClient]
13
+ attr_reader :service_client
14
+
15
+ # Initializes a new MonitoringClientCompositeOperations
16
+ #
17
+ # @param [OCI::Monitoring::MonitoringClient] service_client The client used to communicate with the service.
18
+ # Defaults to a new service client created via {OCI::Monitoring::MonitoringClient#initialize} with no arguments
19
+ def initialize(service_client = OCI::Monitoring::MonitoringClient.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::Monitoring::MonitoringClient#create_alarm} and then waits for the {OCI::Monitoring::Models::Alarm} acted upon
28
+ # to enter the given state(s).
29
+ #
30
+ # @param [OCI::Monitoring::Models::CreateAlarmDetails] create_alarm_details Document for creating an alarm.
31
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Monitoring::Models::Alarm#lifecycle_state}
32
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Monitoring::MonitoringClient#create_alarm}
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::Monitoring::Models::Alarm}
38
+ def create_alarm_and_wait_for_state(create_alarm_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
39
+ operation_result = @service_client.create_alarm(create_alarm_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_alarm(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::Monitoring::MonitoringClient#delete_alarm} and then waits for the {OCI::Monitoring::Models::Alarm} acted upon
67
+ # to enter the given state(s).
68
+ #
69
+ # @param [String] alarm_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm.
70
+ #
71
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Monitoring::Models::Alarm#lifecycle_state}
72
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Monitoring::MonitoringClient#delete_alarm}
73
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
74
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
75
+ # * max_wait_seconds The maximum time to wait, in seconds
76
+ #
77
+ # @return [OCI::Response] A {OCI::Response} object with data of type nil
78
+ def delete_alarm_and_wait_for_state(alarm_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
79
+ initial_get_result = @service_client.get_alarm(alarm_id)
80
+ operation_result = @service_client.delete_alarm(alarm_id, base_operation_opts)
81
+
82
+ return operation_result if wait_for_states.empty?
83
+
84
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
85
+
86
+ begin
87
+ waiter_result = initial_get_result.wait_until(
88
+ eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
89
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
90
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200,
91
+ succeed_on_not_found: true
92
+ )
93
+ result_to_return = waiter_result
94
+
95
+ return result_to_return
96
+ rescue StandardError
97
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
98
+ end
99
+ end
100
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
101
+ # rubocop:enable Layout/EmptyLines
102
+
103
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
104
+ # rubocop:disable Layout/EmptyLines
105
+
106
+
107
+ # Calls {OCI::Monitoring::MonitoringClient#update_alarm} and then waits for the {OCI::Monitoring::Models::Alarm} acted upon
108
+ # to enter the given state(s).
109
+ #
110
+ # @param [String] alarm_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of an alarm.
111
+ #
112
+ # @param [OCI::Monitoring::Models::UpdateAlarmDetails] update_alarm_details Document for updating an alarm.
113
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Monitoring::Models::Alarm#lifecycle_state}
114
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Monitoring::MonitoringClient#update_alarm}
115
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
116
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
117
+ # * max_wait_seconds The maximum time to wait, in seconds
118
+ #
119
+ # @return [OCI::Response] A {OCI::Response} object with data of type {OCI::Monitoring::Models::Alarm}
120
+ def update_alarm_and_wait_for_state(alarm_id, update_alarm_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
121
+ operation_result = @service_client.update_alarm(alarm_id, update_alarm_details, base_operation_opts)
122
+
123
+ return operation_result if wait_for_states.empty?
124
+
125
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
126
+ wait_for_resource_id = operation_result.data.id
127
+
128
+ begin
129
+ waiter_result = @service_client.get_alarm(wait_for_resource_id).wait_until(
130
+ eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
131
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
132
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
133
+ )
134
+ result_to_return = waiter_result
135
+
136
+ return result_to_return
137
+ rescue StandardError
138
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
139
+ end
140
+ end
141
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
142
+ # rubocop:enable Layout/EmptyLines
143
+ end
144
+ end
145
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,2 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
@@ -0,0 +1,192 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # The backoff retry portion of the subscription delivery policy.
9
+ #
10
+ class Ons::Models::BackoffRetryPolicy # rubocop:disable Metrics/LineLength
11
+ POLICY_TYPE_ENUM = [
12
+ POLICY_TYPE_EXPONENTIAL = 'EXPONENTIAL'.freeze,
13
+ POLICY_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
14
+ ].freeze
15
+
16
+ # **[Required]** The maximum retry duration in milliseconds.
17
+ # @return [Integer]
18
+ attr_accessor :max_retry_duration
19
+
20
+ # **[Required]** The type of delivery policy. Default value: EXPONENTIAL.
21
+ #
22
+ # @return [String]
23
+ attr_reader :policy_type
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ # rubocop:disable Style/SymbolLiteral
29
+ 'max_retry_duration': :'maxRetryDuration',
30
+ 'policy_type': :'policyType'
31
+ # rubocop:enable Style/SymbolLiteral
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ # rubocop:disable Style/SymbolLiteral
39
+ 'max_retry_duration': :'Integer',
40
+ 'policy_type': :'String'
41
+ # rubocop:enable Style/SymbolLiteral
42
+ }
43
+ end
44
+
45
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
46
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
47
+
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ # @option attributes [Integer] :max_retry_duration The value to assign to the {#max_retry_duration} property
52
+ # @option attributes [String] :policy_type The value to assign to the {#policy_type} property
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
58
+
59
+ self.max_retry_duration = attributes[:'maxRetryDuration'] if attributes[:'maxRetryDuration']
60
+
61
+ raise 'You cannot provide both :maxRetryDuration and :max_retry_duration' if attributes.key?(:'maxRetryDuration') && attributes.key?(:'max_retry_duration')
62
+
63
+ self.max_retry_duration = attributes[:'max_retry_duration'] if attributes[:'max_retry_duration']
64
+
65
+ self.policy_type = attributes[:'policyType'] if attributes[:'policyType']
66
+ self.policy_type = "EXPONENTIAL" if policy_type.nil? && !attributes.key?(:'policyType') # rubocop:disable Style/StringLiterals
67
+
68
+ raise 'You cannot provide both :policyType and :policy_type' if attributes.key?(:'policyType') && attributes.key?(:'policy_type')
69
+
70
+ self.policy_type = attributes[:'policy_type'] if attributes[:'policy_type']
71
+ self.policy_type = "EXPONENTIAL" if policy_type.nil? && !attributes.key?(:'policyType') && !attributes.key?(:'policy_type') # rubocop:disable Style/StringLiterals
72
+ end
73
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
74
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
75
+
76
+ # Custom attribute writer method checking allowed values (enum).
77
+ # @param [Object] policy_type Object to be assigned
78
+ def policy_type=(policy_type)
79
+ # rubocop:disable Style/ConditionalAssignment
80
+ if policy_type && !POLICY_TYPE_ENUM.include?(policy_type)
81
+ # rubocop: disable Metrics/LineLength
82
+ OCI.logger.debug("Unknown value for 'policy_type' [" + policy_type + "]. Mapping to 'POLICY_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
83
+ # rubocop: enable Metrics/LineLength
84
+ @policy_type = POLICY_TYPE_UNKNOWN_ENUM_VALUE
85
+ else
86
+ @policy_type = policy_type
87
+ end
88
+ # rubocop:enable Style/ConditionalAssignment
89
+ end
90
+
91
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
92
+
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] other the other object to be compared
96
+ def ==(other)
97
+ return true if equal?(other)
98
+
99
+ self.class == other.class &&
100
+ max_retry_duration == other.max_retry_duration &&
101
+ policy_type == other.policy_type
102
+ end
103
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
104
+
105
+ # @see the `==` method
106
+ # @param [Object] other the other object to be compared
107
+ def eql?(other)
108
+ self == other
109
+ end
110
+
111
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
112
+
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Fixnum] Hash code
116
+ def hash
117
+ [max_retry_duration, policy_type].hash
118
+ end
119
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
120
+
121
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
122
+
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+
130
+ self.class.swagger_types.each_pair do |key, type|
131
+ if type =~ /^Array<(.*)>/i
132
+ # check to ensure the input is an array given that the the attribute
133
+ # is documented as an array but the input is not
134
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
135
+ public_method("#{key}=").call(
136
+ attributes[self.class.attribute_map[key]]
137
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
138
+ )
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ public_method("#{key}=").call(
142
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
143
+ )
144
+ end
145
+ # or else data not found in attributes(hash), not an issue as the data can be optional
146
+ end
147
+
148
+ self
149
+ end
150
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
151
+
152
+ # Returns the string representation of the object
153
+ # @return [String] String presentation of the object
154
+ def to_s
155
+ to_hash.to_s
156
+ end
157
+
158
+ # Returns the object in the form of hash
159
+ # @return [Hash] Returns the object in the form of hash
160
+ def to_hash
161
+ hash = {}
162
+ self.class.attribute_map.each_pair do |attr, param|
163
+ value = public_method(attr).call
164
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ private
172
+
173
+ # Outputs non-array value in the form of hash
174
+ # For object, use to_hash. Otherwise, just return the value
175
+ # @param [Object] value Any valid value
176
+ # @return [Hash] Returns the value in the form of hash
177
+ def _to_hash(value)
178
+ if value.is_a?(Array)
179
+ value.compact.map { |v| _to_hash(v) }
180
+ elsif value.is_a?(Hash)
181
+ {}.tap do |hash|
182
+ value.each { |k, v| hash[k] = _to_hash(v) }
183
+ end
184
+ elsif value.respond_to? :to_hash
185
+ value.to_hash
186
+ else
187
+ value
188
+ end
189
+ end
190
+ end
191
+ end
192
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,221 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # The confirmation result.
8
+ #
9
+ class Ons::Models::ConfirmationResult # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The name of the subscribed topic.
11
+ #
12
+ # @return [String]
13
+ attr_accessor :topic_name
14
+
15
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the topic to delete.
16
+ #
17
+ # @return [String]
18
+ attr_accessor :topic_id
19
+
20
+ # **[Required]** The endpoint of the subscription. Valid values depend on the protocol.
21
+ # For EMAIL, only an email address is valid. For HTTPS, only a PagerDuty URL is valid. A URL cannot exceed 512 characters.
22
+ # Avoid entering confidential information.
23
+ #
24
+ # @return [String]
25
+ attr_accessor :endpoint
26
+
27
+ # **[Required]** The URL user can use to unsubscribe the topic.
28
+ # @return [String]
29
+ attr_accessor :unsubscribe_url
30
+
31
+ # **[Required]** Human readable text which tells the user if the confirmation succeeds.
32
+ # @return [String]
33
+ attr_accessor :message
34
+
35
+ # The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the subscription.
36
+ # @return [String]
37
+ attr_accessor :subscription_id
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ # rubocop:disable Style/SymbolLiteral
43
+ 'topic_name': :'topicName',
44
+ 'topic_id': :'topicId',
45
+ 'endpoint': :'endpoint',
46
+ 'unsubscribe_url': :'unsubscribeUrl',
47
+ 'message': :'message',
48
+ 'subscription_id': :'subscriptionId'
49
+ # rubocop:enable Style/SymbolLiteral
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ # rubocop:disable Style/SymbolLiteral
57
+ 'topic_name': :'String',
58
+ 'topic_id': :'String',
59
+ 'endpoint': :'String',
60
+ 'unsubscribe_url': :'String',
61
+ 'message': :'String',
62
+ 'subscription_id': :'String'
63
+ # rubocop:enable Style/SymbolLiteral
64
+ }
65
+ end
66
+
67
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
68
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
69
+
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ # @option attributes [String] :topic_name The value to assign to the {#topic_name} property
74
+ # @option attributes [String] :topic_id The value to assign to the {#topic_id} property
75
+ # @option attributes [String] :endpoint The value to assign to the {#endpoint} property
76
+ # @option attributes [String] :unsubscribe_url The value to assign to the {#unsubscribe_url} property
77
+ # @option attributes [String] :message The value to assign to the {#message} property
78
+ # @option attributes [String] :subscription_id The value to assign to the {#subscription_id} property
79
+ def initialize(attributes = {})
80
+ return unless attributes.is_a?(Hash)
81
+
82
+ # convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
84
+
85
+ self.topic_name = attributes[:'topicName'] if attributes[:'topicName']
86
+
87
+ raise 'You cannot provide both :topicName and :topic_name' if attributes.key?(:'topicName') && attributes.key?(:'topic_name')
88
+
89
+ self.topic_name = attributes[:'topic_name'] if attributes[:'topic_name']
90
+
91
+ self.topic_id = attributes[:'topicId'] if attributes[:'topicId']
92
+
93
+ raise 'You cannot provide both :topicId and :topic_id' if attributes.key?(:'topicId') && attributes.key?(:'topic_id')
94
+
95
+ self.topic_id = attributes[:'topic_id'] if attributes[:'topic_id']
96
+
97
+ self.endpoint = attributes[:'endpoint'] if attributes[:'endpoint']
98
+
99
+ self.unsubscribe_url = attributes[:'unsubscribeUrl'] if attributes[:'unsubscribeUrl']
100
+
101
+ raise 'You cannot provide both :unsubscribeUrl and :unsubscribe_url' if attributes.key?(:'unsubscribeUrl') && attributes.key?(:'unsubscribe_url')
102
+
103
+ self.unsubscribe_url = attributes[:'unsubscribe_url'] if attributes[:'unsubscribe_url']
104
+
105
+ self.message = attributes[:'message'] if attributes[:'message']
106
+
107
+ self.subscription_id = attributes[:'subscriptionId'] if attributes[:'subscriptionId']
108
+
109
+ raise 'You cannot provide both :subscriptionId and :subscription_id' if attributes.key?(:'subscriptionId') && attributes.key?(:'subscription_id')
110
+
111
+ self.subscription_id = attributes[:'subscription_id'] if attributes[:'subscription_id']
112
+ end
113
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
114
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
115
+
116
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
117
+
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] other the other object to be compared
121
+ def ==(other)
122
+ return true if equal?(other)
123
+
124
+ self.class == other.class &&
125
+ topic_name == other.topic_name &&
126
+ topic_id == other.topic_id &&
127
+ endpoint == other.endpoint &&
128
+ unsubscribe_url == other.unsubscribe_url &&
129
+ message == other.message &&
130
+ subscription_id == other.subscription_id
131
+ end
132
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
133
+
134
+ # @see the `==` method
135
+ # @param [Object] other the other object to be compared
136
+ def eql?(other)
137
+ self == other
138
+ end
139
+
140
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
141
+
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Fixnum] Hash code
145
+ def hash
146
+ [topic_name, topic_id, endpoint, unsubscribe_url, message, subscription_id].hash
147
+ end
148
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
149
+
150
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
151
+
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+
159
+ self.class.swagger_types.each_pair do |key, type|
160
+ if type =~ /^Array<(.*)>/i
161
+ # check to ensure the input is an array given that the the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
164
+ public_method("#{key}=").call(
165
+ attributes[self.class.attribute_map[key]]
166
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
167
+ )
168
+ end
169
+ elsif !attributes[self.class.attribute_map[key]].nil?
170
+ public_method("#{key}=").call(
171
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
172
+ )
173
+ end
174
+ # or else data not found in attributes(hash), not an issue as the data can be optional
175
+ end
176
+
177
+ self
178
+ end
179
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # Returns the object in the form of hash
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_hash
190
+ hash = {}
191
+ self.class.attribute_map.each_pair do |attr, param|
192
+ value = public_method(attr).call
193
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ private
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+ end
220
+ end
221
+ # rubocop:enable Lint/UnneededCopDisableDirective