oci 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,238 @@
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 configuration details for creating the subscription.
8
+ #
9
+ class Ons::Models::CreateSubscriptionDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the topic for the subscription.
11
+ #
12
+ # @return [String]
13
+ attr_accessor :topic_id
14
+
15
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment for the subscription.
16
+ #
17
+ # @return [String]
18
+ attr_accessor :compartment_id
19
+
20
+ # **[Required]** The protocol to use for delivering messages. Valid values: EMAIL, HTTPS.
21
+ #
22
+ # @return [String]
23
+ attr_accessor :protocol
24
+
25
+ # **[Required]** The endpoint of the subscription. Valid values depend on the protocol.
26
+ # For EMAIL, only an email address is valid. For HTTPS, only a PagerDuty URL is valid. A URL cannot exceed 512 characters.
27
+ # Avoid entering confidential information.
28
+ #
29
+ # @return [String]
30
+ attr_accessor :endpoint
31
+
32
+ # Metadata for the subscription. Avoid entering confidential information.
33
+ # @return [String]
34
+ attr_accessor :metadata
35
+
36
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
37
+ #
38
+ # Example: `{\"Department\": \"Finance\"}`
39
+ #
40
+ # @return [Hash<String, String>]
41
+ attr_accessor :freeform_tags
42
+
43
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
44
+ #
45
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
46
+ #
47
+ # @return [Hash<String, Hash<String, Object>>]
48
+ attr_accessor :defined_tags
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ # rubocop:disable Style/SymbolLiteral
54
+ 'topic_id': :'topicId',
55
+ 'compartment_id': :'compartmentId',
56
+ 'protocol': :'protocol',
57
+ 'endpoint': :'endpoint',
58
+ 'metadata': :'metadata',
59
+ 'freeform_tags': :'freeformTags',
60
+ 'defined_tags': :'definedTags'
61
+ # rubocop:enable Style/SymbolLiteral
62
+ }
63
+ end
64
+
65
+ # Attribute type mapping.
66
+ def self.swagger_types
67
+ {
68
+ # rubocop:disable Style/SymbolLiteral
69
+ 'topic_id': :'String',
70
+ 'compartment_id': :'String',
71
+ 'protocol': :'String',
72
+ 'endpoint': :'String',
73
+ 'metadata': :'String',
74
+ 'freeform_tags': :'Hash<String, String>',
75
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
76
+ # rubocop:enable Style/SymbolLiteral
77
+ }
78
+ end
79
+
80
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
81
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
82
+
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ # @option attributes [String] :topic_id The value to assign to the {#topic_id} property
87
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
88
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
89
+ # @option attributes [String] :endpoint The value to assign to the {#endpoint} property
90
+ # @option attributes [String] :metadata The value to assign to the {#metadata} property
91
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
92
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
93
+ def initialize(attributes = {})
94
+ return unless attributes.is_a?(Hash)
95
+
96
+ # convert string to symbol for hash key
97
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
98
+
99
+ self.topic_id = attributes[:'topicId'] if attributes[:'topicId']
100
+
101
+ raise 'You cannot provide both :topicId and :topic_id' if attributes.key?(:'topicId') && attributes.key?(:'topic_id')
102
+
103
+ self.topic_id = attributes[:'topic_id'] if attributes[:'topic_id']
104
+
105
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
106
+
107
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
108
+
109
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
110
+
111
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
112
+
113
+ self.endpoint = attributes[:'endpoint'] if attributes[:'endpoint']
114
+
115
+ self.metadata = attributes[:'metadata'] if attributes[:'metadata']
116
+
117
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
118
+
119
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
120
+
121
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
122
+
123
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
124
+
125
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
126
+
127
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
128
+ end
129
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
130
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
131
+
132
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
133
+
134
+
135
+ # Checks equality by comparing each attribute.
136
+ # @param [Object] other the other object to be compared
137
+ def ==(other)
138
+ return true if equal?(other)
139
+
140
+ self.class == other.class &&
141
+ topic_id == other.topic_id &&
142
+ compartment_id == other.compartment_id &&
143
+ protocol == other.protocol &&
144
+ endpoint == other.endpoint &&
145
+ metadata == other.metadata &&
146
+ freeform_tags == other.freeform_tags &&
147
+ defined_tags == other.defined_tags
148
+ end
149
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
150
+
151
+ # @see the `==` method
152
+ # @param [Object] other the other object to be compared
153
+ def eql?(other)
154
+ self == other
155
+ end
156
+
157
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
158
+
159
+
160
+ # Calculates hash code according to all attributes.
161
+ # @return [Fixnum] Hash code
162
+ def hash
163
+ [topic_id, compartment_id, protocol, endpoint, metadata, freeform_tags, defined_tags].hash
164
+ end
165
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
166
+
167
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
168
+
169
+
170
+ # Builds the object from hash
171
+ # @param [Hash] attributes Model attributes in the form of hash
172
+ # @return [Object] Returns the model itself
173
+ def build_from_hash(attributes)
174
+ return nil unless attributes.is_a?(Hash)
175
+
176
+ self.class.swagger_types.each_pair do |key, type|
177
+ if type =~ /^Array<(.*)>/i
178
+ # check to ensure the input is an array given that the the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
181
+ public_method("#{key}=").call(
182
+ attributes[self.class.attribute_map[key]]
183
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
184
+ )
185
+ end
186
+ elsif !attributes[self.class.attribute_map[key]].nil?
187
+ public_method("#{key}=").call(
188
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
189
+ )
190
+ end
191
+ # or else data not found in attributes(hash), not an issue as the data can be optional
192
+ end
193
+
194
+ self
195
+ end
196
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
197
+
198
+ # Returns the string representation of the object
199
+ # @return [String] String presentation of the object
200
+ def to_s
201
+ to_hash.to_s
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = public_method(attr).call
210
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ private
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+ end
237
+ end
238
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,209 @@
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 configuration details for creating the topic.
8
+ #
9
+ class Ons::Models::CreateTopicDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The name of the topic being created. Avoid entering confidential information.
11
+ # @return [String]
12
+ attr_accessor :name
13
+
14
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to create the topic in.
15
+ #
16
+ # @return [String]
17
+ attr_accessor :compartment_id
18
+
19
+ # The description of the topic being created. Avoid entering confidential information.
20
+ # @return [String]
21
+ attr_accessor :description
22
+
23
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
24
+ #
25
+ # Example: `{\"Department\": \"Finance\"}`
26
+ #
27
+ # @return [Hash<String, String>]
28
+ attr_accessor :freeform_tags
29
+
30
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
31
+ #
32
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
33
+ #
34
+ # @return [Hash<String, Hash<String, Object>>]
35
+ attr_accessor :defined_tags
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ # rubocop:disable Style/SymbolLiteral
41
+ 'name': :'name',
42
+ 'compartment_id': :'compartmentId',
43
+ 'description': :'description',
44
+ 'freeform_tags': :'freeformTags',
45
+ 'defined_tags': :'definedTags'
46
+ # rubocop:enable Style/SymbolLiteral
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ # rubocop:disable Style/SymbolLiteral
54
+ 'name': :'String',
55
+ 'compartment_id': :'String',
56
+ 'description': :'String',
57
+ 'freeform_tags': :'Hash<String, String>',
58
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
59
+ # rubocop:enable Style/SymbolLiteral
60
+ }
61
+ end
62
+
63
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
64
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
65
+
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ # @option attributes [String] :name The value to assign to the {#name} property
70
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
71
+ # @option attributes [String] :description The value to assign to the {#description} property
72
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
73
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
74
+ def initialize(attributes = {})
75
+ return unless attributes.is_a?(Hash)
76
+
77
+ # convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
79
+
80
+ self.name = attributes[:'name'] if attributes[:'name']
81
+
82
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
83
+
84
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
85
+
86
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
87
+
88
+ self.description = attributes[:'description'] if attributes[:'description']
89
+
90
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
91
+
92
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
93
+
94
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
95
+
96
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
97
+
98
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
99
+
100
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
101
+ end
102
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
103
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
104
+
105
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
106
+
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] other the other object to be compared
110
+ def ==(other)
111
+ return true if equal?(other)
112
+
113
+ self.class == other.class &&
114
+ name == other.name &&
115
+ compartment_id == other.compartment_id &&
116
+ description == other.description &&
117
+ freeform_tags == other.freeform_tags &&
118
+ defined_tags == other.defined_tags
119
+ end
120
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
121
+
122
+ # @see the `==` method
123
+ # @param [Object] other the other object to be compared
124
+ def eql?(other)
125
+ self == other
126
+ end
127
+
128
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
129
+
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Fixnum] Hash code
133
+ def hash
134
+ [name, compartment_id, description, freeform_tags, defined_tags].hash
135
+ end
136
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
137
+
138
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
139
+
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+
147
+ self.class.swagger_types.each_pair do |key, type|
148
+ if type =~ /^Array<(.*)>/i
149
+ # check to ensure the input is an array given that the the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ public_method("#{key}=").call(
153
+ attributes[self.class.attribute_map[key]]
154
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
155
+ )
156
+ end
157
+ elsif !attributes[self.class.attribute_map[key]].nil?
158
+ public_method("#{key}=").call(
159
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
160
+ )
161
+ end
162
+ # or else data not found in attributes(hash), not an issue as the data can be optional
163
+ end
164
+
165
+ self
166
+ end
167
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
168
+
169
+ # Returns the string representation of the object
170
+ # @return [String] String presentation of the object
171
+ def to_s
172
+ to_hash.to_s
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = public_method(attr).call
181
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
182
+
183
+ hash[param] = _to_hash(value)
184
+ end
185
+ hash
186
+ end
187
+
188
+ private
189
+
190
+ # Outputs non-array value in the form of hash
191
+ # For object, use to_hash. Otherwise, just return the value
192
+ # @param [Object] value Any valid value
193
+ # @return [Hash] Returns the value in the form of hash
194
+ def _to_hash(value)
195
+ if value.is_a?(Array)
196
+ value.compact.map { |v| _to_hash(v) }
197
+ elsif value.is_a?(Hash)
198
+ {}.tap do |hash|
199
+ value.each { |k, v| hash[k] = _to_hash(v) }
200
+ end
201
+ elsif value.respond_to? :to_hash
202
+ value.to_hash
203
+ else
204
+ value
205
+ end
206
+ end
207
+ end
208
+ end
209
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,153 @@
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 subscription delivery policy.
8
+ #
9
+ class Ons::Models::DeliveryPolicy # rubocop:disable Metrics/LineLength
10
+ # @return [OCI::Ons::Models::BackoffRetryPolicy]
11
+ attr_accessor :backoff_retry_policy
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ # rubocop:disable Style/SymbolLiteral
17
+ 'backoff_retry_policy': :'backoffRetryPolicy'
18
+ # rubocop:enable Style/SymbolLiteral
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.swagger_types
24
+ {
25
+ # rubocop:disable Style/SymbolLiteral
26
+ 'backoff_retry_policy': :'OCI::Ons::Models::BackoffRetryPolicy'
27
+ # rubocop:enable Style/SymbolLiteral
28
+ }
29
+ end
30
+
31
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
32
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
33
+
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ # @option attributes [OCI::Ons::Models::BackoffRetryPolicy] :backoff_retry_policy The value to assign to the {#backoff_retry_policy} property
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
43
+
44
+ self.backoff_retry_policy = attributes[:'backoffRetryPolicy'] if attributes[:'backoffRetryPolicy']
45
+
46
+ raise 'You cannot provide both :backoffRetryPolicy and :backoff_retry_policy' if attributes.key?(:'backoffRetryPolicy') && attributes.key?(:'backoff_retry_policy')
47
+
48
+ self.backoff_retry_policy = attributes[:'backoff_retry_policy'] if attributes[:'backoff_retry_policy']
49
+ end
50
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
51
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
52
+
53
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
54
+
55
+
56
+ # Checks equality by comparing each attribute.
57
+ # @param [Object] other the other object to be compared
58
+ def ==(other)
59
+ return true if equal?(other)
60
+
61
+ self.class == other.class &&
62
+ backoff_retry_policy == other.backoff_retry_policy
63
+ end
64
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
65
+
66
+ # @see the `==` method
67
+ # @param [Object] other the other object to be compared
68
+ def eql?(other)
69
+ self == other
70
+ end
71
+
72
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
73
+
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [backoff_retry_policy].hash
79
+ end
80
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
81
+
82
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
83
+
84
+
85
+ # Builds the object from hash
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ # @return [Object] Returns the model itself
88
+ def build_from_hash(attributes)
89
+ return nil unless attributes.is_a?(Hash)
90
+
91
+ self.class.swagger_types.each_pair do |key, type|
92
+ if type =~ /^Array<(.*)>/i
93
+ # check to ensure the input is an array given that the the attribute
94
+ # is documented as an array but the input is not
95
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
96
+ public_method("#{key}=").call(
97
+ attributes[self.class.attribute_map[key]]
98
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
99
+ )
100
+ end
101
+ elsif !attributes[self.class.attribute_map[key]].nil?
102
+ public_method("#{key}=").call(
103
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
104
+ )
105
+ end
106
+ # or else data not found in attributes(hash), not an issue as the data can be optional
107
+ end
108
+
109
+ self
110
+ end
111
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
112
+
113
+ # Returns the string representation of the object
114
+ # @return [String] String presentation of the object
115
+ def to_s
116
+ to_hash.to_s
117
+ end
118
+
119
+ # Returns the object in the form of hash
120
+ # @return [Hash] Returns the object in the form of hash
121
+ def to_hash
122
+ hash = {}
123
+ self.class.attribute_map.each_pair do |attr, param|
124
+ value = public_method(attr).call
125
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
126
+
127
+ hash[param] = _to_hash(value)
128
+ end
129
+ hash
130
+ end
131
+
132
+ private
133
+
134
+ # Outputs non-array value in the form of hash
135
+ # For object, use to_hash. Otherwise, just return the value
136
+ # @param [Object] value Any valid value
137
+ # @return [Hash] Returns the value in the form of hash
138
+ def _to_hash(value)
139
+ if value.is_a?(Array)
140
+ value.compact.map { |v| _to_hash(v) }
141
+ elsif value.is_a?(Hash)
142
+ {}.tap do |hash|
143
+ value.each { |k, v| hash[k] = _to_hash(v) }
144
+ end
145
+ elsif value.respond_to? :to_hash
146
+ value.to_hash
147
+ else
148
+ value
149
+ end
150
+ end
151
+ end
152
+ end
153
+ # rubocop:enable Lint/UnneededCopDisableDirective