oci 2.5.0 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -1
  3. data/lib/oci.rb +4 -0
  4. data/lib/oci/auth/federation_client.rb +4 -4
  5. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +22 -16
  6. data/lib/oci/autoscaling/auto_scaling_client.rb +774 -0
  7. data/lib/oci/autoscaling/auto_scaling_client_composite_operations.rb +24 -0
  8. data/lib/oci/autoscaling/autoscaling.rb +38 -0
  9. data/lib/oci/autoscaling/models/action.rb +182 -0
  10. data/lib/oci/autoscaling/models/auto_scaling_configuration.rb +282 -0
  11. data/lib/oci/autoscaling/models/auto_scaling_configuration_summary.rb +234 -0
  12. data/lib/oci/autoscaling/models/auto_scaling_policy.rb +222 -0
  13. data/lib/oci/autoscaling/models/auto_scaling_policy_summary.rb +179 -0
  14. data/lib/oci/autoscaling/models/capacity.rb +170 -0
  15. data/lib/oci/autoscaling/models/condition.rb +186 -0
  16. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +256 -0
  17. data/lib/oci/autoscaling/models/create_auto_scaling_policy_details.rb +196 -0
  18. data/lib/oci/autoscaling/models/create_condition_details.rb +176 -0
  19. data/lib/oci/autoscaling/models/create_threshold_policy_details.rb +166 -0
  20. data/lib/oci/autoscaling/models/instance_pool_resource.rb +148 -0
  21. data/lib/oci/autoscaling/models/metric.rb +186 -0
  22. data/lib/oci/autoscaling/models/resource.rb +177 -0
  23. data/lib/oci/autoscaling/models/threshold.rb +188 -0
  24. data/lib/oci/autoscaling/models/threshold_policy.rb +173 -0
  25. data/lib/oci/autoscaling/models/update_auto_scaling_configuration_details.rb +219 -0
  26. data/lib/oci/autoscaling/models/update_auto_scaling_policy_details.rb +194 -0
  27. data/lib/oci/autoscaling/models/update_condition_details.rb +176 -0
  28. data/lib/oci/autoscaling/models/update_threshold_policy_details.rb +164 -0
  29. data/lib/oci/autoscaling/util.rb +2 -0
  30. data/lib/oci/core/blockstorage_client.rb +1 -1
  31. data/lib/oci/core/compute_client.rb +1 -1
  32. data/lib/oci/core/compute_management_client.rb +135 -1
  33. data/lib/oci/core/compute_management_client_composite_operations.rb +80 -0
  34. data/lib/oci/core/core.rb +8 -0
  35. data/lib/oci/core/models/attach_load_balancer_details.rb +191 -0
  36. data/lib/oci/core/models/create_instance_pool_details.rb +19 -4
  37. data/lib/oci/core/models/detach_load_balancer_details.rb +167 -0
  38. data/lib/oci/core/models/image.rb +14 -1
  39. data/lib/oci/core/models/instance.rb +18 -2
  40. data/lib/oci/core/models/instance_agent_config.rb +154 -0
  41. data/lib/oci/core/models/instance_agent_features.rb +154 -0
  42. data/lib/oci/core/models/instance_pool.rb +19 -4
  43. data/lib/oci/core/models/instance_pool_instance_load_balancer_backend.rb +219 -0
  44. data/lib/oci/core/models/instance_pool_load_balancer_attachment.rb +253 -0
  45. data/lib/oci/core/models/instance_summary.rb +19 -4
  46. data/lib/oci/core/models/launch_instance_agent_config_details.rb +155 -0
  47. data/lib/oci/core/models/launch_instance_details.rb +14 -1
  48. data/lib/oci/core/models/update_instance_agent_config_details.rb +154 -0
  49. data/lib/oci/core/models/update_instance_details.rb +16 -1
  50. data/lib/oci/core/virtual_network_client.rb +1 -1
  51. data/lib/oci/database/database_client.rb +12 -14
  52. data/lib/oci/database/models/autonomous_data_warehouse_connection_strings.rb +3 -1
  53. data/lib/oci/database/models/autonomous_database_connection_strings.rb +3 -1
  54. data/lib/oci/database/models/create_data_guard_association_details.rb +2 -7
  55. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +5 -1
  56. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +4 -1
  57. data/lib/oci/database/models/database_summary.rb +1 -1
  58. data/lib/oci/database/models/db_node.rb +15 -1
  59. data/lib/oci/database/models/db_node_summary.rb +15 -1
  60. data/lib/oci/database/models/db_system.rb +15 -1
  61. data/lib/oci/database/models/db_system_summary.rb +15 -1
  62. data/lib/oci/database/models/db_version_summary.rb +1 -1
  63. data/lib/oci/database/models/launch_db_system_base.rb +33 -2
  64. data/lib/oci/database/models/launch_db_system_details.rb +5 -1
  65. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +5 -1
  66. data/lib/oci/database/models/update_db_system_details.rb +1 -1
  67. data/lib/oci/identity/identity.rb +4 -0
  68. data/lib/oci/identity/identity_client.rb +468 -12
  69. data/lib/oci/identity/identity_client_composite_operations.rb +79 -0
  70. data/lib/oci/identity/models/change_tag_namespace_compartment_detail.rb +154 -0
  71. data/lib/oci/identity/models/create_identity_provider_details.rb +2 -1
  72. data/lib/oci/identity/models/mfa_totp_device.rb +279 -0
  73. data/lib/oci/identity/models/mfa_totp_device_summary.rb +267 -0
  74. data/lib/oci/identity/models/mfa_totp_token.rb +155 -0
  75. data/lib/oci/identity/models/tag_namespace_summary.rb +1 -1
  76. data/lib/oci/identity/models/user.rb +18 -4
  77. data/lib/oci/monitoring/models/aggregated_datapoint.rb +166 -0
  78. data/lib/oci/monitoring/models/alarm.rb +538 -0
  79. data/lib/oci/monitoring/models/alarm_history_collection.rb +183 -0
  80. data/lib/oci/monitoring/models/alarm_history_entry.rb +187 -0
  81. data/lib/oci/monitoring/models/alarm_status_summary.rb +277 -0
  82. data/lib/oci/monitoring/models/alarm_summary.rb +386 -0
  83. data/lib/oci/monitoring/models/create_alarm_details.rb +423 -0
  84. data/lib/oci/monitoring/models/datapoint.rb +179 -0
  85. data/lib/oci/monitoring/models/failed_metric_record.rb +166 -0
  86. data/lib/oci/monitoring/models/list_metrics_details.rb +271 -0
  87. data/lib/oci/monitoring/models/metric.rb +197 -0
  88. data/lib/oci/monitoring/models/metric_data.rb +243 -0
  89. data/lib/oci/monitoring/models/metric_data_details.rb +227 -0
  90. data/lib/oci/monitoring/models/post_metric_data_details.rb +194 -0
  91. data/lib/oci/monitoring/models/post_metric_data_response_details.rb +170 -0
  92. data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +229 -0
  93. data/lib/oci/monitoring/models/suppression.rb +196 -0
  94. data/lib/oci/monitoring/models/update_alarm_details.rb +423 -0
  95. data/lib/oci/monitoring/monitoring.rb +37 -0
  96. data/lib/oci/monitoring/monitoring_client.rb +923 -0
  97. data/lib/oci/monitoring/monitoring_client_composite_operations.rb +145 -0
  98. data/lib/oci/monitoring/util.rb +2 -0
  99. data/lib/oci/ons/models/backoff_retry_policy.rb +192 -0
  100. data/lib/oci/ons/models/confirmation_result.rb +221 -0
  101. data/lib/oci/ons/models/create_subscription_details.rb +238 -0
  102. data/lib/oci/ons/models/create_topic_details.rb +209 -0
  103. data/lib/oci/ons/models/delivery_policy.rb +153 -0
  104. data/lib/oci/ons/models/message_details.rb +163 -0
  105. data/lib/oci/ons/models/notification_topic.rb +302 -0
  106. data/lib/oci/ons/models/notification_topic_summary.rb +303 -0
  107. data/lib/oci/ons/models/publish_result.rb +168 -0
  108. data/lib/oci/ons/models/subscription.rb +273 -0
  109. data/lib/oci/ons/models/subscription_summary.rb +300 -0
  110. data/lib/oci/ons/models/topic_attributes_details.rb +184 -0
  111. data/lib/oci/ons/models/update_subscription_details.rb +188 -0
  112. data/lib/oci/ons/notification_control_plane_client.rb +463 -0
  113. data/lib/oci/ons/notification_control_plane_client_composite_operations.rb +24 -0
  114. data/lib/oci/ons/notification_data_plane_client.rb +680 -0
  115. data/lib/oci/ons/notification_data_plane_client_composite_operations.rb +104 -0
  116. data/lib/oci/ons/ons.rb +33 -0
  117. data/lib/oci/ons/util.rb +2 -0
  118. data/lib/oci/regions.rb +5 -0
  119. data/lib/oci/resource_manager/models/apply_job_plan_resolution.rb +189 -0
  120. data/lib/oci/resource_manager/models/config_source.rb +208 -0
  121. data/lib/oci/resource_manager/models/create_config_source_details.rb +187 -0
  122. data/lib/oci/resource_manager/models/create_job_details.rb +225 -0
  123. data/lib/oci/resource_manager/models/create_stack_details.rb +239 -0
  124. data/lib/oci/resource_manager/models/create_zip_upload_config_source_details.rb +166 -0
  125. data/lib/oci/resource_manager/models/failure_details.rb +185 -0
  126. data/lib/oci/resource_manager/models/job.rb +399 -0
  127. data/lib/oci/resource_manager/models/job_summary.rb +311 -0
  128. data/lib/oci/resource_manager/models/log_entry.rb +225 -0
  129. data/lib/oci/resource_manager/models/stack.rb +305 -0
  130. data/lib/oci/resource_manager/models/stack_summary.rb +249 -0
  131. data/lib/oci/resource_manager/models/update_config_source_details.rb +184 -0
  132. data/lib/oci/resource_manager/models/update_job_details.rb +188 -0
  133. data/lib/oci/resource_manager/models/update_stack_details.rb +225 -0
  134. data/lib/oci/resource_manager/models/update_zip_upload_config_source_details.rb +164 -0
  135. data/lib/oci/resource_manager/models/zip_upload_config_source.rb +149 -0
  136. data/lib/oci/resource_manager/resource_manager.rb +36 -0
  137. data/lib/oci/resource_manager/resource_manager_client.rb +1264 -0
  138. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +263 -0
  139. data/lib/oci/resource_manager/util.rb +2 -0
  140. data/lib/oci/version.rb +1 -1
  141. metadata +100 -2
@@ -0,0 +1,187 @@
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
+ # Property details for the configuration source.
8
+ #
9
+ # This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
10
+ class ResourceManager::Models::CreateConfigSourceDetails # rubocop:disable Metrics/LineLength
11
+ # **[Required]** The configuration file type.
12
+ #
13
+ # @return [String]
14
+ attr_accessor :config_source_type
15
+
16
+ # File path to the directory from which Terraform runs.
17
+ # If not specified, the root directory is used.
18
+ #
19
+ # @return [String]
20
+ attr_accessor :working_directory
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ # rubocop:disable Style/SymbolLiteral
26
+ 'config_source_type': :'configSourceType',
27
+ 'working_directory': :'workingDirectory'
28
+ # rubocop:enable Style/SymbolLiteral
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ # rubocop:disable Style/SymbolLiteral
36
+ 'config_source_type': :'String',
37
+ 'working_directory': :'String'
38
+ # rubocop:enable Style/SymbolLiteral
39
+ }
40
+ end
41
+
42
+ # rubocop:disable Metrics/CyclomaticComplexity, Layout/EmptyLines
43
+
44
+
45
+ # Given the hash representation of a subtype of this class,
46
+ # use the info in the hash to return the class of the subtype.
47
+ def self.get_subtype(object_hash)
48
+ type = object_hash[:'configSourceType'] # rubocop:disable Style/SymbolLiteral
49
+
50
+ return 'OCI::ResourceManager::Models::CreateZipUploadConfigSourceDetails' if type == 'ZIP_UPLOAD'
51
+
52
+ # TODO: Log a warning when the subtype is not found.
53
+ 'OCI::ResourceManager::Models::CreateConfigSourceDetails'
54
+ end
55
+ # rubocop:enable Metrics/CyclomaticComplexity, Layout/EmptyLines
56
+
57
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
58
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
59
+
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ # @option attributes [String] :config_source_type The value to assign to the {#config_source_type} property
64
+ # @option attributes [String] :working_directory The value to assign to the {#working_directory} property
65
+ def initialize(attributes = {})
66
+ return unless attributes.is_a?(Hash)
67
+
68
+ # convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
70
+
71
+ self.config_source_type = attributes[:'configSourceType'] if attributes[:'configSourceType']
72
+
73
+ raise 'You cannot provide both :configSourceType and :config_source_type' if attributes.key?(:'configSourceType') && attributes.key?(:'config_source_type')
74
+
75
+ self.config_source_type = attributes[:'config_source_type'] if attributes[:'config_source_type']
76
+
77
+ self.working_directory = attributes[:'workingDirectory'] if attributes[:'workingDirectory']
78
+
79
+ raise 'You cannot provide both :workingDirectory and :working_directory' if attributes.key?(:'workingDirectory') && attributes.key?(:'working_directory')
80
+
81
+ self.working_directory = attributes[:'working_directory'] if attributes[:'working_directory']
82
+ end
83
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
84
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
85
+
86
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
87
+
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] other the other object to be compared
91
+ def ==(other)
92
+ return true if equal?(other)
93
+
94
+ self.class == other.class &&
95
+ config_source_type == other.config_source_type &&
96
+ working_directory == other.working_directory
97
+ end
98
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
99
+
100
+ # @see the `==` method
101
+ # @param [Object] other the other object to be compared
102
+ def eql?(other)
103
+ self == other
104
+ end
105
+
106
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
107
+
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Fixnum] Hash code
111
+ def hash
112
+ [config_source_type, working_directory].hash
113
+ end
114
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
115
+
116
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
117
+
118
+
119
+ # Builds the object from hash
120
+ # @param [Hash] attributes Model attributes in the form of hash
121
+ # @return [Object] Returns the model itself
122
+ def build_from_hash(attributes)
123
+ return nil unless attributes.is_a?(Hash)
124
+
125
+ self.class.swagger_types.each_pair do |key, type|
126
+ if type =~ /^Array<(.*)>/i
127
+ # check to ensure the input is an array given that the the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
130
+ public_method("#{key}=").call(
131
+ attributes[self.class.attribute_map[key]]
132
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
133
+ )
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ public_method("#{key}=").call(
137
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
138
+ )
139
+ end
140
+ # or else data not found in attributes(hash), not an issue as the data can be optional
141
+ end
142
+
143
+ self
144
+ end
145
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
146
+
147
+ # Returns the string representation of the object
148
+ # @return [String] String presentation of the object
149
+ def to_s
150
+ to_hash.to_s
151
+ end
152
+
153
+ # Returns the object in the form of hash
154
+ # @return [Hash] Returns the object in the form of hash
155
+ def to_hash
156
+ hash = {}
157
+ self.class.attribute_map.each_pair do |attr, param|
158
+ value = public_method(attr).call
159
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
160
+
161
+ hash[param] = _to_hash(value)
162
+ end
163
+ hash
164
+ end
165
+
166
+ private
167
+
168
+ # Outputs non-array value in the form of hash
169
+ # For object, use to_hash. Otherwise, just return the value
170
+ # @param [Object] value Any valid value
171
+ # @return [Hash] Returns the value in the form of hash
172
+ def _to_hash(value)
173
+ if value.is_a?(Array)
174
+ value.compact.map { |v| _to_hash(v) }
175
+ elsif value.is_a?(Hash)
176
+ {}.tap do |hash|
177
+ value.each { |k, v| hash[k] = _to_hash(v) }
178
+ end
179
+ elsif value.respond_to? :to_hash
180
+ value.to_hash
181
+ else
182
+ value
183
+ end
184
+ end
185
+ end
186
+ end
187
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,225 @@
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
+ # Defines the requirements and properties of a job to create and run against the specified stack.
8
+ #
9
+ class ResourceManager::Models::CreateJobDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** OCID of the stack that is associated with the current job.
11
+ # @return [String]
12
+ attr_accessor :stack_id
13
+
14
+ # Description of the job.
15
+ # @return [String]
16
+ attr_accessor :display_name
17
+
18
+ # **[Required]** Terraform-specific operation to execute.
19
+ # @return [String]
20
+ attr_accessor :operation
21
+
22
+ # @return [OCI::ResourceManager::Models::ApplyJobPlanResolution]
23
+ attr_accessor :apply_job_plan_resolution
24
+
25
+ # Free-form tags associated with this resource. Each tag is a key-value pair with no predefined name, type, or namespace.
26
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/resourcetags.htm).
27
+ # Example: `{\"Department\": \"Finance\"}`
28
+ #
29
+ # @return [Hash<String, String>]
30
+ attr_accessor :freeform_tags
31
+
32
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
33
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/iaas/Content/General/Concepts/resourcetags.htm).
34
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
35
+ #
36
+ # @return [Hash<String, Hash<String, Object>>]
37
+ attr_accessor :defined_tags
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ # rubocop:disable Style/SymbolLiteral
43
+ 'stack_id': :'stackId',
44
+ 'display_name': :'displayName',
45
+ 'operation': :'operation',
46
+ 'apply_job_plan_resolution': :'applyJobPlanResolution',
47
+ 'freeform_tags': :'freeformTags',
48
+ 'defined_tags': :'definedTags'
49
+ # rubocop:enable Style/SymbolLiteral
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.swagger_types
55
+ {
56
+ # rubocop:disable Style/SymbolLiteral
57
+ 'stack_id': :'String',
58
+ 'display_name': :'String',
59
+ 'operation': :'String',
60
+ 'apply_job_plan_resolution': :'OCI::ResourceManager::Models::ApplyJobPlanResolution',
61
+ 'freeform_tags': :'Hash<String, String>',
62
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
63
+ # rubocop:enable Style/SymbolLiteral
64
+ }
65
+ end
66
+
67
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
68
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
69
+
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ # @option attributes [String] :stack_id The value to assign to the {#stack_id} property
74
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
75
+ # @option attributes [String] :operation The value to assign to the {#operation} property
76
+ # @option attributes [OCI::ResourceManager::Models::ApplyJobPlanResolution] :apply_job_plan_resolution The value to assign to the {#apply_job_plan_resolution} property
77
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
78
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
79
+ def initialize(attributes = {})
80
+ return unless attributes.is_a?(Hash)
81
+
82
+ # convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
84
+
85
+ self.stack_id = attributes[:'stackId'] if attributes[:'stackId']
86
+
87
+ raise 'You cannot provide both :stackId and :stack_id' if attributes.key?(:'stackId') && attributes.key?(:'stack_id')
88
+
89
+ self.stack_id = attributes[:'stack_id'] if attributes[:'stack_id']
90
+
91
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
92
+
93
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
94
+
95
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
96
+
97
+ self.operation = attributes[:'operation'] if attributes[:'operation']
98
+
99
+ self.apply_job_plan_resolution = attributes[:'applyJobPlanResolution'] if attributes[:'applyJobPlanResolution']
100
+
101
+ raise 'You cannot provide both :applyJobPlanResolution and :apply_job_plan_resolution' if attributes.key?(:'applyJobPlanResolution') && attributes.key?(:'apply_job_plan_resolution')
102
+
103
+ self.apply_job_plan_resolution = attributes[:'apply_job_plan_resolution'] if attributes[:'apply_job_plan_resolution']
104
+
105
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
106
+
107
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
108
+
109
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
110
+
111
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
112
+
113
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
114
+
115
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
116
+ end
117
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
118
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
119
+
120
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
121
+
122
+
123
+ # Checks equality by comparing each attribute.
124
+ # @param [Object] other the other object to be compared
125
+ def ==(other)
126
+ return true if equal?(other)
127
+
128
+ self.class == other.class &&
129
+ stack_id == other.stack_id &&
130
+ display_name == other.display_name &&
131
+ operation == other.operation &&
132
+ apply_job_plan_resolution == other.apply_job_plan_resolution &&
133
+ freeform_tags == other.freeform_tags &&
134
+ defined_tags == other.defined_tags
135
+ end
136
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
137
+
138
+ # @see the `==` method
139
+ # @param [Object] other the other object to be compared
140
+ def eql?(other)
141
+ self == other
142
+ end
143
+
144
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
145
+
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Fixnum] Hash code
149
+ def hash
150
+ [stack_id, display_name, operation, apply_job_plan_resolution, freeform_tags, defined_tags].hash
151
+ end
152
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
153
+
154
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
155
+
156
+
157
+ # Builds the object from hash
158
+ # @param [Hash] attributes Model attributes in the form of hash
159
+ # @return [Object] Returns the model itself
160
+ def build_from_hash(attributes)
161
+ return nil unless attributes.is_a?(Hash)
162
+
163
+ self.class.swagger_types.each_pair do |key, type|
164
+ if type =~ /^Array<(.*)>/i
165
+ # check to ensure the input is an array given that the the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
168
+ public_method("#{key}=").call(
169
+ attributes[self.class.attribute_map[key]]
170
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
171
+ )
172
+ end
173
+ elsif !attributes[self.class.attribute_map[key]].nil?
174
+ public_method("#{key}=").call(
175
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
176
+ )
177
+ end
178
+ # or else data not found in attributes(hash), not an issue as the data can be optional
179
+ end
180
+
181
+ self
182
+ end
183
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # Returns the object in the form of hash
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_hash
194
+ hash = {}
195
+ self.class.attribute_map.each_pair do |attr, param|
196
+ value = public_method(attr).call
197
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ private
205
+
206
+ # Outputs non-array value in the form of hash
207
+ # For object, use to_hash. Otherwise, just return the value
208
+ # @param [Object] value Any valid value
209
+ # @return [Hash] Returns the value in the form of hash
210
+ def _to_hash(value)
211
+ if value.is_a?(Array)
212
+ value.compact.map { |v| _to_hash(v) }
213
+ elsif value.is_a?(Hash)
214
+ {}.tap do |hash|
215
+ value.each { |k, v| hash[k] = _to_hash(v) }
216
+ end
217
+ elsif value.respond_to? :to_hash
218
+ value.to_hash
219
+ else
220
+ value
221
+ end
222
+ end
223
+ end
224
+ end
225
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,239 @@
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
+ # Properties provided for creating a stack.
8
+ class ResourceManager::Models::CreateStackDetails # rubocop:disable Metrics/LineLength
9
+ # **[Required]** Unique identifier (OCID) of the compartment in which the stack resides.
10
+ # @return [String]
11
+ attr_accessor :compartment_id
12
+
13
+ # The stack's display name.
14
+ # @return [String]
15
+ attr_accessor :display_name
16
+
17
+ # Description of the stack.
18
+ # @return [String]
19
+ attr_accessor :description
20
+
21
+ # This attribute is required.
22
+ # @return [OCI::ResourceManager::Models::CreateConfigSourceDetails]
23
+ attr_accessor :config_source
24
+
25
+ # Terraform variables associated with this resource.
26
+ # Maximum number of variables supported is 100.
27
+ # The maximum size of each variable, including both name and value, is 4096 bytes.
28
+ # Example: `{\"CompartmentId\": \"compartment-id-value\"}`
29
+ #
30
+ # @return [Hash<String, String>]
31
+ attr_accessor :variables
32
+
33
+ # Free-form tags associated with this resource. Each tag is a simple 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 associated with 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
+ 'compartment_id': :'compartmentId',
52
+ 'display_name': :'displayName',
53
+ 'description': :'description',
54
+ 'config_source': :'configSource',
55
+ 'variables': :'variables',
56
+ 'freeform_tags': :'freeformTags',
57
+ 'defined_tags': :'definedTags'
58
+ # rubocop:enable Style/SymbolLiteral
59
+ }
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.swagger_types
64
+ {
65
+ # rubocop:disable Style/SymbolLiteral
66
+ 'compartment_id': :'String',
67
+ 'display_name': :'String',
68
+ 'description': :'String',
69
+ 'config_source': :'OCI::ResourceManager::Models::CreateConfigSourceDetails',
70
+ 'variables': :'Hash<String, String>',
71
+ 'freeform_tags': :'Hash<String, String>',
72
+ 'defined_tags': :'Hash<String, Hash<String, Object>>'
73
+ # rubocop:enable Style/SymbolLiteral
74
+ }
75
+ end
76
+
77
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
78
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
79
+
80
+
81
+ # Initializes the object
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
84
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
85
+ # @option attributes [String] :description The value to assign to the {#description} property
86
+ # @option attributes [OCI::ResourceManager::Models::CreateConfigSourceDetails] :config_source The value to assign to the {#config_source} property
87
+ # @option attributes [Hash<String, String>] :variables The value to assign to the {#variables} property
88
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
89
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
90
+ def initialize(attributes = {})
91
+ return unless attributes.is_a?(Hash)
92
+
93
+ # convert string to symbol for hash key
94
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
95
+
96
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
97
+
98
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
99
+
100
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
101
+
102
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
103
+
104
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
105
+
106
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
107
+
108
+ self.description = attributes[:'description'] if attributes[:'description']
109
+
110
+ self.config_source = attributes[:'configSource'] if attributes[:'configSource']
111
+
112
+ raise 'You cannot provide both :configSource and :config_source' if attributes.key?(:'configSource') && attributes.key?(:'config_source')
113
+
114
+ self.config_source = attributes[:'config_source'] if attributes[:'config_source']
115
+
116
+ self.variables = attributes[:'variables'] if attributes[:'variables']
117
+
118
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
119
+
120
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
121
+
122
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
123
+
124
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
125
+
126
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
127
+
128
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
129
+ end
130
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
131
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
132
+
133
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
134
+
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] other the other object to be compared
138
+ def ==(other)
139
+ return true if equal?(other)
140
+
141
+ self.class == other.class &&
142
+ compartment_id == other.compartment_id &&
143
+ display_name == other.display_name &&
144
+ description == other.description &&
145
+ config_source == other.config_source &&
146
+ variables == other.variables &&
147
+ freeform_tags == other.freeform_tags &&
148
+ defined_tags == other.defined_tags
149
+ end
150
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/LineLength, Layout/EmptyLines
151
+
152
+ # @see the `==` method
153
+ # @param [Object] other the other object to be compared
154
+ def eql?(other)
155
+ self == other
156
+ end
157
+
158
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
159
+
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Fixnum] Hash code
163
+ def hash
164
+ [compartment_id, display_name, description, config_source, variables, freeform_tags, defined_tags].hash
165
+ end
166
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
167
+
168
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
169
+
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+
177
+ self.class.swagger_types.each_pair do |key, type|
178
+ if type =~ /^Array<(.*)>/i
179
+ # check to ensure the input is an array given that the the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ public_method("#{key}=").call(
183
+ attributes[self.class.attribute_map[key]]
184
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
185
+ )
186
+ end
187
+ elsif !attributes[self.class.attribute_map[key]].nil?
188
+ public_method("#{key}=").call(
189
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
190
+ )
191
+ end
192
+ # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
198
+
199
+ # Returns the string representation of the object
200
+ # @return [String] String presentation of the object
201
+ def to_s
202
+ to_hash.to_s
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = public_method(attr).call
211
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ private
219
+
220
+ # Outputs non-array value in the form of hash
221
+ # For object, use to_hash. Otherwise, just return the value
222
+ # @param [Object] value Any valid value
223
+ # @return [Hash] Returns the value in the form of hash
224
+ def _to_hash(value)
225
+ if value.is_a?(Array)
226
+ value.compact.map { |v| _to_hash(v) }
227
+ elsif value.is_a?(Hash)
228
+ {}.tap do |hash|
229
+ value.each { |k, v| hash[k] = _to_hash(v) }
230
+ end
231
+ elsif value.respond_to? :to_hash
232
+ value.to_hash
233
+ else
234
+ value
235
+ end
236
+ end
237
+ end
238
+ end
239
+ # rubocop:enable Lint/UnneededCopDisableDirective