oci 2.5.9 → 2.5.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/autoscaling/auto_scaling_client.rb +73 -0
  4. data/lib/oci/autoscaling/autoscaling.rb +1 -0
  5. data/lib/oci/autoscaling/models/change_auto_scaling_compartment_details.rb +154 -0
  6. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +0 -1
  7. data/lib/oci/container_engine/models/work_request_error.rb +0 -1
  8. data/lib/oci/core/blockstorage_client.rb +342 -0
  9. data/lib/oci/core/compute_client.rb +77 -5
  10. data/lib/oci/core/compute_client_composite_operations.rb +3 -3
  11. data/lib/oci/core/compute_management_client.rb +211 -0
  12. data/lib/oci/core/core.rb +27 -0
  13. data/lib/oci/core/models/add_network_security_group_security_rules_details.rb +153 -0
  14. data/lib/oci/core/models/add_security_rule_details.rb +388 -0
  15. data/lib/oci/core/models/added_network_security_group_security_rules.rb +153 -0
  16. data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +153 -0
  17. data/lib/oci/core/models/change_boot_volume_compartment_details.rb +153 -0
  18. data/lib/oci/core/models/change_image_compartment_details.rb +154 -0
  19. data/lib/oci/core/models/change_instance_configuration_compartment_details.rb +155 -0
  20. data/lib/oci/core/models/change_instance_pool_compartment_details.rb +155 -0
  21. data/lib/oci/core/models/change_nat_gateway_compartment_details.rb +153 -0
  22. data/lib/oci/core/models/change_route_table_compartment_details.rb +155 -0
  23. data/lib/oci/core/models/change_security_list_compartment_details.rb +155 -0
  24. data/lib/oci/core/models/change_service_gateway_compartment_details.rb +155 -0
  25. data/lib/oci/core/models/change_subnet_compartment_details.rb +155 -0
  26. data/lib/oci/core/models/change_vcn_compartment_details.rb +155 -0
  27. data/lib/oci/core/models/change_volume_backup_compartment_details.rb +153 -0
  28. data/lib/oci/core/models/change_volume_compartment_details.rb +153 -0
  29. data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +153 -0
  30. data/lib/oci/core/models/change_volume_group_compartment_details.rb +153 -0
  31. data/lib/oci/core/models/create_network_security_group_details.rb +223 -0
  32. data/lib/oci/core/models/create_vnic_details.rb +18 -1
  33. data/lib/oci/core/models/image.rb +2 -1
  34. data/lib/oci/core/models/instance_configuration.rb +3 -1
  35. data/lib/oci/core/models/instance_configuration_create_vnic_details.rb +18 -1
  36. data/lib/oci/core/models/instance_configuration_instance_source_via_image_details.rb +15 -1
  37. data/lib/oci/core/models/instance_configuration_summary.rb +3 -3
  38. data/lib/oci/core/models/instance_pool.rb +4 -1
  39. data/lib/oci/core/models/instance_pool_summary.rb +3 -3
  40. data/lib/oci/core/models/network_security_group.rb +324 -0
  41. data/lib/oci/core/models/network_security_group_vnic.rb +188 -0
  42. data/lib/oci/core/models/remove_network_security_group_security_rules_details.rb +154 -0
  43. data/lib/oci/core/models/security_list.rb +5 -0
  44. data/lib/oci/core/models/security_rule.rb +455 -0
  45. data/lib/oci/core/models/update_network_security_group_details.rb +189 -0
  46. data/lib/oci/core/models/update_network_security_group_security_rules_details.rb +153 -0
  47. data/lib/oci/core/models/update_security_rule_details.rb +404 -0
  48. data/lib/oci/core/models/update_vnic_details.rb +20 -1
  49. data/lib/oci/core/models/updated_network_security_group_security_rules.rb +153 -0
  50. data/lib/oci/core/models/vnic.rb +18 -1
  51. data/lib/oci/core/virtual_network_client.rb +1228 -132
  52. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  53. data/lib/oci/database/database.rb +19 -0
  54. data/lib/oci/database/database_client.rb +1066 -46
  55. data/lib/oci/database/database_client_composite_operations.rb +317 -0
  56. data/lib/oci/database/models/autonomous_container_database.rb +416 -0
  57. data/lib/oci/database/models/autonomous_container_database_backup_config.rb +157 -0
  58. data/lib/oci/database/models/autonomous_container_database_summary.rb +420 -0
  59. data/lib/oci/database/models/autonomous_database.rb +58 -1
  60. data/lib/oci/database/models/autonomous_database_backup.rb +16 -1
  61. data/lib/oci/database/models/autonomous_database_backup_summary.rb +16 -1
  62. data/lib/oci/database/models/autonomous_database_connection_strings.rb +11 -1
  63. data/lib/oci/database/models/autonomous_database_connection_urls.rb +170 -0
  64. data/lib/oci/database/models/autonomous_database_summary.rb +58 -1
  65. data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +224 -0
  66. data/lib/oci/database/models/autonomous_exadata_infrastructure.rb +419 -0
  67. data/lib/oci/database/models/autonomous_exadata_infrastructure_maintenance_window.rb +186 -0
  68. data/lib/oci/database/models/autonomous_exadata_infrastructure_shape_summary.rb +224 -0
  69. data/lib/oci/database/models/autonomous_exadata_infrastructure_summary.rb +436 -0
  70. data/lib/oci/database/models/backup.rb +1 -0
  71. data/lib/oci/database/models/backup_summary.rb +1 -0
  72. data/lib/oci/database/models/create_autonomous_container_database_details.rb +284 -0
  73. data/lib/oci/database/models/create_autonomous_database_base.rb +46 -1
  74. data/lib/oci/database/models/create_autonomous_database_clone_details.rb +13 -1
  75. data/lib/oci/database/models/create_autonomous_database_details.rb +13 -1
  76. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +34 -1
  77. data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +1 -1
  78. data/lib/oci/database/models/day_of_week.rb +174 -0
  79. data/lib/oci/database/models/db_system.rb +34 -1
  80. data/lib/oci/database/models/db_system_summary.rb +34 -1
  81. data/lib/oci/database/models/launch_autonomous_exadata_infrastructure_details.rb +304 -0
  82. data/lib/oci/database/models/launch_db_system_base.rb +35 -2
  83. data/lib/oci/database/models/launch_db_system_details.rb +11 -2
  84. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +11 -2
  85. data/lib/oci/database/models/maintenance_run.rb +392 -0
  86. data/lib/oci/database/models/maintenance_run_summary.rb +395 -0
  87. data/lib/oci/database/models/maintenance_window.rb +226 -0
  88. data/lib/oci/database/models/month.rb +179 -0
  89. data/lib/oci/database/models/restore_autonomous_database_details.rb +30 -4
  90. data/lib/oci/database/models/update_autonomous_container_database_details.rb +230 -0
  91. data/lib/oci/database/models/update_autonomous_database_details.rb +18 -1
  92. data/lib/oci/database/models/update_autonomous_exadata_infrastructure_details.rb +203 -0
  93. data/lib/oci/database/models/update_db_system_details.rb +37 -4
  94. data/lib/oci/database/models/update_maintenance_run_details.rb +154 -0
  95. data/lib/oci/email/email.rb +1 -0
  96. data/lib/oci/email/email_client.rb +62 -0
  97. data/lib/oci/email/models/change_sender_compartment_details.rb +157 -0
  98. data/lib/oci/key_management/key_management.rb +1 -0
  99. data/lib/oci/key_management/kms_crypto_client.rb +4 -4
  100. data/lib/oci/key_management/kms_management_client.rb +161 -10
  101. data/lib/oci/key_management/kms_management_client_composite_operations.rb +79 -0
  102. data/lib/oci/key_management/kms_vault_client.rb +16 -11
  103. data/lib/oci/key_management/models/key.rb +17 -1
  104. data/lib/oci/key_management/models/schedule_key_deletion_details.rb +156 -0
  105. data/lib/oci/load_balancer/load_balancer.rb +1 -0
  106. data/lib/oci/load_balancer/load_balancer_client.rb +64 -0
  107. data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
  108. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +16 -1
  109. data/lib/oci/load_balancer/models/load_balancer.rb +16 -1
  110. data/lib/oci/load_balancer/models/remove_http_request_header_rule.rb +1 -1
  111. data/lib/oci/load_balancer/models/remove_http_response_header_rule.rb +1 -1
  112. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +9 -5
  113. data/lib/oci/load_balancer/models/update_backend_set_details.rb +2 -0
  114. data/lib/oci/load_balancer/models/update_network_security_groups_details.rb +154 -0
  115. data/lib/oci/monitoring/models/metric.rb +1 -0
  116. data/lib/oci/object_storage/models/work_request_error.rb +1 -0
  117. data/lib/oci/resource_manager/models/change_stack_compartment_details.rb +155 -0
  118. data/lib/oci/resource_manager/models/work_request.rb +293 -0
  119. data/lib/oci/resource_manager/models/work_request_error.rb +170 -0
  120. data/lib/oci/resource_manager/models/work_request_log_entry.rb +159 -0
  121. data/lib/oci/resource_manager/models/work_request_resource.rb +217 -0
  122. data/lib/oci/resource_manager/models/work_request_summary.rb +254 -0
  123. data/lib/oci/resource_manager/resource_manager.rb +6 -0
  124. data/lib/oci/resource_manager/resource_manager_client.rb +338 -0
  125. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +50 -0
  126. data/lib/oci/streaming/stream_admin_client.rb +2 -2
  127. data/lib/oci/streaming/stream_client.rb +1 -1
  128. data/lib/oci/version.rb +1 -1
  129. metadata +58 -2
@@ -0,0 +1,186 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # Autonomous Exadata Infrastructure maintenance window details for quarterly patching.
8
+ class Database::Models::AutonomousExadataInfrastructureMaintenanceWindow
9
+ DAY_OF_WEEK_ENUM = [
10
+ DAY_OF_WEEK_ANY = 'ANY'.freeze,
11
+ DAY_OF_WEEK_SUNDAY = 'SUNDAY'.freeze,
12
+ DAY_OF_WEEK_MONDAY = 'MONDAY'.freeze,
13
+ DAY_OF_WEEK_TUESDAY = 'TUESDAY'.freeze,
14
+ DAY_OF_WEEK_WEDNESDAY = 'WEDNESDAY'.freeze,
15
+ DAY_OF_WEEK_THURSDAY = 'THURSDAY'.freeze,
16
+ DAY_OF_WEEK_FRIDAY = 'FRIDAY'.freeze,
17
+ DAY_OF_WEEK_SATURDAY = 'SATURDAY'.freeze
18
+ ].freeze
19
+
20
+ # **[Required]** Day of the week that the patch should be applied to the Autonomous Exadata Infrastructure. Patches are applied during the first week of the quarter.
21
+ # @return [String]
22
+ attr_reader :day_of_week
23
+
24
+ # Hour of the day that the patch should be applied.
25
+ # @return [Integer]
26
+ attr_accessor :hour_of_day
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ # rubocop:disable Style/SymbolLiteral
32
+ 'day_of_week': :'dayOfWeek',
33
+ 'hour_of_day': :'hourOfDay'
34
+ # rubocop:enable Style/SymbolLiteral
35
+ }
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.swagger_types
40
+ {
41
+ # rubocop:disable Style/SymbolLiteral
42
+ 'day_of_week': :'String',
43
+ 'hour_of_day': :'Integer'
44
+ # rubocop:enable Style/SymbolLiteral
45
+ }
46
+ end
47
+
48
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
49
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
50
+
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ # @option attributes [String] :day_of_week The value to assign to the {#day_of_week} property
55
+ # @option attributes [Integer] :hour_of_day The value to assign to the {#hour_of_day} property
56
+ def initialize(attributes = {})
57
+ return unless attributes.is_a?(Hash)
58
+
59
+ # convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
61
+
62
+ self.day_of_week = attributes[:'dayOfWeek'] if attributes[:'dayOfWeek']
63
+
64
+ raise 'You cannot provide both :dayOfWeek and :day_of_week' if attributes.key?(:'dayOfWeek') && attributes.key?(:'day_of_week')
65
+
66
+ self.day_of_week = attributes[:'day_of_week'] if attributes[:'day_of_week']
67
+
68
+ self.hour_of_day = attributes[:'hourOfDay'] if attributes[:'hourOfDay']
69
+
70
+ raise 'You cannot provide both :hourOfDay and :hour_of_day' if attributes.key?(:'hourOfDay') && attributes.key?(:'hour_of_day')
71
+
72
+ self.hour_of_day = attributes[:'hour_of_day'] if attributes[:'hour_of_day']
73
+ end
74
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
75
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
76
+
77
+ # Custom attribute writer method checking allowed values (enum).
78
+ # @param [Object] day_of_week Object to be assigned
79
+ def day_of_week=(day_of_week)
80
+ raise "Invalid value for 'day_of_week': this must be one of the values in DAY_OF_WEEK_ENUM." if day_of_week && !DAY_OF_WEEK_ENUM.include?(day_of_week)
81
+
82
+ @day_of_week = day_of_week
83
+ end
84
+
85
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
86
+
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] other the other object to be compared
90
+ def ==(other)
91
+ return true if equal?(other)
92
+
93
+ self.class == other.class &&
94
+ day_of_week == other.day_of_week &&
95
+ hour_of_day == other.hour_of_day
96
+ end
97
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
98
+
99
+ # @see the `==` method
100
+ # @param [Object] other the other object to be compared
101
+ def eql?(other)
102
+ self == other
103
+ end
104
+
105
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
106
+
107
+
108
+ # Calculates hash code according to all attributes.
109
+ # @return [Fixnum] Hash code
110
+ def hash
111
+ [day_of_week, hour_of_day].hash
112
+ end
113
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
114
+
115
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
116
+
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+
124
+ self.class.swagger_types.each_pair do |key, type|
125
+ if type =~ /^Array<(.*)>/i
126
+ # check to ensure the input is an array given that the the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ public_method("#{key}=").call(
130
+ attributes[self.class.attribute_map[key]]
131
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
132
+ )
133
+ end
134
+ elsif !attributes[self.class.attribute_map[key]].nil?
135
+ public_method("#{key}=").call(
136
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
137
+ )
138
+ end
139
+ # or else data not found in attributes(hash), not an issue as the data can be optional
140
+ end
141
+
142
+ self
143
+ end
144
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
145
+
146
+ # Returns the string representation of the object
147
+ # @return [String] String presentation of the object
148
+ def to_s
149
+ to_hash.to_s
150
+ end
151
+
152
+ # Returns the object in the form of hash
153
+ # @return [Hash] Returns the object in the form of hash
154
+ def to_hash
155
+ hash = {}
156
+ self.class.attribute_map.each_pair do |attr, param|
157
+ value = public_method(attr).call
158
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
159
+
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ private
166
+
167
+ # Outputs non-array value in the form of hash
168
+ # For object, use to_hash. Otherwise, just return the value
169
+ # @param [Object] value Any valid value
170
+ # @return [Hash] Returns the value in the form of hash
171
+ def _to_hash(value)
172
+ if value.is_a?(Array)
173
+ value.compact.map { |v| _to_hash(v) }
174
+ elsif value.is_a?(Hash)
175
+ {}.tap do |hash|
176
+ value.each { |k, v| hash[k] = _to_hash(v) }
177
+ end
178
+ elsif value.respond_to? :to_hash
179
+ value.to_hash
180
+ else
181
+ value
182
+ end
183
+ end
184
+ end
185
+ end
186
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,224 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # The shape of the Autonomous Exadata Infrastructure. The shape determines resources to allocate to the Autonomous Exadata Infrastructure (CPU cores, memory and storage).
8
+ #
9
+ # To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator.
10
+ # If you're an administrator who needs to write policies to give users access,
11
+ # see [Getting Started with Policies](https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm).
12
+ #
13
+ class Database::Models::AutonomousExadataInfrastructureShapeSummary
14
+ # **[Required]** The name of the shape used for the Autonomous Exadata Infrastructure.
15
+ # @return [String]
16
+ attr_accessor :name
17
+
18
+ # **[Required]** The maximum number of CPU cores that can be enabled on the Autonomous Exadata Infrastructure.
19
+ # @return [Integer]
20
+ attr_accessor :available_core_count
21
+
22
+ # The minimum number of CPU cores that can be enabled on the Autonomous Exadata Infrastructure.
23
+ # @return [Integer]
24
+ attr_accessor :minimum_core_count
25
+
26
+ # The increment in which core count can be increased or decreased.
27
+ # @return [Integer]
28
+ attr_accessor :core_count_increment
29
+
30
+ # The minimum number of nodes available for the shape.
31
+ # @return [Integer]
32
+ attr_accessor :minimum_node_count
33
+
34
+ # The maximum number of nodes available for the shape.
35
+ # @return [Integer]
36
+ attr_accessor :maximum_node_count
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ # rubocop:disable Style/SymbolLiteral
42
+ 'name': :'name',
43
+ 'available_core_count': :'availableCoreCount',
44
+ 'minimum_core_count': :'minimumCoreCount',
45
+ 'core_count_increment': :'coreCountIncrement',
46
+ 'minimum_node_count': :'minimumNodeCount',
47
+ 'maximum_node_count': :'maximumNodeCount'
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
+ 'name': :'String',
57
+ 'available_core_count': :'Integer',
58
+ 'minimum_core_count': :'Integer',
59
+ 'core_count_increment': :'Integer',
60
+ 'minimum_node_count': :'Integer',
61
+ 'maximum_node_count': :'Integer'
62
+ # rubocop:enable Style/SymbolLiteral
63
+ }
64
+ end
65
+
66
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
67
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
68
+
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ # @option attributes [String] :name The value to assign to the {#name} property
73
+ # @option attributes [Integer] :available_core_count The value to assign to the {#available_core_count} property
74
+ # @option attributes [Integer] :minimum_core_count The value to assign to the {#minimum_core_count} property
75
+ # @option attributes [Integer] :core_count_increment The value to assign to the {#core_count_increment} property
76
+ # @option attributes [Integer] :minimum_node_count The value to assign to the {#minimum_node_count} property
77
+ # @option attributes [Integer] :maximum_node_count The value to assign to the {#maximum_node_count} property
78
+ def initialize(attributes = {})
79
+ return unless attributes.is_a?(Hash)
80
+
81
+ # convert string to symbol for hash key
82
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
83
+
84
+ self.name = attributes[:'name'] if attributes[:'name']
85
+
86
+ self.available_core_count = attributes[:'availableCoreCount'] if attributes[:'availableCoreCount']
87
+
88
+ raise 'You cannot provide both :availableCoreCount and :available_core_count' if attributes.key?(:'availableCoreCount') && attributes.key?(:'available_core_count')
89
+
90
+ self.available_core_count = attributes[:'available_core_count'] if attributes[:'available_core_count']
91
+
92
+ self.minimum_core_count = attributes[:'minimumCoreCount'] if attributes[:'minimumCoreCount']
93
+
94
+ raise 'You cannot provide both :minimumCoreCount and :minimum_core_count' if attributes.key?(:'minimumCoreCount') && attributes.key?(:'minimum_core_count')
95
+
96
+ self.minimum_core_count = attributes[:'minimum_core_count'] if attributes[:'minimum_core_count']
97
+
98
+ self.core_count_increment = attributes[:'coreCountIncrement'] if attributes[:'coreCountIncrement']
99
+
100
+ raise 'You cannot provide both :coreCountIncrement and :core_count_increment' if attributes.key?(:'coreCountIncrement') && attributes.key?(:'core_count_increment')
101
+
102
+ self.core_count_increment = attributes[:'core_count_increment'] if attributes[:'core_count_increment']
103
+
104
+ self.minimum_node_count = attributes[:'minimumNodeCount'] if attributes[:'minimumNodeCount']
105
+
106
+ raise 'You cannot provide both :minimumNodeCount and :minimum_node_count' if attributes.key?(:'minimumNodeCount') && attributes.key?(:'minimum_node_count')
107
+
108
+ self.minimum_node_count = attributes[:'minimum_node_count'] if attributes[:'minimum_node_count']
109
+
110
+ self.maximum_node_count = attributes[:'maximumNodeCount'] if attributes[:'maximumNodeCount']
111
+
112
+ raise 'You cannot provide both :maximumNodeCount and :maximum_node_count' if attributes.key?(:'maximumNodeCount') && attributes.key?(:'maximum_node_count')
113
+
114
+ self.maximum_node_count = attributes[:'maximum_node_count'] if attributes[:'maximum_node_count']
115
+ end
116
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
117
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
118
+
119
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
120
+
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] other the other object to be compared
124
+ def ==(other)
125
+ return true if equal?(other)
126
+
127
+ self.class == other.class &&
128
+ name == other.name &&
129
+ available_core_count == other.available_core_count &&
130
+ minimum_core_count == other.minimum_core_count &&
131
+ core_count_increment == other.core_count_increment &&
132
+ minimum_node_count == other.minimum_node_count &&
133
+ maximum_node_count == other.maximum_node_count
134
+ end
135
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
136
+
137
+ # @see the `==` method
138
+ # @param [Object] other the other object to be compared
139
+ def eql?(other)
140
+ self == other
141
+ end
142
+
143
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
144
+
145
+
146
+ # Calculates hash code according to all attributes.
147
+ # @return [Fixnum] Hash code
148
+ def hash
149
+ [name, available_core_count, minimum_core_count, core_count_increment, minimum_node_count, maximum_node_count].hash
150
+ end
151
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
152
+
153
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
154
+
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+
162
+ self.class.swagger_types.each_pair do |key, type|
163
+ if type =~ /^Array<(.*)>/i
164
+ # check to ensure the input is an array given that the the attribute
165
+ # is documented as an array but the input is not
166
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
167
+ public_method("#{key}=").call(
168
+ attributes[self.class.attribute_map[key]]
169
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
170
+ )
171
+ end
172
+ elsif !attributes[self.class.attribute_map[key]].nil?
173
+ public_method("#{key}=").call(
174
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
175
+ )
176
+ end
177
+ # or else data not found in attributes(hash), not an issue as the data can be optional
178
+ end
179
+
180
+ self
181
+ end
182
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = public_method(attr).call
196
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
197
+
198
+ hash[param] = _to_hash(value)
199
+ end
200
+ hash
201
+ end
202
+
203
+ private
204
+
205
+ # Outputs non-array value in the form of hash
206
+ # For object, use to_hash. Otherwise, just return the value
207
+ # @param [Object] value Any valid value
208
+ # @return [Hash] Returns the value in the form of hash
209
+ def _to_hash(value)
210
+ if value.is_a?(Array)
211
+ value.compact.map { |v| _to_hash(v) }
212
+ elsif value.is_a?(Hash)
213
+ {}.tap do |hash|
214
+ value.each { |k, v| hash[k] = _to_hash(v) }
215
+ end
216
+ elsif value.respond_to? :to_hash
217
+ value.to_hash
218
+ else
219
+ value
220
+ end
221
+ end
222
+ end
223
+ end
224
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,436 @@
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, Metrics/LineLength
7
+ module OCI
8
+ # Infrastructure that enables the running of multiple Autonomous Databases within a dedicated DB system.
9
+ # For more information about Autonomous Exadata Infrastructure, see
10
+ # [Overview of Autonomous Database](https://docs.cloud.oracle.com/iaas/Content/Database/Concepts/adboverview.htm).
11
+ #
12
+ # To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see [Getting Started with Policies](https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm).
13
+ #
14
+ # For information about access control and compartments, see
15
+ # [Overview of the Identity Service](https://docs.cloud.oracle.com/Content/Identity/Concepts/overview.htm).
16
+ #
17
+ # For information about availability domains, see
18
+ # [Regions and Availability Domains](https://docs.cloud.oracle.com/Content/General/Concepts/regions.htm).
19
+ #
20
+ # To get a list of availability domains, use the ListAvailabilityDomains operation
21
+ # in the Identity service API.
22
+ #
23
+ class Database::Models::AutonomousExadataInfrastructureSummary
24
+ LIFECYCLE_STATE_ENUM = [
25
+ LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
26
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
27
+ LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
28
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze,
29
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze,
30
+ LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
31
+ LIFECYCLE_STATE_MAINTENANCE_IN_PROGRESS = 'MAINTENANCE_IN_PROGRESS'.freeze,
32
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
33
+ ].freeze
34
+
35
+ LICENSE_MODEL_ENUM = [
36
+ LICENSE_MODEL_LICENSE_INCLUDED = 'LICENSE_INCLUDED'.freeze,
37
+ LICENSE_MODEL_BRING_YOUR_OWN_LICENSE = 'BRING_YOUR_OWN_LICENSE'.freeze,
38
+ LICENSE_MODEL_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
39
+ ].freeze
40
+
41
+ # **[Required]** The OCID of the Autonomous Exadata Infrastructure.
42
+ # @return [String]
43
+ attr_accessor :id
44
+
45
+ # **[Required]** The OCID of the compartment.
46
+ # @return [String]
47
+ attr_accessor :compartment_id
48
+
49
+ # **[Required]** The user-friendly name for the Autonomous Exadata Infrastructure.
50
+ # @return [String]
51
+ attr_accessor :display_name
52
+
53
+ # **[Required]** The name of the availability domain that the Autonomous Exadata Infrastructure is located in.
54
+ # @return [String]
55
+ attr_accessor :availability_domain
56
+
57
+ # **[Required]** The OCID of the subnet the Autonomous Exadata Infrastructure is associated with.
58
+ #
59
+ # **Subnet Restrictions:**
60
+ # - For Autonomous Databases with Autonomous Exadata Infrastructure, do not use a subnet that overlaps with 192.168.128.0/20
61
+ #
62
+ # These subnets are used by the Oracle Clusterware private interconnect on the database instance.
63
+ # Specifying an overlapping subnet will cause the private interconnect to malfunction.
64
+ # This restriction applies to both the client subnet and backup subnet.
65
+ #
66
+ # @return [String]
67
+ attr_accessor :subnet_id
68
+
69
+ # **[Required]** The shape of the Autonomous Exadata Infrastructure. The shape determines resources to allocate to the Autonomous Exadata Infrastructure (CPU cores, memory and storage).
70
+ # @return [String]
71
+ attr_accessor :shape
72
+
73
+ # **[Required]** The host name for the Autonomous Exadata Infrastructure node.
74
+ # @return [String]
75
+ attr_accessor :hostname
76
+
77
+ # **[Required]** The domain name for the Autonomous Exadata Infrastructure.
78
+ # @return [String]
79
+ attr_accessor :domain
80
+
81
+ # **[Required]** The current lifecycle state of the Autonomous Exadata Infrastructure.
82
+ # @return [String]
83
+ attr_reader :lifecycle_state
84
+
85
+ # Additional information about the current lifecycle state of the Autonomous Exadata Infrastructure.
86
+ # @return [String]
87
+ attr_accessor :lifecycle_details
88
+
89
+ # The Oracle license model that applies to all databases in the Autonomous Exadata Infrastructure. The default is BRING_YOUR_OWN_LICENSE.
90
+ #
91
+ # @return [String]
92
+ attr_reader :license_model
93
+
94
+ # The date and time the Autonomous Exadata Infrastructure was created.
95
+ # @return [DateTime]
96
+ attr_accessor :time_created
97
+
98
+ # This attribute is required.
99
+ # @return [OCI::Database::Models::MaintenanceWindow]
100
+ attr_accessor :maintenance_window
101
+
102
+ # The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the last maintenance run.
103
+ # @return [String]
104
+ attr_accessor :last_maintenance_run_id
105
+
106
+ # The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the next maintenance run.
107
+ # @return [String]
108
+ attr_accessor :next_maintenance_run_id
109
+
110
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
111
+ # For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
112
+ #
113
+ # Example: `{\"Department\": \"Finance\"}`
114
+ #
115
+ # @return [Hash<String, String>]
116
+ attr_accessor :freeform_tags
117
+
118
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
119
+ # For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
120
+ #
121
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
122
+ #
123
+ # @return [Hash<String, Hash<String, Object>>]
124
+ attr_accessor :defined_tags
125
+
126
+ # Attribute mapping from ruby-style variable name to JSON key.
127
+ def self.attribute_map
128
+ {
129
+ # rubocop:disable Style/SymbolLiteral
130
+ 'id': :'id',
131
+ 'compartment_id': :'compartmentId',
132
+ 'display_name': :'displayName',
133
+ 'availability_domain': :'availabilityDomain',
134
+ 'subnet_id': :'subnetId',
135
+ 'shape': :'shape',
136
+ 'hostname': :'hostname',
137
+ 'domain': :'domain',
138
+ 'lifecycle_state': :'lifecycleState',
139
+ 'lifecycle_details': :'lifecycleDetails',
140
+ 'license_model': :'licenseModel',
141
+ 'time_created': :'timeCreated',
142
+ 'maintenance_window': :'maintenanceWindow',
143
+ 'last_maintenance_run_id': :'lastMaintenanceRunId',
144
+ 'next_maintenance_run_id': :'nextMaintenanceRunId',
145
+ 'freeform_tags': :'freeformTags',
146
+ 'defined_tags': :'definedTags'
147
+ # rubocop:enable Style/SymbolLiteral
148
+ }
149
+ end
150
+
151
+ # Attribute type mapping.
152
+ def self.swagger_types
153
+ {
154
+ # rubocop:disable Style/SymbolLiteral
155
+ 'id': :'String',
156
+ 'compartment_id': :'String',
157
+ 'display_name': :'String',
158
+ 'availability_domain': :'String',
159
+ 'subnet_id': :'String',
160
+ 'shape': :'String',
161
+ 'hostname': :'String',
162
+ 'domain': :'String',
163
+ 'lifecycle_state': :'String',
164
+ 'lifecycle_details': :'String',
165
+ 'license_model': :'String',
166
+ 'time_created': :'DateTime',
167
+ 'maintenance_window': :'OCI::Database::Models::MaintenanceWindow',
168
+ 'last_maintenance_run_id': :'String',
169
+ 'next_maintenance_run_id': :'String',
170
+ 'freeform_tags': :'Hash<String, String>',
171
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
172
+ # rubocop:enable Style/SymbolLiteral
173
+ }
174
+ end
175
+
176
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
177
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
178
+
179
+
180
+ # Initializes the object
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @option attributes [String] :id The value to assign to the {#id} property
183
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
184
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
185
+ # @option attributes [String] :availability_domain The value to assign to the {#availability_domain} property
186
+ # @option attributes [String] :subnet_id The value to assign to the {#subnet_id} property
187
+ # @option attributes [String] :shape The value to assign to the {#shape} property
188
+ # @option attributes [String] :hostname The value to assign to the {#hostname} property
189
+ # @option attributes [String] :domain The value to assign to the {#domain} property
190
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
191
+ # @option attributes [String] :lifecycle_details The value to assign to the {#lifecycle_details} property
192
+ # @option attributes [String] :license_model The value to assign to the {#license_model} property
193
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
194
+ # @option attributes [OCI::Database::Models::MaintenanceWindow] :maintenance_window The value to assign to the {#maintenance_window} property
195
+ # @option attributes [String] :last_maintenance_run_id The value to assign to the {#last_maintenance_run_id} property
196
+ # @option attributes [String] :next_maintenance_run_id The value to assign to the {#next_maintenance_run_id} property
197
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
198
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
199
+ def initialize(attributes = {})
200
+ return unless attributes.is_a?(Hash)
201
+
202
+ # convert string to symbol for hash key
203
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
204
+
205
+ self.id = attributes[:'id'] if attributes[:'id']
206
+
207
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
208
+
209
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
210
+
211
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
212
+
213
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
214
+
215
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
216
+
217
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
218
+
219
+ self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain']
220
+
221
+ raise 'You cannot provide both :availabilityDomain and :availability_domain' if attributes.key?(:'availabilityDomain') && attributes.key?(:'availability_domain')
222
+
223
+ self.availability_domain = attributes[:'availability_domain'] if attributes[:'availability_domain']
224
+
225
+ self.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId']
226
+
227
+ raise 'You cannot provide both :subnetId and :subnet_id' if attributes.key?(:'subnetId') && attributes.key?(:'subnet_id')
228
+
229
+ self.subnet_id = attributes[:'subnet_id'] if attributes[:'subnet_id']
230
+
231
+ self.shape = attributes[:'shape'] if attributes[:'shape']
232
+
233
+ self.hostname = attributes[:'hostname'] if attributes[:'hostname']
234
+
235
+ self.domain = attributes[:'domain'] if attributes[:'domain']
236
+
237
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
238
+
239
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
240
+
241
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
242
+
243
+ self.lifecycle_details = attributes[:'lifecycleDetails'] if attributes[:'lifecycleDetails']
244
+
245
+ raise 'You cannot provide both :lifecycleDetails and :lifecycle_details' if attributes.key?(:'lifecycleDetails') && attributes.key?(:'lifecycle_details')
246
+
247
+ self.lifecycle_details = attributes[:'lifecycle_details'] if attributes[:'lifecycle_details']
248
+
249
+ self.license_model = attributes[:'licenseModel'] if attributes[:'licenseModel']
250
+
251
+ raise 'You cannot provide both :licenseModel and :license_model' if attributes.key?(:'licenseModel') && attributes.key?(:'license_model')
252
+
253
+ self.license_model = attributes[:'license_model'] if attributes[:'license_model']
254
+
255
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
256
+
257
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
258
+
259
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
260
+
261
+ self.maintenance_window = attributes[:'maintenanceWindow'] if attributes[:'maintenanceWindow']
262
+
263
+ raise 'You cannot provide both :maintenanceWindow and :maintenance_window' if attributes.key?(:'maintenanceWindow') && attributes.key?(:'maintenance_window')
264
+
265
+ self.maintenance_window = attributes[:'maintenance_window'] if attributes[:'maintenance_window']
266
+
267
+ self.last_maintenance_run_id = attributes[:'lastMaintenanceRunId'] if attributes[:'lastMaintenanceRunId']
268
+
269
+ raise 'You cannot provide both :lastMaintenanceRunId and :last_maintenance_run_id' if attributes.key?(:'lastMaintenanceRunId') && attributes.key?(:'last_maintenance_run_id')
270
+
271
+ self.last_maintenance_run_id = attributes[:'last_maintenance_run_id'] if attributes[:'last_maintenance_run_id']
272
+
273
+ self.next_maintenance_run_id = attributes[:'nextMaintenanceRunId'] if attributes[:'nextMaintenanceRunId']
274
+
275
+ raise 'You cannot provide both :nextMaintenanceRunId and :next_maintenance_run_id' if attributes.key?(:'nextMaintenanceRunId') && attributes.key?(:'next_maintenance_run_id')
276
+
277
+ self.next_maintenance_run_id = attributes[:'next_maintenance_run_id'] if attributes[:'next_maintenance_run_id']
278
+
279
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
280
+
281
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
282
+
283
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
284
+
285
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
286
+
287
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
288
+
289
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
290
+ end
291
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
292
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
293
+
294
+ # Custom attribute writer method checking allowed values (enum).
295
+ # @param [Object] lifecycle_state Object to be assigned
296
+ def lifecycle_state=(lifecycle_state)
297
+ # rubocop:disable Style/ConditionalAssignment
298
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
299
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
300
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
301
+ else
302
+ @lifecycle_state = lifecycle_state
303
+ end
304
+ # rubocop:enable Style/ConditionalAssignment
305
+ end
306
+
307
+ # Custom attribute writer method checking allowed values (enum).
308
+ # @param [Object] license_model Object to be assigned
309
+ def license_model=(license_model)
310
+ # rubocop:disable Style/ConditionalAssignment
311
+ if license_model && !LICENSE_MODEL_ENUM.include?(license_model)
312
+ OCI.logger.debug("Unknown value for 'license_model' [" + license_model + "]. Mapping to 'LICENSE_MODEL_UNKNOWN_ENUM_VALUE'") if OCI.logger
313
+ @license_model = LICENSE_MODEL_UNKNOWN_ENUM_VALUE
314
+ else
315
+ @license_model = license_model
316
+ end
317
+ # rubocop:enable Style/ConditionalAssignment
318
+ end
319
+
320
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
321
+
322
+
323
+ # Checks equality by comparing each attribute.
324
+ # @param [Object] other the other object to be compared
325
+ def ==(other)
326
+ return true if equal?(other)
327
+
328
+ self.class == other.class &&
329
+ id == other.id &&
330
+ compartment_id == other.compartment_id &&
331
+ display_name == other.display_name &&
332
+ availability_domain == other.availability_domain &&
333
+ subnet_id == other.subnet_id &&
334
+ shape == other.shape &&
335
+ hostname == other.hostname &&
336
+ domain == other.domain &&
337
+ lifecycle_state == other.lifecycle_state &&
338
+ lifecycle_details == other.lifecycle_details &&
339
+ license_model == other.license_model &&
340
+ time_created == other.time_created &&
341
+ maintenance_window == other.maintenance_window &&
342
+ last_maintenance_run_id == other.last_maintenance_run_id &&
343
+ next_maintenance_run_id == other.next_maintenance_run_id &&
344
+ freeform_tags == other.freeform_tags &&
345
+ defined_tags == other.defined_tags
346
+ end
347
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
348
+
349
+ # @see the `==` method
350
+ # @param [Object] other the other object to be compared
351
+ def eql?(other)
352
+ self == other
353
+ end
354
+
355
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
356
+
357
+
358
+ # Calculates hash code according to all attributes.
359
+ # @return [Fixnum] Hash code
360
+ def hash
361
+ [id, compartment_id, display_name, availability_domain, subnet_id, shape, hostname, domain, lifecycle_state, lifecycle_details, license_model, time_created, maintenance_window, last_maintenance_run_id, next_maintenance_run_id, freeform_tags, defined_tags].hash
362
+ end
363
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
364
+
365
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
366
+
367
+
368
+ # Builds the object from hash
369
+ # @param [Hash] attributes Model attributes in the form of hash
370
+ # @return [Object] Returns the model itself
371
+ def build_from_hash(attributes)
372
+ return nil unless attributes.is_a?(Hash)
373
+
374
+ self.class.swagger_types.each_pair do |key, type|
375
+ if type =~ /^Array<(.*)>/i
376
+ # check to ensure the input is an array given that the the attribute
377
+ # is documented as an array but the input is not
378
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
379
+ public_method("#{key}=").call(
380
+ attributes[self.class.attribute_map[key]]
381
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
382
+ )
383
+ end
384
+ elsif !attributes[self.class.attribute_map[key]].nil?
385
+ public_method("#{key}=").call(
386
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
387
+ )
388
+ end
389
+ # or else data not found in attributes(hash), not an issue as the data can be optional
390
+ end
391
+
392
+ self
393
+ end
394
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
395
+
396
+ # Returns the string representation of the object
397
+ # @return [String] String presentation of the object
398
+ def to_s
399
+ to_hash.to_s
400
+ end
401
+
402
+ # Returns the object in the form of hash
403
+ # @return [Hash] Returns the object in the form of hash
404
+ def to_hash
405
+ hash = {}
406
+ self.class.attribute_map.each_pair do |attr, param|
407
+ value = public_method(attr).call
408
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
409
+
410
+ hash[param] = _to_hash(value)
411
+ end
412
+ hash
413
+ end
414
+
415
+ private
416
+
417
+ # Outputs non-array value in the form of hash
418
+ # For object, use to_hash. Otherwise, just return the value
419
+ # @param [Object] value Any valid value
420
+ # @return [Hash] Returns the value in the form of hash
421
+ def _to_hash(value)
422
+ if value.is_a?(Array)
423
+ value.compact.map { |v| _to_hash(v) }
424
+ elsif value.is_a?(Hash)
425
+ {}.tap do |hash|
426
+ value.each { |k, v| hash[k] = _to_hash(v) }
427
+ end
428
+ elsif value.respond_to? :to_hash
429
+ value.to_hash
430
+ else
431
+ value
432
+ end
433
+ end
434
+ end
435
+ end
436
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength