oci 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/lib/oci.rb +4 -0
- data/lib/oci/auth/federation_client.rb +4 -4
- data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +22 -16
- data/lib/oci/autoscaling/auto_scaling_client.rb +774 -0
- data/lib/oci/autoscaling/auto_scaling_client_composite_operations.rb +24 -0
- data/lib/oci/autoscaling/autoscaling.rb +38 -0
- data/lib/oci/autoscaling/models/action.rb +182 -0
- data/lib/oci/autoscaling/models/auto_scaling_configuration.rb +282 -0
- data/lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb +234 -0
- data/lib/oci/autoscaling/models/auto_scaling_policy.rb +222 -0
- data/lib/oci/autoscaling/models/auto_scaling_policy_summary.rb +179 -0
- data/lib/oci/autoscaling/models/capacity.rb +170 -0
- data/lib/oci/autoscaling/models/condition.rb +186 -0
- data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +256 -0
- data/lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb +196 -0
- data/lib/oci/autoscaling/models/create_condition_details.rb +176 -0
- data/lib/oci/autoscaling/models/create_threshold_policy_details.rb +166 -0
- data/lib/oci/autoscaling/models/instance_pool_resource.rb +148 -0
- data/lib/oci/autoscaling/models/metric.rb +186 -0
- data/lib/oci/autoscaling/models/resource.rb +177 -0
- data/lib/oci/autoscaling/models/threshold.rb +188 -0
- data/lib/oci/autoscaling/models/threshold_policy.rb +173 -0
- data/lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb +219 -0
- data/lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb +194 -0
- data/lib/oci/autoscaling/models/update_condition_details.rb +176 -0
- data/lib/oci/autoscaling/models/update_threshold_policy_details.rb +164 -0
- data/lib/oci/autoscaling/util.rb +2 -0
- data/lib/oci/core/blockstorage_client.rb +1 -1
- data/lib/oci/core/compute_client.rb +1 -1
- data/lib/oci/core/compute_management_client.rb +135 -1
- data/lib/oci/core/compute_management_client_composite_operations.rb +80 -0
- data/lib/oci/core/core.rb +8 -0
- data/lib/oci/core/models/attach_load_balancer_details.rb +191 -0
- data/lib/oci/core/models/create_instance_pool_details.rb +19 -4
- data/lib/oci/core/models/detach_load_balancer_details.rb +167 -0
- data/lib/oci/core/models/image.rb +14 -1
- data/lib/oci/core/models/instance.rb +18 -2
- data/lib/oci/core/models/instance_agent_config.rb +154 -0
- data/lib/oci/core/models/instance_agent_features.rb +154 -0
- data/lib/oci/core/models/instance_pool.rb +19 -4
- data/lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb +219 -0
- data/lib/oci/core/models/instance_pool_load_balancer_attachment.rb +253 -0
- data/lib/oci/core/models/instance_summary.rb +19 -4
- data/lib/oci/core/models/launch_instance_agent_config_details.rb +155 -0
- data/lib/oci/core/models/launch_instance_details.rb +14 -1
- data/lib/oci/core/models/update_instance_agent_config_details.rb +154 -0
- data/lib/oci/core/models/update_instance_details.rb +16 -1
- data/lib/oci/core/virtual_network_client.rb +1 -1
- data/lib/oci/database/database_client.rb +12 -14
- data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +3 -1
- data/lib/oci/database/models/autonomous_database_connection_strings.rb +3 -1
- data/lib/oci/database/models/create_data_guard_association_details.rb +2 -7
- data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +5 -1
- data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +4 -1
- data/lib/oci/database/models/database_summary.rb +1 -1
- data/lib/oci/database/models/db_node.rb +15 -1
- data/lib/oci/database/models/db_node_summary.rb +15 -1
- data/lib/oci/database/models/db_system.rb +15 -1
- data/lib/oci/database/models/db_system_summary.rb +15 -1
- data/lib/oci/database/models/db_version_summary.rb +1 -1
- data/lib/oci/database/models/launch_db_system_base.rb +33 -2
- data/lib/oci/database/models/launch_db_system_details.rb +5 -1
- data/lib/oci/database/models/launch_db_system_from_backup_details.rb +5 -1
- data/lib/oci/database/models/update_db_system_details.rb +1 -1
- data/lib/oci/identity/identity.rb +4 -0
- data/lib/oci/identity/identity_client.rb +468 -12
- data/lib/oci/identity/identity_client_composite_operations.rb +79 -0
- data/lib/oci/identity/models/change_tag_namespace_compartment_detail.rb +154 -0
- data/lib/oci/identity/models/create_identity_provider_details.rb +2 -1
- data/lib/oci/identity/models/mfa_totp_device.rb +279 -0
- data/lib/oci/identity/models/mfa_totp_device_summary.rb +267 -0
- data/lib/oci/identity/models/mfa_totp_token.rb +155 -0
- data/lib/oci/identity/models/tag_namespace_summary.rb +1 -1
- data/lib/oci/identity/models/user.rb +18 -4
- data/lib/oci/monitoring/models/aggregated_datapoint.rb +166 -0
- data/lib/oci/monitoring/models/alarm.rb +538 -0
- data/lib/oci/monitoring/models/alarm_history_collection.rb +183 -0
- data/lib/oci/monitoring/models/alarm_history_entry.rb +187 -0
- data/lib/oci/monitoring/models/alarm_status_summary.rb +277 -0
- data/lib/oci/monitoring/models/alarm_summary.rb +386 -0
- data/lib/oci/monitoring/models/create_alarm_details.rb +423 -0
- data/lib/oci/monitoring/models/datapoint.rb +179 -0
- data/lib/oci/monitoring/models/failed_metric_record.rb +166 -0
- data/lib/oci/monitoring/models/list_metrics_details.rb +271 -0
- data/lib/oci/monitoring/models/metric.rb +197 -0
- data/lib/oci/monitoring/models/metric_data.rb +243 -0
- data/lib/oci/monitoring/models/metric_data_details.rb +227 -0
- data/lib/oci/monitoring/models/post_metric_data_details.rb +194 -0
- data/lib/oci/monitoring/models/post_metric_data_response_details.rb +170 -0
- data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +229 -0
- data/lib/oci/monitoring/models/suppression.rb +196 -0
- data/lib/oci/monitoring/models/update_alarm_details.rb +423 -0
- data/lib/oci/monitoring/monitoring.rb +37 -0
- data/lib/oci/monitoring/monitoring_client.rb +923 -0
- data/lib/oci/monitoring/monitoring_client_composite_operations.rb +145 -0
- data/lib/oci/monitoring/util.rb +2 -0
- data/lib/oci/ons/models/backoff_retry_policy.rb +192 -0
- data/lib/oci/ons/models/confirmation_result.rb +221 -0
- data/lib/oci/ons/models/create_subscription_details.rb +238 -0
- data/lib/oci/ons/models/create_topic_details.rb +209 -0
- data/lib/oci/ons/models/delivery_policy.rb +153 -0
- data/lib/oci/ons/models/message_details.rb +163 -0
- data/lib/oci/ons/models/notification_topic.rb +302 -0
- data/lib/oci/ons/models/notification_topic_summary.rb +303 -0
- data/lib/oci/ons/models/publish_result.rb +168 -0
- data/lib/oci/ons/models/subscription.rb +273 -0
- data/lib/oci/ons/models/subscription_summary.rb +300 -0
- data/lib/oci/ons/models/topic_attributes_details.rb +184 -0
- data/lib/oci/ons/models/update_subscription_details.rb +188 -0
- data/lib/oci/ons/notification_control_plane_client.rb +463 -0
- data/lib/oci/ons/notification_control_plane_client_composite_operations.rb +24 -0
- data/lib/oci/ons/notification_data_plane_client.rb +680 -0
- data/lib/oci/ons/notification_data_plane_client_composite_operations.rb +104 -0
- data/lib/oci/ons/ons.rb +33 -0
- data/lib/oci/ons/util.rb +2 -0
- data/lib/oci/regions.rb +5 -0
- data/lib/oci/resource_manager/models/apply_job_plan_resolution.rb +189 -0
- data/lib/oci/resource_manager/models/config_source.rb +208 -0
- data/lib/oci/resource_manager/models/create_config_source_details.rb +187 -0
- data/lib/oci/resource_manager/models/create_job_details.rb +225 -0
- data/lib/oci/resource_manager/models/create_stack_details.rb +239 -0
- data/lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb +166 -0
- data/lib/oci/resource_manager/models/failure_details.rb +185 -0
- data/lib/oci/resource_manager/models/job.rb +399 -0
- data/lib/oci/resource_manager/models/job_summary.rb +311 -0
- data/lib/oci/resource_manager/models/log_entry.rb +225 -0
- data/lib/oci/resource_manager/models/stack.rb +305 -0
- data/lib/oci/resource_manager/models/stack_summary.rb +249 -0
- data/lib/oci/resource_manager/models/update_config_source_details.rb +184 -0
- data/lib/oci/resource_manager/models/update_job_details.rb +188 -0
- data/lib/oci/resource_manager/models/update_stack_details.rb +225 -0
- data/lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb +164 -0
- data/lib/oci/resource_manager/models/zip_upload_config_source.rb +149 -0
- data/lib/oci/resource_manager/resource_manager.rb +36 -0
- data/lib/oci/resource_manager/resource_manager_client.rb +1264 -0
- data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +263 -0
- data/lib/oci/resource_manager/util.rb +2 -0
- data/lib/oci/version.rb +1 -1
- metadata +100 -2
@@ -0,0 +1,305 @@
|
|
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 stack object. Stacks represent definitions of groups of Oracle Cloud Infrastructure
|
9
|
+
# resources that you can act upon as a group. You take action on stacks by using jobs.
|
10
|
+
#
|
11
|
+
class ResourceManager::Models::Stack # rubocop:disable Metrics/LineLength
|
12
|
+
LIFECYCLE_STATE_ENUM = [
|
13
|
+
LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
|
14
|
+
LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
|
15
|
+
LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
|
16
|
+
LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
|
17
|
+
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
|
18
|
+
].freeze
|
19
|
+
|
20
|
+
# Unique identifier (OCID) for the stack.
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :id
|
23
|
+
|
24
|
+
# Unique identifier (OCID) for the compartment where the stack is located.
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :compartment_id
|
27
|
+
|
28
|
+
# Human-readable name of the stack.
|
29
|
+
# @return [String]
|
30
|
+
attr_accessor :display_name
|
31
|
+
|
32
|
+
# Description of the stack.
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :description
|
35
|
+
|
36
|
+
# The date and time at which the stack was created.
|
37
|
+
# @return [DateTime]
|
38
|
+
attr_accessor :time_created
|
39
|
+
|
40
|
+
# The current lifecycle state of the stack.
|
41
|
+
# @return [String]
|
42
|
+
attr_reader :lifecycle_state
|
43
|
+
|
44
|
+
# Specifies the `configSourceType` for uploading the Terraform configuration.
|
45
|
+
# Presently, the .zip file type (`ZIP_UPLOAD`) is the only supported `configSourceType`.
|
46
|
+
#
|
47
|
+
# @return [OCI::ResourceManager::Models::ConfigSource]
|
48
|
+
attr_accessor :config_source
|
49
|
+
|
50
|
+
# Terraform variables associated with this resource.
|
51
|
+
# Maximum number of variables supported is 100.
|
52
|
+
# The maximum size of each variable, including both name and value, is 4096 bytes.
|
53
|
+
# Example: `{\"CompartmentId\": \"compartment-id-value\"}`
|
54
|
+
#
|
55
|
+
# @return [Hash<String, String>]
|
56
|
+
attr_accessor :variables
|
57
|
+
|
58
|
+
# Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace.
|
59
|
+
# For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/resourcetags.htm).
|
60
|
+
# Example: `{\"Department\": \"Finance\"}`
|
61
|
+
#
|
62
|
+
# @return [Hash<String, String>]
|
63
|
+
attr_accessor :freeform_tags
|
64
|
+
|
65
|
+
# Defined tags for this resource. Each key is predefined and scoped to a namespace.
|
66
|
+
# For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/resourcetags.htm).
|
67
|
+
# Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
|
68
|
+
#
|
69
|
+
# @return [Hash<String, Hash<String, Object>>]
|
70
|
+
attr_accessor :defined_tags
|
71
|
+
|
72
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
73
|
+
def self.attribute_map
|
74
|
+
{
|
75
|
+
# rubocop:disable Style/SymbolLiteral
|
76
|
+
'id': :'id',
|
77
|
+
'compartment_id': :'compartmentId',
|
78
|
+
'display_name': :'displayName',
|
79
|
+
'description': :'description',
|
80
|
+
'time_created': :'timeCreated',
|
81
|
+
'lifecycle_state': :'lifecycleState',
|
82
|
+
'config_source': :'configSource',
|
83
|
+
'variables': :'variables',
|
84
|
+
'freeform_tags': :'freeformTags',
|
85
|
+
'defined_tags': :'definedTags'
|
86
|
+
# rubocop:enable Style/SymbolLiteral
|
87
|
+
}
|
88
|
+
end
|
89
|
+
|
90
|
+
# Attribute type mapping.
|
91
|
+
def self.swagger_types
|
92
|
+
{
|
93
|
+
# rubocop:disable Style/SymbolLiteral
|
94
|
+
'id': :'String',
|
95
|
+
'compartment_id': :'String',
|
96
|
+
'display_name': :'String',
|
97
|
+
'description': :'String',
|
98
|
+
'time_created': :'DateTime',
|
99
|
+
'lifecycle_state': :'String',
|
100
|
+
'config_source': :'OCI::ResourceManager::Models::ConfigSource',
|
101
|
+
'variables': :'Hash<String, String>',
|
102
|
+
'freeform_tags': :'Hash<String, String>',
|
103
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>'
|
104
|
+
# rubocop:enable Style/SymbolLiteral
|
105
|
+
}
|
106
|
+
end
|
107
|
+
|
108
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
109
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
110
|
+
|
111
|
+
|
112
|
+
# Initializes the object
|
113
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
114
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
115
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
116
|
+
# @option attributes [String] :display_name The value to assign to the {#display_name} property
|
117
|
+
# @option attributes [String] :description The value to assign to the {#description} property
|
118
|
+
# @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
|
119
|
+
# @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
|
120
|
+
# @option attributes [OCI::ResourceManager::Models::ConfigSource] :config_source The value to assign to the {#config_source} property
|
121
|
+
# @option attributes [Hash<String, String>] :variables The value to assign to the {#variables} property
|
122
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
|
123
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
|
124
|
+
def initialize(attributes = {})
|
125
|
+
return unless attributes.is_a?(Hash)
|
126
|
+
|
127
|
+
# convert string to symbol for hash key
|
128
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
129
|
+
|
130
|
+
self.id = attributes[:'id'] if attributes[:'id']
|
131
|
+
|
132
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
133
|
+
|
134
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
135
|
+
|
136
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
137
|
+
|
138
|
+
self.display_name = attributes[:'displayName'] if attributes[:'displayName']
|
139
|
+
|
140
|
+
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
141
|
+
|
142
|
+
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
143
|
+
|
144
|
+
self.description = attributes[:'description'] if attributes[:'description']
|
145
|
+
|
146
|
+
self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
|
147
|
+
|
148
|
+
raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
|
149
|
+
|
150
|
+
self.time_created = attributes[:'time_created'] if attributes[:'time_created']
|
151
|
+
|
152
|
+
self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
|
153
|
+
|
154
|
+
raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
|
155
|
+
|
156
|
+
self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
|
157
|
+
|
158
|
+
self.config_source = attributes[:'configSource'] if attributes[:'configSource']
|
159
|
+
|
160
|
+
raise 'You cannot provide both :configSource and :config_source' if attributes.key?(:'configSource') && attributes.key?(:'config_source')
|
161
|
+
|
162
|
+
self.config_source = attributes[:'config_source'] if attributes[:'config_source']
|
163
|
+
|
164
|
+
self.variables = attributes[:'variables'] if attributes[:'variables']
|
165
|
+
|
166
|
+
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
167
|
+
|
168
|
+
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
169
|
+
|
170
|
+
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
171
|
+
|
172
|
+
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
173
|
+
|
174
|
+
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
175
|
+
|
176
|
+
self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
|
177
|
+
end
|
178
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
179
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
180
|
+
|
181
|
+
# Custom attribute writer method checking allowed values (enum).
|
182
|
+
# @param [Object] lifecycle_state Object to be assigned
|
183
|
+
def lifecycle_state=(lifecycle_state)
|
184
|
+
# rubocop:disable Style/ConditionalAssignment
|
185
|
+
if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
|
186
|
+
# rubocop: disable Metrics/LineLength
|
187
|
+
OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
|
188
|
+
# rubocop: enable Metrics/LineLength
|
189
|
+
@lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
|
190
|
+
else
|
191
|
+
@lifecycle_state = lifecycle_state
|
192
|
+
end
|
193
|
+
# rubocop:enable Style/ConditionalAssignment
|
194
|
+
end
|
195
|
+
|
196
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
197
|
+
|
198
|
+
|
199
|
+
# Checks equality by comparing each attribute.
|
200
|
+
# @param [Object] other the other object to be compared
|
201
|
+
def ==(other)
|
202
|
+
return true if equal?(other)
|
203
|
+
|
204
|
+
self.class == other.class &&
|
205
|
+
id == other.id &&
|
206
|
+
compartment_id == other.compartment_id &&
|
207
|
+
display_name == other.display_name &&
|
208
|
+
description == other.description &&
|
209
|
+
time_created == other.time_created &&
|
210
|
+
lifecycle_state == other.lifecycle_state &&
|
211
|
+
config_source == other.config_source &&
|
212
|
+
variables == other.variables &&
|
213
|
+
freeform_tags == other.freeform_tags &&
|
214
|
+
defined_tags == other.defined_tags
|
215
|
+
end
|
216
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
217
|
+
|
218
|
+
# @see the `==` method
|
219
|
+
# @param [Object] other the other object to be compared
|
220
|
+
def eql?(other)
|
221
|
+
self == other
|
222
|
+
end
|
223
|
+
|
224
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
225
|
+
|
226
|
+
|
227
|
+
# Calculates hash code according to all attributes.
|
228
|
+
# @return [Fixnum] Hash code
|
229
|
+
def hash
|
230
|
+
[id, compartment_id, display_name, description, time_created, lifecycle_state, config_source, variables, freeform_tags, defined_tags].hash
|
231
|
+
end
|
232
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
233
|
+
|
234
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
235
|
+
|
236
|
+
|
237
|
+
# Builds the object from hash
|
238
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
239
|
+
# @return [Object] Returns the model itself
|
240
|
+
def build_from_hash(attributes)
|
241
|
+
return nil unless attributes.is_a?(Hash)
|
242
|
+
|
243
|
+
self.class.swagger_types.each_pair do |key, type|
|
244
|
+
if type =~ /^Array<(.*)>/i
|
245
|
+
# check to ensure the input is an array given that the the attribute
|
246
|
+
# is documented as an array but the input is not
|
247
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
248
|
+
public_method("#{key}=").call(
|
249
|
+
attributes[self.class.attribute_map[key]]
|
250
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
251
|
+
)
|
252
|
+
end
|
253
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
254
|
+
public_method("#{key}=").call(
|
255
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
256
|
+
)
|
257
|
+
end
|
258
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
259
|
+
end
|
260
|
+
|
261
|
+
self
|
262
|
+
end
|
263
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
264
|
+
|
265
|
+
# Returns the string representation of the object
|
266
|
+
# @return [String] String presentation of the object
|
267
|
+
def to_s
|
268
|
+
to_hash.to_s
|
269
|
+
end
|
270
|
+
|
271
|
+
# Returns the object in the form of hash
|
272
|
+
# @return [Hash] Returns the object in the form of hash
|
273
|
+
def to_hash
|
274
|
+
hash = {}
|
275
|
+
self.class.attribute_map.each_pair do |attr, param|
|
276
|
+
value = public_method(attr).call
|
277
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
278
|
+
|
279
|
+
hash[param] = _to_hash(value)
|
280
|
+
end
|
281
|
+
hash
|
282
|
+
end
|
283
|
+
|
284
|
+
private
|
285
|
+
|
286
|
+
# Outputs non-array value in the form of hash
|
287
|
+
# For object, use to_hash. Otherwise, just return the value
|
288
|
+
# @param [Object] value Any valid value
|
289
|
+
# @return [Hash] Returns the value in the form of hash
|
290
|
+
def _to_hash(value)
|
291
|
+
if value.is_a?(Array)
|
292
|
+
value.compact.map { |v| _to_hash(v) }
|
293
|
+
elsif value.is_a?(Hash)
|
294
|
+
{}.tap do |hash|
|
295
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
296
|
+
end
|
297
|
+
elsif value.respond_to? :to_hash
|
298
|
+
value.to_hash
|
299
|
+
else
|
300
|
+
value
|
301
|
+
end
|
302
|
+
end
|
303
|
+
end
|
304
|
+
end
|
305
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|
@@ -0,0 +1,249 @@
|
|
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
|
+
# Returns a list of properties and the defining property values for the specified stack.
|
8
|
+
#
|
9
|
+
class ResourceManager::Models::StackSummary # rubocop:disable Metrics/LineLength
|
10
|
+
# Unique identifier of the specified stack.
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :id
|
13
|
+
|
14
|
+
# Unique identifier of the compartment in which the stack resides.
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :compartment_id
|
17
|
+
|
18
|
+
# Human-readable display name for the stack.
|
19
|
+
# @return [String]
|
20
|
+
attr_accessor :display_name
|
21
|
+
|
22
|
+
# General description of the stack.
|
23
|
+
# @return [String]
|
24
|
+
attr_accessor :description
|
25
|
+
|
26
|
+
# Date and time at which the stack was created.
|
27
|
+
# @return [DateTime]
|
28
|
+
attr_accessor :time_created
|
29
|
+
|
30
|
+
# @return [String]
|
31
|
+
attr_accessor :lifecycle_state
|
32
|
+
|
33
|
+
# Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace.
|
34
|
+
# For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/resourcetags.htm).
|
35
|
+
# Example: `{\"Department\": \"Finance\"}`
|
36
|
+
#
|
37
|
+
# @return [Hash<String, String>]
|
38
|
+
attr_accessor :freeform_tags
|
39
|
+
|
40
|
+
# Defined tags for this resource. Each key is predefined and scoped to a namespace.
|
41
|
+
# For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/resourcetags.htm).
|
42
|
+
# Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
|
43
|
+
#
|
44
|
+
# @return [Hash<String, Hash<String, Object>>]
|
45
|
+
attr_accessor :defined_tags
|
46
|
+
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
48
|
+
def self.attribute_map
|
49
|
+
{
|
50
|
+
# rubocop:disable Style/SymbolLiteral
|
51
|
+
'id': :'id',
|
52
|
+
'compartment_id': :'compartmentId',
|
53
|
+
'display_name': :'displayName',
|
54
|
+
'description': :'description',
|
55
|
+
'time_created': :'timeCreated',
|
56
|
+
'lifecycle_state': :'lifecycleState',
|
57
|
+
'freeform_tags': :'freeformTags',
|
58
|
+
'defined_tags': :'definedTags'
|
59
|
+
# rubocop:enable Style/SymbolLiteral
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Attribute type mapping.
|
64
|
+
def self.swagger_types
|
65
|
+
{
|
66
|
+
# rubocop:disable Style/SymbolLiteral
|
67
|
+
'id': :'String',
|
68
|
+
'compartment_id': :'String',
|
69
|
+
'display_name': :'String',
|
70
|
+
'description': :'String',
|
71
|
+
'time_created': :'DateTime',
|
72
|
+
'lifecycle_state': :'String',
|
73
|
+
'freeform_tags': :'Hash<String, String>',
|
74
|
+
'defined_tags': :'Hash<String, Hash<String, Object>>'
|
75
|
+
# rubocop:enable Style/SymbolLiteral
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
80
|
+
# rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
81
|
+
|
82
|
+
|
83
|
+
# Initializes the object
|
84
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
85
|
+
# @option attributes [String] :id The value to assign to the {#id} property
|
86
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
87
|
+
# @option attributes [String] :display_name The value to assign to the {#display_name} property
|
88
|
+
# @option attributes [String] :description The value to assign to the {#description} property
|
89
|
+
# @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
|
90
|
+
# @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
|
91
|
+
# @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
|
92
|
+
# @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
|
93
|
+
def initialize(attributes = {})
|
94
|
+
return unless attributes.is_a?(Hash)
|
95
|
+
|
96
|
+
# convert string to symbol for hash key
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
98
|
+
|
99
|
+
self.id = attributes[:'id'] if attributes[:'id']
|
100
|
+
|
101
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
102
|
+
|
103
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
104
|
+
|
105
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
106
|
+
|
107
|
+
self.display_name = attributes[:'displayName'] if attributes[:'displayName']
|
108
|
+
|
109
|
+
raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
|
110
|
+
|
111
|
+
self.display_name = attributes[:'display_name'] if attributes[:'display_name']
|
112
|
+
|
113
|
+
self.description = attributes[:'description'] if attributes[:'description']
|
114
|
+
|
115
|
+
self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
|
116
|
+
|
117
|
+
raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
|
118
|
+
|
119
|
+
self.time_created = attributes[:'time_created'] if attributes[:'time_created']
|
120
|
+
|
121
|
+
self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
|
122
|
+
|
123
|
+
raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
|
124
|
+
|
125
|
+
self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
|
126
|
+
|
127
|
+
self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
|
128
|
+
|
129
|
+
raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
|
130
|
+
|
131
|
+
self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
|
132
|
+
|
133
|
+
self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
|
134
|
+
|
135
|
+
raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
|
136
|
+
|
137
|
+
self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
|
138
|
+
end
|
139
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
140
|
+
# rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
141
|
+
|
142
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
143
|
+
|
144
|
+
|
145
|
+
# Checks equality by comparing each attribute.
|
146
|
+
# @param [Object] other the other object to be compared
|
147
|
+
def ==(other)
|
148
|
+
return true if equal?(other)
|
149
|
+
|
150
|
+
self.class == other.class &&
|
151
|
+
id == other.id &&
|
152
|
+
compartment_id == other.compartment_id &&
|
153
|
+
display_name == other.display_name &&
|
154
|
+
description == other.description &&
|
155
|
+
time_created == other.time_created &&
|
156
|
+
lifecycle_state == other.lifecycle_state &&
|
157
|
+
freeform_tags == other.freeform_tags &&
|
158
|
+
defined_tags == other.defined_tags
|
159
|
+
end
|
160
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
|
161
|
+
|
162
|
+
# @see the `==` method
|
163
|
+
# @param [Object] other the other object to be compared
|
164
|
+
def eql?(other)
|
165
|
+
self == other
|
166
|
+
end
|
167
|
+
|
168
|
+
# rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
169
|
+
|
170
|
+
|
171
|
+
# Calculates hash code according to all attributes.
|
172
|
+
# @return [Fixnum] Hash code
|
173
|
+
def hash
|
174
|
+
[id, compartment_id, display_name, description, time_created, lifecycle_state, freeform_tags, defined_tags].hash
|
175
|
+
end
|
176
|
+
# rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
|
177
|
+
|
178
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
179
|
+
|
180
|
+
|
181
|
+
# Builds the object from hash
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
183
|
+
# @return [Object] Returns the model itself
|
184
|
+
def build_from_hash(attributes)
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
186
|
+
|
187
|
+
self.class.swagger_types.each_pair do |key, type|
|
188
|
+
if type =~ /^Array<(.*)>/i
|
189
|
+
# check to ensure the input is an array given that the the attribute
|
190
|
+
# is documented as an array but the input is not
|
191
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
192
|
+
public_method("#{key}=").call(
|
193
|
+
attributes[self.class.attribute_map[key]]
|
194
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
195
|
+
)
|
196
|
+
end
|
197
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
198
|
+
public_method("#{key}=").call(
|
199
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
200
|
+
)
|
201
|
+
end
|
202
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
203
|
+
end
|
204
|
+
|
205
|
+
self
|
206
|
+
end
|
207
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
208
|
+
|
209
|
+
# Returns the string representation of the object
|
210
|
+
# @return [String] String presentation of the object
|
211
|
+
def to_s
|
212
|
+
to_hash.to_s
|
213
|
+
end
|
214
|
+
|
215
|
+
# Returns the object in the form of hash
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
217
|
+
def to_hash
|
218
|
+
hash = {}
|
219
|
+
self.class.attribute_map.each_pair do |attr, param|
|
220
|
+
value = public_method(attr).call
|
221
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
222
|
+
|
223
|
+
hash[param] = _to_hash(value)
|
224
|
+
end
|
225
|
+
hash
|
226
|
+
end
|
227
|
+
|
228
|
+
private
|
229
|
+
|
230
|
+
# Outputs non-array value in the form of hash
|
231
|
+
# For object, use to_hash. Otherwise, just return the value
|
232
|
+
# @param [Object] value Any valid value
|
233
|
+
# @return [Hash] Returns the value in the form of hash
|
234
|
+
def _to_hash(value)
|
235
|
+
if value.is_a?(Array)
|
236
|
+
value.compact.map { |v| _to_hash(v) }
|
237
|
+
elsif value.is_a?(Hash)
|
238
|
+
{}.tap do |hash|
|
239
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
240
|
+
end
|
241
|
+
elsif value.respond_to? :to_hash
|
242
|
+
value.to_hash
|
243
|
+
else
|
244
|
+
value
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
# rubocop:enable Lint/UnneededCopDisableDirective
|