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,173 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require_relative 'auto_scaling_policy'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # A Policy that defines threshold based rules for an AutoScalingConfiguration
9
+ class Autoscaling::Models::ThresholdPolicy < Autoscaling::Models::AutoScalingPolicy # rubocop:disable Metrics/LineLength
10
+ # This attribute is required.
11
+ # @return [Array<OCI::Autoscaling::Models::Condition>]
12
+ attr_accessor :rules
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ # rubocop:disable Style/SymbolLiteral
18
+ 'capacity': :'capacity',
19
+ 'id': :'id',
20
+ 'display_name': :'displayName',
21
+ 'policy_type': :'policyType',
22
+ 'time_created': :'timeCreated',
23
+ 'rules': :'rules'
24
+ # rubocop:enable Style/SymbolLiteral
25
+ }
26
+ end
27
+
28
+ # Attribute type mapping.
29
+ def self.swagger_types
30
+ {
31
+ # rubocop:disable Style/SymbolLiteral
32
+ 'capacity': :'OCI::Autoscaling::Models::Capacity',
33
+ 'id': :'String',
34
+ 'display_name': :'String',
35
+ 'policy_type': :'String',
36
+ 'time_created': :'DateTime',
37
+ 'rules': :'Array<OCI::Autoscaling::Models::Condition>'
38
+ # rubocop:enable Style/SymbolLiteral
39
+ }
40
+ end
41
+
42
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
43
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
44
+
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ # @option attributes [OCI::Autoscaling::Models::Capacity] :capacity The value to assign to the {OCI::Autoscaling::Models::AutoScalingPolicy#capacity #capacity} proprety
49
+ # @option attributes [String] :id The value to assign to the {OCI::Autoscaling::Models::AutoScalingPolicy#id #id} proprety
50
+ # @option attributes [String] :display_name The value to assign to the {OCI::Autoscaling::Models::AutoScalingPolicy#display_name #display_name} proprety
51
+ # @option attributes [DateTime] :time_created The value to assign to the {OCI::Autoscaling::Models::AutoScalingPolicy#time_created #time_created} proprety
52
+ # @option attributes [Array<OCI::Autoscaling::Models::Condition>] :rules The value to assign to the {#rules} property
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ attributes['policyType'] = 'threshold'
57
+
58
+ super(attributes)
59
+
60
+ # convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
62
+
63
+ self.rules = attributes[:'rules'] if attributes[:'rules']
64
+ end
65
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
66
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
67
+
68
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
69
+
70
+
71
+ # Checks equality by comparing each attribute.
72
+ # @param [Object] other the other object to be compared
73
+ def ==(other)
74
+ return true if equal?(other)
75
+
76
+ self.class == other.class &&
77
+ capacity == other.capacity &&
78
+ id == other.id &&
79
+ display_name == other.display_name &&
80
+ policy_type == other.policy_type &&
81
+ time_created == other.time_created &&
82
+ rules == other.rules
83
+ end
84
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
85
+
86
+ # @see the `==` method
87
+ # @param [Object] other the other object to be compared
88
+ def eql?(other)
89
+ self == other
90
+ end
91
+
92
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
93
+
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [capacity, id, display_name, policy_type, time_created, rules].hash
99
+ end
100
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
101
+
102
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
103
+
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+
111
+ self.class.swagger_types.each_pair do |key, type|
112
+ if type =~ /^Array<(.*)>/i
113
+ # check to ensure the input is an array given that the the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
116
+ public_method("#{key}=").call(
117
+ attributes[self.class.attribute_map[key]]
118
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
119
+ )
120
+ end
121
+ elsif !attributes[self.class.attribute_map[key]].nil?
122
+ public_method("#{key}=").call(
123
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
124
+ )
125
+ end
126
+ # or else data not found in attributes(hash), not an issue as the data can be optional
127
+ end
128
+
129
+ self
130
+ end
131
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
132
+
133
+ # Returns the string representation of the object
134
+ # @return [String] String presentation of the object
135
+ def to_s
136
+ to_hash.to_s
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = public_method(attr).call
145
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
146
+
147
+ hash[param] = _to_hash(value)
148
+ end
149
+ hash
150
+ end
151
+
152
+ private
153
+
154
+ # Outputs non-array value in the form of hash
155
+ # For object, use to_hash. Otherwise, just return the value
156
+ # @param [Object] value Any valid value
157
+ # @return [Hash] Returns the value in the form of hash
158
+ def _to_hash(value)
159
+ if value.is_a?(Array)
160
+ value.compact.map { |v| _to_hash(v) }
161
+ elsif value.is_a?(Hash)
162
+ {}.tap do |hash|
163
+ value.each { |k, v| hash[k] = _to_hash(v) }
164
+ end
165
+ elsif value.respond_to? :to_hash
166
+ value.to_hash
167
+ else
168
+ value
169
+ end
170
+ end
171
+ end
172
+ end
173
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,219 @@
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
+ # UpdateAutoScalingConfigurationDetails model.
8
+ class Autoscaling::Models::UpdateAutoScalingConfigurationDetails # rubocop:disable Metrics/LineLength
9
+ # Defined tags for this resource. Each key is predefined and scoped to a
10
+ # namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
11
+ #
12
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
13
+ #
14
+ # @return [Hash<String, Hash<String, Object>>]
15
+ attr_accessor :defined_tags
16
+
17
+ # A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
18
+ #
19
+ # @return [String]
20
+ attr_accessor :display_name
21
+
22
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
23
+ # 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
+ # If the AutoScalingConfiguration is enabled
31
+ # @return [BOOLEAN]
32
+ attr_accessor :is_enabled
33
+
34
+ # The minimum period of time between scaling actions. The default is 300 seconds.
35
+ #
36
+ # @return [Integer]
37
+ attr_accessor :cool_down_in_seconds
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ # rubocop:disable Style/SymbolLiteral
43
+ 'defined_tags': :'definedTags',
44
+ 'display_name': :'displayName',
45
+ 'freeform_tags': :'freeformTags',
46
+ 'is_enabled': :'isEnabled',
47
+ 'cool_down_in_seconds': :'coolDownInSeconds'
48
+ # rubocop:enable Style/SymbolLiteral
49
+ }
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.swagger_types
54
+ {
55
+ # rubocop:disable Style/SymbolLiteral
56
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
57
+ 'display_name': :'String',
58
+ 'freeform_tags': :'Hash<String, String>',
59
+ 'is_enabled': :'BOOLEAN',
60
+ 'cool_down_in_seconds': :'Integer'
61
+ # rubocop:enable Style/SymbolLiteral
62
+ }
63
+ end
64
+
65
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
66
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
67
+
68
+
69
+ # Initializes the object
70
+ # @param [Hash] attributes Model attributes in the form of hash
71
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
72
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
73
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
74
+ # @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
75
+ # @option attributes [Integer] :cool_down_in_seconds The value to assign to the {#cool_down_in_seconds} property
76
+ def initialize(attributes = {})
77
+ return unless attributes.is_a?(Hash)
78
+
79
+ # convert string to symbol for hash key
80
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
81
+
82
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
83
+
84
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
85
+
86
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
87
+
88
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
89
+
90
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
91
+
92
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
93
+
94
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
95
+
96
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
97
+
98
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
99
+
100
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
101
+
102
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
103
+
104
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
105
+
106
+ self.cool_down_in_seconds = attributes[:'coolDownInSeconds'] if attributes[:'coolDownInSeconds']
107
+
108
+ raise 'You cannot provide both :coolDownInSeconds and :cool_down_in_seconds' if attributes.key?(:'coolDownInSeconds') && attributes.key?(:'cool_down_in_seconds')
109
+
110
+ self.cool_down_in_seconds = attributes[:'cool_down_in_seconds'] if attributes[:'cool_down_in_seconds']
111
+ end
112
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
113
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
114
+
115
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
116
+
117
+
118
+ # Checks equality by comparing each attribute.
119
+ # @param [Object] other the other object to be compared
120
+ def ==(other)
121
+ return true if equal?(other)
122
+
123
+ self.class == other.class &&
124
+ defined_tags == other.defined_tags &&
125
+ display_name == other.display_name &&
126
+ freeform_tags == other.freeform_tags &&
127
+ is_enabled == other.is_enabled &&
128
+ cool_down_in_seconds == other.cool_down_in_seconds
129
+ end
130
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
131
+
132
+ # @see the `==` method
133
+ # @param [Object] other the other object to be compared
134
+ def eql?(other)
135
+ self == other
136
+ end
137
+
138
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
139
+
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Fixnum] Hash code
143
+ def hash
144
+ [defined_tags, display_name, freeform_tags, is_enabled, cool_down_in_seconds].hash
145
+ end
146
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
147
+
148
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
149
+
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+
157
+ self.class.swagger_types.each_pair do |key, type|
158
+ if type =~ /^Array<(.*)>/i
159
+ # check to ensure the input is an array given that the the attribute
160
+ # is documented as an array but the input is not
161
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
162
+ public_method("#{key}=").call(
163
+ attributes[self.class.attribute_map[key]]
164
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
165
+ )
166
+ end
167
+ elsif !attributes[self.class.attribute_map[key]].nil?
168
+ public_method("#{key}=").call(
169
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
170
+ )
171
+ end
172
+ # or else data not found in attributes(hash), not an issue as the data can be optional
173
+ end
174
+
175
+ self
176
+ end
177
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
178
+
179
+ # Returns the string representation of the object
180
+ # @return [String] String presentation of the object
181
+ def to_s
182
+ to_hash.to_s
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = public_method(attr).call
191
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
192
+
193
+ hash[param] = _to_hash(value)
194
+ end
195
+ hash
196
+ end
197
+
198
+ private
199
+
200
+ # Outputs non-array value in the form of hash
201
+ # For object, use to_hash. Otherwise, just return the value
202
+ # @param [Object] value Any valid value
203
+ # @return [Hash] Returns the value in the form of hash
204
+ def _to_hash(value)
205
+ if value.is_a?(Array)
206
+ value.compact.map { |v| _to_hash(v) }
207
+ elsif value.is_a?(Hash)
208
+ {}.tap do |hash|
209
+ value.each { |k, v| hash[k] = _to_hash(v) }
210
+ end
211
+ elsif value.respond_to? :to_hash
212
+ value.to_hash
213
+ else
214
+ value
215
+ end
216
+ end
217
+ end
218
+ end
219
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,194 @@
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
+ # UpdateAutoScalingPolicyDetails model.
8
+ # This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
9
+ class Autoscaling::Models::UpdateAutoScalingPolicyDetails # rubocop:disable Metrics/LineLength
10
+ # A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
11
+ #
12
+ # @return [String]
13
+ attr_accessor :display_name
14
+
15
+ # The capacity requirements of the Policy
16
+ # @return [OCI::Autoscaling::Models::Capacity]
17
+ attr_accessor :capacity
18
+
19
+ # **[Required]** Indicates type of Policy
20
+ # @return [String]
21
+ attr_accessor :policy_type
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ # rubocop:disable Style/SymbolLiteral
27
+ 'display_name': :'displayName',
28
+ 'capacity': :'capacity',
29
+ 'policy_type': :'policyType'
30
+ # rubocop:enable Style/SymbolLiteral
31
+ }
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.swagger_types
36
+ {
37
+ # rubocop:disable Style/SymbolLiteral
38
+ 'display_name': :'String',
39
+ 'capacity': :'OCI::Autoscaling::Models::Capacity',
40
+ 'policy_type': :'String'
41
+ # rubocop:enable Style/SymbolLiteral
42
+ }
43
+ end
44
+
45
+ # rubocop:disable Metrics/CyclomaticComplexity, Layout/EmptyLines
46
+
47
+
48
+ # Given the hash representation of a subtype of this class,
49
+ # use the info in the hash to return the class of the subtype.
50
+ def self.get_subtype(object_hash)
51
+ type = object_hash[:'policyType'] # rubocop:disable Style/SymbolLiteral
52
+
53
+ return 'OCI::Autoscaling::Models::UpdateThresholdPolicyDetails' if type == 'threshold'
54
+
55
+ # TODO: Log a warning when the subtype is not found.
56
+ 'OCI::Autoscaling::Models::UpdateAutoScalingPolicyDetails'
57
+ end
58
+ # rubocop:enable Metrics/CyclomaticComplexity, Layout/EmptyLines
59
+
60
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
61
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
62
+
63
+
64
+ # Initializes the object
65
+ # @param [Hash] attributes Model attributes in the form of hash
66
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
67
+ # @option attributes [OCI::Autoscaling::Models::Capacity] :capacity The value to assign to the {#capacity} property
68
+ # @option attributes [String] :policy_type The value to assign to the {#policy_type} property
69
+ def initialize(attributes = {})
70
+ return unless attributes.is_a?(Hash)
71
+
72
+ # convert string to symbol for hash key
73
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
74
+
75
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
76
+
77
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
78
+
79
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
80
+
81
+ self.capacity = attributes[:'capacity'] if attributes[:'capacity']
82
+
83
+ self.policy_type = attributes[:'policyType'] if attributes[:'policyType']
84
+
85
+ raise 'You cannot provide both :policyType and :policy_type' if attributes.key?(:'policyType') && attributes.key?(:'policy_type')
86
+
87
+ self.policy_type = attributes[:'policy_type'] if attributes[:'policy_type']
88
+ end
89
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
90
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
91
+
92
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
93
+
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] other the other object to be compared
97
+ def ==(other)
98
+ return true if equal?(other)
99
+
100
+ self.class == other.class &&
101
+ display_name == other.display_name &&
102
+ capacity == other.capacity &&
103
+ policy_type == other.policy_type
104
+ end
105
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
106
+
107
+ # @see the `==` method
108
+ # @param [Object] other the other object to be compared
109
+ def eql?(other)
110
+ self == other
111
+ end
112
+
113
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
114
+
115
+
116
+ # Calculates hash code according to all attributes.
117
+ # @return [Fixnum] Hash code
118
+ def hash
119
+ [display_name, capacity, policy_type].hash
120
+ end
121
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
122
+
123
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
124
+
125
+
126
+ # Builds the object from hash
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ # @return [Object] Returns the model itself
129
+ def build_from_hash(attributes)
130
+ return nil unless attributes.is_a?(Hash)
131
+
132
+ self.class.swagger_types.each_pair do |key, type|
133
+ if type =~ /^Array<(.*)>/i
134
+ # check to ensure the input is an array given that the the attribute
135
+ # is documented as an array but the input is not
136
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
137
+ public_method("#{key}=").call(
138
+ attributes[self.class.attribute_map[key]]
139
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
140
+ )
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ public_method("#{key}=").call(
144
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
145
+ )
146
+ end
147
+ # or else data not found in attributes(hash), not an issue as the data can be optional
148
+ end
149
+
150
+ self
151
+ end
152
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
153
+
154
+ # Returns the string representation of the object
155
+ # @return [String] String presentation of the object
156
+ def to_s
157
+ to_hash.to_s
158
+ end
159
+
160
+ # Returns the object in the form of hash
161
+ # @return [Hash] Returns the object in the form of hash
162
+ def to_hash
163
+ hash = {}
164
+ self.class.attribute_map.each_pair do |attr, param|
165
+ value = public_method(attr).call
166
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
167
+
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ private
174
+
175
+ # Outputs non-array value in the form of hash
176
+ # For object, use to_hash. Otherwise, just return the value
177
+ # @param [Object] value Any valid value
178
+ # @return [Hash] Returns the value in the form of hash
179
+ def _to_hash(value)
180
+ if value.is_a?(Array)
181
+ value.compact.map { |v| _to_hash(v) }
182
+ elsif value.is_a?(Hash)
183
+ {}.tap do |hash|
184
+ value.each { |k, v| hash[k] = _to_hash(v) }
185
+ end
186
+ elsif value.respond_to? :to_hash
187
+ value.to_hash
188
+ else
189
+ value
190
+ end
191
+ end
192
+ end
193
+ end
194
+ # rubocop:enable Lint/UnneededCopDisableDirective