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,219 @@
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
+ # Represents the load balancer Backend that is configured for an instance pool instance.
9
+ class Core::Models::InstancePoolInstanceLoadBalancerBackend # rubocop:disable Metrics/LineLength
10
+ BACKEND_HEALTH_STATUS_ENUM = [
11
+ BACKEND_HEALTH_STATUS_OK = 'OK'.freeze,
12
+ BACKEND_HEALTH_STATUS_WARNING = 'WARNING'.freeze,
13
+ BACKEND_HEALTH_STATUS_CRITICAL = 'CRITICAL'.freeze,
14
+ BACKEND_HEALTH_STATUS_UNKNOWN = 'UNKNOWN'.freeze,
15
+ BACKEND_HEALTH_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
16
+ ].freeze
17
+
18
+ # **[Required]** The OCID of the load balancer attached to the pool.
19
+ # @return [String]
20
+ attr_accessor :load_balancer_id
21
+
22
+ # **[Required]** The name of the backend set on the load balancer.
23
+ # @return [String]
24
+ attr_accessor :backend_set_name
25
+
26
+ # **[Required]** The name of the backend in the backend set.
27
+ # @return [String]
28
+ attr_accessor :backend_name
29
+
30
+ # **[Required]** The health of the backend as observed by the load balancer.
31
+ # @return [String]
32
+ attr_reader :backend_health_status
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ # rubocop:disable Style/SymbolLiteral
38
+ 'load_balancer_id': :'loadBalancerId',
39
+ 'backend_set_name': :'backendSetName',
40
+ 'backend_name': :'backendName',
41
+ 'backend_health_status': :'backendHealthStatus'
42
+ # rubocop:enable Style/SymbolLiteral
43
+ }
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.swagger_types
48
+ {
49
+ # rubocop:disable Style/SymbolLiteral
50
+ 'load_balancer_id': :'String',
51
+ 'backend_set_name': :'String',
52
+ 'backend_name': :'String',
53
+ 'backend_health_status': :'String'
54
+ # rubocop:enable Style/SymbolLiteral
55
+ }
56
+ end
57
+
58
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
59
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
60
+
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ # @option attributes [String] :load_balancer_id The value to assign to the {#load_balancer_id} property
65
+ # @option attributes [String] :backend_set_name The value to assign to the {#backend_set_name} property
66
+ # @option attributes [String] :backend_name The value to assign to the {#backend_name} property
67
+ # @option attributes [String] :backend_health_status The value to assign to the {#backend_health_status} property
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
73
+
74
+ self.load_balancer_id = attributes[:'loadBalancerId'] if attributes[:'loadBalancerId']
75
+
76
+ raise 'You cannot provide both :loadBalancerId and :load_balancer_id' if attributes.key?(:'loadBalancerId') && attributes.key?(:'load_balancer_id')
77
+
78
+ self.load_balancer_id = attributes[:'load_balancer_id'] if attributes[:'load_balancer_id']
79
+
80
+ self.backend_set_name = attributes[:'backendSetName'] if attributes[:'backendSetName']
81
+
82
+ raise 'You cannot provide both :backendSetName and :backend_set_name' if attributes.key?(:'backendSetName') && attributes.key?(:'backend_set_name')
83
+
84
+ self.backend_set_name = attributes[:'backend_set_name'] if attributes[:'backend_set_name']
85
+
86
+ self.backend_name = attributes[:'backendName'] if attributes[:'backendName']
87
+
88
+ raise 'You cannot provide both :backendName and :backend_name' if attributes.key?(:'backendName') && attributes.key?(:'backend_name')
89
+
90
+ self.backend_name = attributes[:'backend_name'] if attributes[:'backend_name']
91
+
92
+ self.backend_health_status = attributes[:'backendHealthStatus'] if attributes[:'backendHealthStatus']
93
+
94
+ raise 'You cannot provide both :backendHealthStatus and :backend_health_status' if attributes.key?(:'backendHealthStatus') && attributes.key?(:'backend_health_status')
95
+
96
+ self.backend_health_status = attributes[:'backend_health_status'] if attributes[:'backend_health_status']
97
+ end
98
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
99
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
100
+
101
+ # Custom attribute writer method checking allowed values (enum).
102
+ # @param [Object] backend_health_status Object to be assigned
103
+ def backend_health_status=(backend_health_status)
104
+ # rubocop:disable Style/ConditionalAssignment
105
+ if backend_health_status && !BACKEND_HEALTH_STATUS_ENUM.include?(backend_health_status)
106
+ # rubocop: disable Metrics/LineLength
107
+ OCI.logger.debug("Unknown value for 'backend_health_status' [" + backend_health_status + "]. Mapping to 'BACKEND_HEALTH_STATUS_UNKNOWN_ENUM_VALUE'") if OCI.logger
108
+ # rubocop: enable Metrics/LineLength
109
+ @backend_health_status = BACKEND_HEALTH_STATUS_UNKNOWN_ENUM_VALUE
110
+ else
111
+ @backend_health_status = backend_health_status
112
+ end
113
+ # rubocop:enable Style/ConditionalAssignment
114
+ end
115
+
116
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
117
+
118
+
119
+ # Checks equality by comparing each attribute.
120
+ # @param [Object] other the other object to be compared
121
+ def ==(other)
122
+ return true if equal?(other)
123
+
124
+ self.class == other.class &&
125
+ load_balancer_id == other.load_balancer_id &&
126
+ backend_set_name == other.backend_set_name &&
127
+ backend_name == other.backend_name &&
128
+ backend_health_status == other.backend_health_status
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
+ [load_balancer_id, backend_set_name, backend_name, backend_health_status].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,253 @@
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
+ # Represents a load balancer that is attached to an instance pool.
9
+ class Core::Models::InstancePoolLoadBalancerAttachment # rubocop:disable Metrics/LineLength
10
+ LIFECYCLE_STATE_ENUM = [
11
+ LIFECYCLE_STATE_ATTACHING = 'ATTACHING'.freeze,
12
+ LIFECYCLE_STATE_ATTACHED = 'ATTACHED'.freeze,
13
+ LIFECYCLE_STATE_DETACHING = 'DETACHING'.freeze,
14
+ LIFECYCLE_STATE_DETACHED = 'DETACHED'.freeze,
15
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
16
+ ].freeze
17
+
18
+ # **[Required]** The OCID of the load balancer attachment.
19
+ # @return [String]
20
+ attr_accessor :id
21
+
22
+ # **[Required]** The OCID of the instance pool of the load balancer attachment.
23
+ # @return [String]
24
+ attr_accessor :instance_pool_id
25
+
26
+ # **[Required]** The OCID of the load balancer attached to the pool.
27
+ # @return [String]
28
+ attr_accessor :load_balancer_id
29
+
30
+ # **[Required]** The name of the backend set on the load balancer.
31
+ # @return [String]
32
+ attr_accessor :backend_set_name
33
+
34
+ # **[Required]** The port value used for the backends.
35
+ # @return [Integer]
36
+ attr_accessor :port
37
+
38
+ # **[Required]** Indicates which vnic on each instance in the pool should be used to associate with the load balancer. possible values are \"PrimaryVnic\" or the displayName of one of the secondary VNICs on the instance configuration that is associated to the instance pool.
39
+ # @return [String]
40
+ attr_accessor :vnic_selection
41
+
42
+ # **[Required]** The status of the interaction between the pool and the load balancer.
43
+ # @return [String]
44
+ attr_reader :lifecycle_state
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ # rubocop:disable Style/SymbolLiteral
50
+ 'id': :'id',
51
+ 'instance_pool_id': :'instancePoolId',
52
+ 'load_balancer_id': :'loadBalancerId',
53
+ 'backend_set_name': :'backendSetName',
54
+ 'port': :'port',
55
+ 'vnic_selection': :'vnicSelection',
56
+ 'lifecycle_state': :'lifecycleState'
57
+ # rubocop:enable Style/SymbolLiteral
58
+ }
59
+ end
60
+
61
+ # Attribute type mapping.
62
+ def self.swagger_types
63
+ {
64
+ # rubocop:disable Style/SymbolLiteral
65
+ 'id': :'String',
66
+ 'instance_pool_id': :'String',
67
+ 'load_balancer_id': :'String',
68
+ 'backend_set_name': :'String',
69
+ 'port': :'Integer',
70
+ 'vnic_selection': :'String',
71
+ 'lifecycle_state': :'String'
72
+ # rubocop:enable Style/SymbolLiteral
73
+ }
74
+ end
75
+
76
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
77
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
78
+
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ # @option attributes [String] :id The value to assign to the {#id} property
83
+ # @option attributes [String] :instance_pool_id The value to assign to the {#instance_pool_id} property
84
+ # @option attributes [String] :load_balancer_id The value to assign to the {#load_balancer_id} property
85
+ # @option attributes [String] :backend_set_name The value to assign to the {#backend_set_name} property
86
+ # @option attributes [Integer] :port The value to assign to the {#port} property
87
+ # @option attributes [String] :vnic_selection The value to assign to the {#vnic_selection} property
88
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
89
+ def initialize(attributes = {})
90
+ return unless attributes.is_a?(Hash)
91
+
92
+ # convert string to symbol for hash key
93
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
94
+
95
+ self.id = attributes[:'id'] if attributes[:'id']
96
+
97
+ self.instance_pool_id = attributes[:'instancePoolId'] if attributes[:'instancePoolId']
98
+
99
+ raise 'You cannot provide both :instancePoolId and :instance_pool_id' if attributes.key?(:'instancePoolId') && attributes.key?(:'instance_pool_id')
100
+
101
+ self.instance_pool_id = attributes[:'instance_pool_id'] if attributes[:'instance_pool_id']
102
+
103
+ self.load_balancer_id = attributes[:'loadBalancerId'] if attributes[:'loadBalancerId']
104
+
105
+ raise 'You cannot provide both :loadBalancerId and :load_balancer_id' if attributes.key?(:'loadBalancerId') && attributes.key?(:'load_balancer_id')
106
+
107
+ self.load_balancer_id = attributes[:'load_balancer_id'] if attributes[:'load_balancer_id']
108
+
109
+ self.backend_set_name = attributes[:'backendSetName'] if attributes[:'backendSetName']
110
+
111
+ raise 'You cannot provide both :backendSetName and :backend_set_name' if attributes.key?(:'backendSetName') && attributes.key?(:'backend_set_name')
112
+
113
+ self.backend_set_name = attributes[:'backend_set_name'] if attributes[:'backend_set_name']
114
+
115
+ self.port = attributes[:'port'] if attributes[:'port']
116
+
117
+ self.vnic_selection = attributes[:'vnicSelection'] if attributes[:'vnicSelection']
118
+
119
+ raise 'You cannot provide both :vnicSelection and :vnic_selection' if attributes.key?(:'vnicSelection') && attributes.key?(:'vnic_selection')
120
+
121
+ self.vnic_selection = attributes[:'vnic_selection'] if attributes[:'vnic_selection']
122
+
123
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
124
+
125
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
126
+
127
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
128
+ end
129
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
130
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
131
+
132
+ # Custom attribute writer method checking allowed values (enum).
133
+ # @param [Object] lifecycle_state Object to be assigned
134
+ def lifecycle_state=(lifecycle_state)
135
+ # rubocop:disable Style/ConditionalAssignment
136
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
137
+ # rubocop: disable Metrics/LineLength
138
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
139
+ # rubocop: enable Metrics/LineLength
140
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
141
+ else
142
+ @lifecycle_state = lifecycle_state
143
+ end
144
+ # rubocop:enable Style/ConditionalAssignment
145
+ end
146
+
147
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
148
+
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] other the other object to be compared
152
+ def ==(other)
153
+ return true if equal?(other)
154
+
155
+ self.class == other.class &&
156
+ id == other.id &&
157
+ instance_pool_id == other.instance_pool_id &&
158
+ load_balancer_id == other.load_balancer_id &&
159
+ backend_set_name == other.backend_set_name &&
160
+ port == other.port &&
161
+ vnic_selection == other.vnic_selection &&
162
+ lifecycle_state == other.lifecycle_state
163
+ end
164
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
165
+
166
+ # @see the `==` method
167
+ # @param [Object] other the other object to be compared
168
+ def eql?(other)
169
+ self == other
170
+ end
171
+
172
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
173
+
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Fixnum] Hash code
177
+ def hash
178
+ [id, instance_pool_id, load_balancer_id, backend_set_name, port, vnic_selection, lifecycle_state].hash
179
+ end
180
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
181
+
182
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
183
+
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def build_from_hash(attributes)
189
+ return nil unless attributes.is_a?(Hash)
190
+
191
+ self.class.swagger_types.each_pair do |key, type|
192
+ if type =~ /^Array<(.*)>/i
193
+ # check to ensure the input is an array given that the the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
196
+ public_method("#{key}=").call(
197
+ attributes[self.class.attribute_map[key]]
198
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
199
+ )
200
+ end
201
+ elsif !attributes[self.class.attribute_map[key]].nil?
202
+ public_method("#{key}=").call(
203
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
204
+ )
205
+ end
206
+ # or else data not found in attributes(hash), not an issue as the data can be optional
207
+ end
208
+
209
+ self
210
+ end
211
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
212
+
213
+ # Returns the string representation of the object
214
+ # @return [String] String presentation of the object
215
+ def to_s
216
+ to_hash.to_s
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = public_method(attr).call
225
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ private
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value)
239
+ if value.is_a?(Array)
240
+ value.compact.map { |v| _to_hash(v) }
241
+ elsif value.is_a?(Hash)
242
+ {}.tap do |hash|
243
+ value.each { |k, v| hash[k] = _to_hash(v) }
244
+ end
245
+ elsif value.respond_to? :to_hash
246
+ value.to_hash
247
+ else
248
+ value
249
+ end
250
+ end
251
+ end
252
+ end
253
+ # rubocop:enable Lint/UnneededCopDisableDirective