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,24 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
4
+ module OCI
5
+ # This class provides a wrapper around {OCI::Autoscaling::AutoScalingClient} 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 Autoscaling::AutoScalingClientCompositeOperations
10
+ # The {OCI::Autoscaling::AutoScalingClient} used to communicate with the service_client
11
+ #
12
+ # @return [OCI::Autoscaling::AutoScalingClient]
13
+ attr_reader :service_client
14
+
15
+ # Initializes a new AutoScalingClientCompositeOperations
16
+ #
17
+ # @param [OCI::Autoscaling::AutoScalingClient] service_client The client used to communicate with the service.
18
+ # Defaults to a new service client created via {OCI::Autoscaling::AutoScalingClient#initialize} with no arguments
19
+ def initialize(service_client = OCI::Autoscaling::AutoScalingClient.new)
20
+ @service_client = service_client
21
+ end
22
+ end
23
+ end
24
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,38 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ module OCI
4
+ module Autoscaling
5
+ # Module containing models for requests made to, and responses received from,
6
+ # OCI Autoscaling services
7
+ module Models
8
+ end
9
+ end
10
+ end
11
+
12
+ # Require models
13
+ require 'oci/autoscaling/models/action'
14
+ require 'oci/autoscaling/models/auto_scaling_configuration'
15
+ require 'oci/autoscaling/models/auto_scaling_configuration_summary'
16
+ require 'oci/autoscaling/models/auto_scaling_policy'
17
+ require 'oci/autoscaling/models/auto_scaling_policy_summary'
18
+ require 'oci/autoscaling/models/capacity'
19
+ require 'oci/autoscaling/models/condition'
20
+ require 'oci/autoscaling/models/create_auto_scaling_configuration_details'
21
+ require 'oci/autoscaling/models/create_auto_scaling_policy_details'
22
+ require 'oci/autoscaling/models/create_condition_details'
23
+ require 'oci/autoscaling/models/create_threshold_policy_details'
24
+ require 'oci/autoscaling/models/instance_pool_resource'
25
+ require 'oci/autoscaling/models/metric'
26
+ require 'oci/autoscaling/models/resource'
27
+ require 'oci/autoscaling/models/threshold'
28
+ require 'oci/autoscaling/models/threshold_policy'
29
+ require 'oci/autoscaling/models/update_auto_scaling_configuration_details'
30
+ require 'oci/autoscaling/models/update_auto_scaling_policy_details'
31
+ require 'oci/autoscaling/models/update_condition_details'
32
+ require 'oci/autoscaling/models/update_threshold_policy_details'
33
+
34
+ # Require generated clients
35
+ require 'oci/autoscaling/auto_scaling_client'
36
+
37
+ # Require service utilities
38
+ require 'oci/autoscaling/util'
@@ -0,0 +1,182 @@
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 action to take if a scale event has been triggered. Positive values indicate scale out
9
+ # and negative value indicate scale in.
10
+ #
11
+ class Autoscaling::Models::Action # rubocop:disable Metrics/LineLength
12
+ TYPE_ENUM = [
13
+ TYPE_CHANGE_COUNT_BY = 'CHANGE_COUNT_BY'.freeze,
14
+ TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
15
+ ].freeze
16
+
17
+ # **[Required]** Action type to take
18
+ # @return [String]
19
+ attr_reader :type
20
+
21
+ # This attribute is required.
22
+ # @return [Integer]
23
+ attr_accessor :value
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ # rubocop:disable Style/SymbolLiteral
29
+ 'type': :'type',
30
+ 'value': :'value'
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
+ 'type': :'String',
40
+ 'value': :'Integer'
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 [String] :type The value to assign to the {#type} property
52
+ # @option attributes [Integer] :value The value to assign to the {#value} 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.type = attributes[:'type'] if attributes[:'type']
60
+
61
+ self.value = attributes[:'value'] if attributes[:'value']
62
+ end
63
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
64
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
65
+
66
+ # Custom attribute writer method checking allowed values (enum).
67
+ # @param [Object] type Object to be assigned
68
+ def type=(type)
69
+ # rubocop:disable Style/ConditionalAssignment
70
+ if type && !TYPE_ENUM.include?(type)
71
+ # rubocop: disable Metrics/LineLength
72
+ OCI.logger.debug("Unknown value for 'type' [" + type + "]. Mapping to 'TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
73
+ # rubocop: enable Metrics/LineLength
74
+ @type = TYPE_UNKNOWN_ENUM_VALUE
75
+ else
76
+ @type = type
77
+ end
78
+ # rubocop:enable Style/ConditionalAssignment
79
+ end
80
+
81
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
82
+
83
+
84
+ # Checks equality by comparing each attribute.
85
+ # @param [Object] other the other object to be compared
86
+ def ==(other)
87
+ return true if equal?(other)
88
+
89
+ self.class == other.class &&
90
+ type == other.type &&
91
+ value == other.value
92
+ end
93
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
94
+
95
+ # @see the `==` method
96
+ # @param [Object] other the other object to be compared
97
+ def eql?(other)
98
+ self == other
99
+ end
100
+
101
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
102
+
103
+
104
+ # Calculates hash code according to all attributes.
105
+ # @return [Fixnum] Hash code
106
+ def hash
107
+ [type, value].hash
108
+ end
109
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
110
+
111
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
112
+
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+
120
+ self.class.swagger_types.each_pair do |key, type|
121
+ if type =~ /^Array<(.*)>/i
122
+ # check to ensure the input is an array given that the the attribute
123
+ # is documented as an array but the input is not
124
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
125
+ public_method("#{key}=").call(
126
+ attributes[self.class.attribute_map[key]]
127
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
128
+ )
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ public_method("#{key}=").call(
132
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
133
+ )
134
+ end
135
+ # or else data not found in attributes(hash), not an issue as the data can be optional
136
+ end
137
+
138
+ self
139
+ end
140
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
141
+
142
+ # Returns the string representation of the object
143
+ # @return [String] String presentation of the object
144
+ def to_s
145
+ to_hash.to_s
146
+ end
147
+
148
+ # Returns the object in the form of hash
149
+ # @return [Hash] Returns the object in the form of hash
150
+ def to_hash
151
+ hash = {}
152
+ self.class.attribute_map.each_pair do |attr, param|
153
+ value = public_method(attr).call
154
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
155
+
156
+ hash[param] = _to_hash(value)
157
+ end
158
+ hash
159
+ end
160
+
161
+ private
162
+
163
+ # Outputs non-array value in the form of hash
164
+ # For object, use to_hash. Otherwise, just return the value
165
+ # @param [Object] value Any valid value
166
+ # @return [Hash] Returns the value in the form of hash
167
+ def _to_hash(value)
168
+ if value.is_a?(Array)
169
+ value.compact.map { |v| _to_hash(v) }
170
+ elsif value.is_a?(Hash)
171
+ {}.tap do |hash|
172
+ value.each { |k, v| hash[k] = _to_hash(v) }
173
+ end
174
+ elsif value.respond_to? :to_hash
175
+ value.to_hash
176
+ else
177
+ value
178
+ end
179
+ end
180
+ end
181
+ end
182
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,282 @@
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
+ # AutoScalingConfiguration model.
8
+ class Autoscaling::Models::AutoScalingConfiguration # rubocop:disable Metrics/LineLength
9
+ # **[Required]** The OCID of the compartment containing the AutoScalingConfiguration.
10
+ #
11
+ # @return [String]
12
+ attr_accessor :compartment_id
13
+
14
+ # Defined tags for this resource. Each key is predefined and scoped to a
15
+ # namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
16
+ #
17
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
18
+ #
19
+ # @return [Hash<String, Hash<String, Object>>]
20
+ attr_accessor :defined_tags
21
+
22
+ # A user-friendly name for the AutoScalingConfiguration. Does not have to be unique, and it's changeable.
23
+ # Avoid entering confidential information.
24
+ #
25
+ # @return [String]
26
+ attr_accessor :display_name
27
+
28
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
29
+ # predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
30
+ #
31
+ # Example: `{\"Department\": \"Finance\"}`
32
+ #
33
+ # @return [Hash<String, String>]
34
+ attr_accessor :freeform_tags
35
+
36
+ # **[Required]** The OCID of the AutoScalingConfiguration
37
+ # @return [String]
38
+ attr_accessor :id
39
+
40
+ # The minimum period of time between scaling actions. The default is 300 seconds.
41
+ #
42
+ # @return [Integer]
43
+ attr_accessor :cool_down_in_seconds
44
+
45
+ # If the AutoScalingConfiguration is enabled
46
+ # @return [BOOLEAN]
47
+ attr_accessor :is_enabled
48
+
49
+ # This attribute is required.
50
+ # @return [OCI::Autoscaling::Models::Resource]
51
+ attr_accessor :resource
52
+
53
+ # **[Required]** AutoScalingConfiguration policy definitions
54
+ #
55
+ # @return [Array<OCI::Autoscaling::Models::AutoScalingPolicy>]
56
+ attr_accessor :policies
57
+
58
+ # **[Required]** The date and time the AutoScalingConfiguration was created, in the format defined by RFC3339.
59
+ # Example: `2016-08-25T21:10:29.600Z`
60
+ #
61
+ # @return [DateTime]
62
+ attr_accessor :time_created
63
+
64
+ # Attribute mapping from ruby-style variable name to JSON key.
65
+ def self.attribute_map
66
+ {
67
+ # rubocop:disable Style/SymbolLiteral
68
+ 'compartment_id': :'compartmentId',
69
+ 'defined_tags': :'definedTags',
70
+ 'display_name': :'displayName',
71
+ 'freeform_tags': :'freeformTags',
72
+ 'id': :'id',
73
+ 'cool_down_in_seconds': :'coolDownInSeconds',
74
+ 'is_enabled': :'isEnabled',
75
+ 'resource': :'resource',
76
+ 'policies': :'policies',
77
+ 'time_created': :'timeCreated'
78
+ # rubocop:enable Style/SymbolLiteral
79
+ }
80
+ end
81
+
82
+ # Attribute type mapping.
83
+ def self.swagger_types
84
+ {
85
+ # rubocop:disable Style/SymbolLiteral
86
+ 'compartment_id': :'String',
87
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
88
+ 'display_name': :'String',
89
+ 'freeform_tags': :'Hash<String, String>',
90
+ 'id': :'String',
91
+ 'cool_down_in_seconds': :'Integer',
92
+ 'is_enabled': :'BOOLEAN',
93
+ 'resource': :'OCI::Autoscaling::Models::Resource',
94
+ 'policies': :'Array<OCI::Autoscaling::Models::AutoScalingPolicy>',
95
+ 'time_created': :'DateTime'
96
+ # rubocop:enable Style/SymbolLiteral
97
+ }
98
+ end
99
+
100
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
101
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
102
+
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
107
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
108
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
109
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
110
+ # @option attributes [String] :id The value to assign to the {#id} property
111
+ # @option attributes [Integer] :cool_down_in_seconds The value to assign to the {#cool_down_in_seconds} property
112
+ # @option attributes [BOOLEAN] :is_enabled The value to assign to the {#is_enabled} property
113
+ # @option attributes [OCI::Autoscaling::Models::Resource] :resource The value to assign to the {#resource} property
114
+ # @option attributes [Array<OCI::Autoscaling::Models::AutoScalingPolicy>] :policies The value to assign to the {#policies} property
115
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
116
+ def initialize(attributes = {})
117
+ return unless attributes.is_a?(Hash)
118
+
119
+ # convert string to symbol for hash key
120
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
121
+
122
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
123
+
124
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
125
+
126
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
127
+
128
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
129
+
130
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
131
+
132
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
133
+
134
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
135
+
136
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
137
+
138
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
139
+
140
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
141
+
142
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
143
+
144
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
145
+
146
+ self.id = attributes[:'id'] if attributes[:'id']
147
+
148
+ self.cool_down_in_seconds = attributes[:'coolDownInSeconds'] if attributes[:'coolDownInSeconds']
149
+
150
+ raise 'You cannot provide both :coolDownInSeconds and :cool_down_in_seconds' if attributes.key?(:'coolDownInSeconds') && attributes.key?(:'cool_down_in_seconds')
151
+
152
+ self.cool_down_in_seconds = attributes[:'cool_down_in_seconds'] if attributes[:'cool_down_in_seconds']
153
+
154
+ self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?
155
+
156
+ raise 'You cannot provide both :isEnabled and :is_enabled' if attributes.key?(:'isEnabled') && attributes.key?(:'is_enabled')
157
+
158
+ self.is_enabled = attributes[:'is_enabled'] unless attributes[:'is_enabled'].nil?
159
+
160
+ self.resource = attributes[:'resource'] if attributes[:'resource']
161
+
162
+ self.policies = attributes[:'policies'] if attributes[:'policies']
163
+
164
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
165
+
166
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
167
+
168
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
169
+ end
170
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
171
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
172
+
173
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
174
+
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] other the other object to be compared
178
+ def ==(other)
179
+ return true if equal?(other)
180
+
181
+ self.class == other.class &&
182
+ compartment_id == other.compartment_id &&
183
+ defined_tags == other.defined_tags &&
184
+ display_name == other.display_name &&
185
+ freeform_tags == other.freeform_tags &&
186
+ id == other.id &&
187
+ cool_down_in_seconds == other.cool_down_in_seconds &&
188
+ is_enabled == other.is_enabled &&
189
+ resource == other.resource &&
190
+ policies == other.policies &&
191
+ time_created == other.time_created
192
+ end
193
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
194
+
195
+ # @see the `==` method
196
+ # @param [Object] other the other object to be compared
197
+ def eql?(other)
198
+ self == other
199
+ end
200
+
201
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
202
+
203
+
204
+ # Calculates hash code according to all attributes.
205
+ # @return [Fixnum] Hash code
206
+ def hash
207
+ [compartment_id, defined_tags, display_name, freeform_tags, id, cool_down_in_seconds, is_enabled, resource, policies, time_created].hash
208
+ end
209
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
210
+
211
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
212
+
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def build_from_hash(attributes)
218
+ return nil unless attributes.is_a?(Hash)
219
+
220
+ self.class.swagger_types.each_pair do |key, type|
221
+ if type =~ /^Array<(.*)>/i
222
+ # check to ensure the input is an array given that the the attribute
223
+ # is documented as an array but the input is not
224
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
225
+ public_method("#{key}=").call(
226
+ attributes[self.class.attribute_map[key]]
227
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
228
+ )
229
+ end
230
+ elsif !attributes[self.class.attribute_map[key]].nil?
231
+ public_method("#{key}=").call(
232
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
233
+ )
234
+ end
235
+ # or else data not found in attributes(hash), not an issue as the data can be optional
236
+ end
237
+
238
+ self
239
+ end
240
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
241
+
242
+ # Returns the string representation of the object
243
+ # @return [String] String presentation of the object
244
+ def to_s
245
+ to_hash.to_s
246
+ end
247
+
248
+ # Returns the object in the form of hash
249
+ # @return [Hash] Returns the object in the form of hash
250
+ def to_hash
251
+ hash = {}
252
+ self.class.attribute_map.each_pair do |attr, param|
253
+ value = public_method(attr).call
254
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ private
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+ end
281
+ end
282
+ # rubocop:enable Lint/UnneededCopDisableDirective