oci 2.5.9 → 2.5.10

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 (129) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/autoscaling/auto_scaling_client.rb +73 -0
  4. data/lib/oci/autoscaling/autoscaling.rb +1 -0
  5. data/lib/oci/autoscaling/models/change_auto_scaling_compartment_details.rb +154 -0
  6. data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +0 -1
  7. data/lib/oci/container_engine/models/work_request_error.rb +0 -1
  8. data/lib/oci/core/blockstorage_client.rb +342 -0
  9. data/lib/oci/core/compute_client.rb +77 -5
  10. data/lib/oci/core/compute_client_composite_operations.rb +3 -3
  11. data/lib/oci/core/compute_management_client.rb +211 -0
  12. data/lib/oci/core/core.rb +27 -0
  13. data/lib/oci/core/models/add_network_security_group_security_rules_details.rb +153 -0
  14. data/lib/oci/core/models/add_security_rule_details.rb +388 -0
  15. data/lib/oci/core/models/added_network_security_group_security_rules.rb +153 -0
  16. data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +153 -0
  17. data/lib/oci/core/models/change_boot_volume_compartment_details.rb +153 -0
  18. data/lib/oci/core/models/change_image_compartment_details.rb +154 -0
  19. data/lib/oci/core/models/change_instance_configuration_compartment_details.rb +155 -0
  20. data/lib/oci/core/models/change_instance_pool_compartment_details.rb +155 -0
  21. data/lib/oci/core/models/change_nat_gateway_compartment_details.rb +153 -0
  22. data/lib/oci/core/models/change_route_table_compartment_details.rb +155 -0
  23. data/lib/oci/core/models/change_security_list_compartment_details.rb +155 -0
  24. data/lib/oci/core/models/change_service_gateway_compartment_details.rb +155 -0
  25. data/lib/oci/core/models/change_subnet_compartment_details.rb +155 -0
  26. data/lib/oci/core/models/change_vcn_compartment_details.rb +155 -0
  27. data/lib/oci/core/models/change_volume_backup_compartment_details.rb +153 -0
  28. data/lib/oci/core/models/change_volume_compartment_details.rb +153 -0
  29. data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +153 -0
  30. data/lib/oci/core/models/change_volume_group_compartment_details.rb +153 -0
  31. data/lib/oci/core/models/create_network_security_group_details.rb +223 -0
  32. data/lib/oci/core/models/create_vnic_details.rb +18 -1
  33. data/lib/oci/core/models/image.rb +2 -1
  34. data/lib/oci/core/models/instance_configuration.rb +3 -1
  35. data/lib/oci/core/models/instance_configuration_create_vnic_details.rb +18 -1
  36. data/lib/oci/core/models/instance_configuration_instance_source_via_image_details.rb +15 -1
  37. data/lib/oci/core/models/instance_configuration_summary.rb +3 -3
  38. data/lib/oci/core/models/instance_pool.rb +4 -1
  39. data/lib/oci/core/models/instance_pool_summary.rb +3 -3
  40. data/lib/oci/core/models/network_security_group.rb +324 -0
  41. data/lib/oci/core/models/network_security_group_vnic.rb +188 -0
  42. data/lib/oci/core/models/remove_network_security_group_security_rules_details.rb +154 -0
  43. data/lib/oci/core/models/security_list.rb +5 -0
  44. data/lib/oci/core/models/security_rule.rb +455 -0
  45. data/lib/oci/core/models/update_network_security_group_details.rb +189 -0
  46. data/lib/oci/core/models/update_network_security_group_security_rules_details.rb +153 -0
  47. data/lib/oci/core/models/update_security_rule_details.rb +404 -0
  48. data/lib/oci/core/models/update_vnic_details.rb +20 -1
  49. data/lib/oci/core/models/updated_network_security_group_security_rules.rb +153 -0
  50. data/lib/oci/core/models/vnic.rb +18 -1
  51. data/lib/oci/core/virtual_network_client.rb +1228 -132
  52. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  53. data/lib/oci/database/database.rb +19 -0
  54. data/lib/oci/database/database_client.rb +1066 -46
  55. data/lib/oci/database/database_client_composite_operations.rb +317 -0
  56. data/lib/oci/database/models/autonomous_container_database.rb +416 -0
  57. data/lib/oci/database/models/autonomous_container_database_backup_config.rb +157 -0
  58. data/lib/oci/database/models/autonomous_container_database_summary.rb +420 -0
  59. data/lib/oci/database/models/autonomous_database.rb +58 -1
  60. data/lib/oci/database/models/autonomous_database_backup.rb +16 -1
  61. data/lib/oci/database/models/autonomous_database_backup_summary.rb +16 -1
  62. data/lib/oci/database/models/autonomous_database_connection_strings.rb +11 -1
  63. data/lib/oci/database/models/autonomous_database_connection_urls.rb +170 -0
  64. data/lib/oci/database/models/autonomous_database_summary.rb +58 -1
  65. data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +224 -0
  66. data/lib/oci/database/models/autonomous_exadata_infrastructure.rb +419 -0
  67. data/lib/oci/database/models/autonomous_exadata_infrastructure_maintenance_window.rb +186 -0
  68. data/lib/oci/database/models/autonomous_exadata_infrastructure_shape_summary.rb +224 -0
  69. data/lib/oci/database/models/autonomous_exadata_infrastructure_summary.rb +436 -0
  70. data/lib/oci/database/models/backup.rb +1 -0
  71. data/lib/oci/database/models/backup_summary.rb +1 -0
  72. data/lib/oci/database/models/create_autonomous_container_database_details.rb +284 -0
  73. data/lib/oci/database/models/create_autonomous_database_base.rb +46 -1
  74. data/lib/oci/database/models/create_autonomous_database_clone_details.rb +13 -1
  75. data/lib/oci/database/models/create_autonomous_database_details.rb +13 -1
  76. data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +34 -1
  77. data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +1 -1
  78. data/lib/oci/database/models/day_of_week.rb +174 -0
  79. data/lib/oci/database/models/db_system.rb +34 -1
  80. data/lib/oci/database/models/db_system_summary.rb +34 -1
  81. data/lib/oci/database/models/launch_autonomous_exadata_infrastructure_details.rb +304 -0
  82. data/lib/oci/database/models/launch_db_system_base.rb +35 -2
  83. data/lib/oci/database/models/launch_db_system_details.rb +11 -2
  84. data/lib/oci/database/models/launch_db_system_from_backup_details.rb +11 -2
  85. data/lib/oci/database/models/maintenance_run.rb +392 -0
  86. data/lib/oci/database/models/maintenance_run_summary.rb +395 -0
  87. data/lib/oci/database/models/maintenance_window.rb +226 -0
  88. data/lib/oci/database/models/month.rb +179 -0
  89. data/lib/oci/database/models/restore_autonomous_database_details.rb +30 -4
  90. data/lib/oci/database/models/update_autonomous_container_database_details.rb +230 -0
  91. data/lib/oci/database/models/update_autonomous_database_details.rb +18 -1
  92. data/lib/oci/database/models/update_autonomous_exadata_infrastructure_details.rb +203 -0
  93. data/lib/oci/database/models/update_db_system_details.rb +37 -4
  94. data/lib/oci/database/models/update_maintenance_run_details.rb +154 -0
  95. data/lib/oci/email/email.rb +1 -0
  96. data/lib/oci/email/email_client.rb +62 -0
  97. data/lib/oci/email/models/change_sender_compartment_details.rb +157 -0
  98. data/lib/oci/key_management/key_management.rb +1 -0
  99. data/lib/oci/key_management/kms_crypto_client.rb +4 -4
  100. data/lib/oci/key_management/kms_management_client.rb +161 -10
  101. data/lib/oci/key_management/kms_management_client_composite_operations.rb +79 -0
  102. data/lib/oci/key_management/kms_vault_client.rb +16 -11
  103. data/lib/oci/key_management/models/key.rb +17 -1
  104. data/lib/oci/key_management/models/schedule_key_deletion_details.rb +156 -0
  105. data/lib/oci/load_balancer/load_balancer.rb +1 -0
  106. data/lib/oci/load_balancer/load_balancer_client.rb +64 -0
  107. data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
  108. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +16 -1
  109. data/lib/oci/load_balancer/models/load_balancer.rb +16 -1
  110. data/lib/oci/load_balancer/models/remove_http_request_header_rule.rb +1 -1
  111. data/lib/oci/load_balancer/models/remove_http_response_header_rule.rb +1 -1
  112. data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +9 -5
  113. data/lib/oci/load_balancer/models/update_backend_set_details.rb +2 -0
  114. data/lib/oci/load_balancer/models/update_network_security_groups_details.rb +154 -0
  115. data/lib/oci/monitoring/models/metric.rb +1 -0
  116. data/lib/oci/object_storage/models/work_request_error.rb +1 -0
  117. data/lib/oci/resource_manager/models/change_stack_compartment_details.rb +155 -0
  118. data/lib/oci/resource_manager/models/work_request.rb +293 -0
  119. data/lib/oci/resource_manager/models/work_request_error.rb +170 -0
  120. data/lib/oci/resource_manager/models/work_request_log_entry.rb +159 -0
  121. data/lib/oci/resource_manager/models/work_request_resource.rb +217 -0
  122. data/lib/oci/resource_manager/models/work_request_summary.rb +254 -0
  123. data/lib/oci/resource_manager/resource_manager.rb +6 -0
  124. data/lib/oci/resource_manager/resource_manager_client.rb +338 -0
  125. data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +50 -0
  126. data/lib/oci/streaming/stream_admin_client.rb +2 -2
  127. data/lib/oci/streaming/stream_client.rb +1 -1
  128. data/lib/oci/version.rb +1 -1
  129. metadata +58 -2
@@ -0,0 +1,189 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # UpdateNetworkSecurityGroupDetails model.
8
+ class Core::Models::UpdateNetworkSecurityGroupDetails
9
+ # Defined tags for this resource. Each key is predefined and scoped to a
10
+ # namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
11
+ #
12
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
13
+ #
14
+ # @return [Hash<String, Hash<String, Object>>]
15
+ attr_accessor :defined_tags
16
+
17
+ # A user-friendly name. Does not have to be unique, and it's changeable.
18
+ # @return [String]
19
+ attr_accessor :display_name
20
+
21
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
22
+ # predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
23
+ #
24
+ # Example: `{\"Department\": \"Finance\"}`
25
+ #
26
+ # @return [Hash<String, String>]
27
+ attr_accessor :freeform_tags
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ # rubocop:disable Style/SymbolLiteral
33
+ 'defined_tags': :'definedTags',
34
+ 'display_name': :'displayName',
35
+ 'freeform_tags': :'freeformTags'
36
+ # rubocop:enable Style/SymbolLiteral
37
+ }
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.swagger_types
42
+ {
43
+ # rubocop:disable Style/SymbolLiteral
44
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
45
+ 'display_name': :'String',
46
+ 'freeform_tags': :'Hash<String, String>'
47
+ # rubocop:enable Style/SymbolLiteral
48
+ }
49
+ end
50
+
51
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
52
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
53
+
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
58
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
59
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
60
+ def initialize(attributes = {})
61
+ return unless attributes.is_a?(Hash)
62
+
63
+ # convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
65
+
66
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
67
+
68
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
69
+
70
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
71
+
72
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
73
+
74
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
75
+
76
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
77
+
78
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
79
+
80
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
81
+
82
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
83
+ end
84
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
85
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
86
+
87
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
88
+
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] other the other object to be compared
92
+ def ==(other)
93
+ return true if equal?(other)
94
+
95
+ self.class == other.class &&
96
+ defined_tags == other.defined_tags &&
97
+ display_name == other.display_name &&
98
+ freeform_tags == other.freeform_tags
99
+ end
100
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
101
+
102
+ # @see the `==` method
103
+ # @param [Object] other the other object to be compared
104
+ def eql?(other)
105
+ self == other
106
+ end
107
+
108
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
109
+
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Fixnum] Hash code
113
+ def hash
114
+ [defined_tags, display_name, freeform_tags].hash
115
+ end
116
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
117
+
118
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
119
+
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+
127
+ self.class.swagger_types.each_pair do |key, type|
128
+ if type =~ /^Array<(.*)>/i
129
+ # check to ensure the input is an array given that the the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ public_method("#{key}=").call(
133
+ attributes[self.class.attribute_map[key]]
134
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
135
+ )
136
+ end
137
+ elsif !attributes[self.class.attribute_map[key]].nil?
138
+ public_method("#{key}=").call(
139
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
140
+ )
141
+ end
142
+ # or else data not found in attributes(hash), not an issue as the data can be optional
143
+ end
144
+
145
+ self
146
+ end
147
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
148
+
149
+ # Returns the string representation of the object
150
+ # @return [String] String presentation of the object
151
+ def to_s
152
+ to_hash.to_s
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = public_method(attr).call
161
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
162
+
163
+ hash[param] = _to_hash(value)
164
+ end
165
+ hash
166
+ end
167
+
168
+ private
169
+
170
+ # Outputs non-array value in the form of hash
171
+ # For object, use to_hash. Otherwise, just return the value
172
+ # @param [Object] value Any valid value
173
+ # @return [Hash] Returns the value in the form of hash
174
+ def _to_hash(value)
175
+ if value.is_a?(Array)
176
+ value.compact.map { |v| _to_hash(v) }
177
+ elsif value.is_a?(Hash)
178
+ {}.tap do |hash|
179
+ value.each { |k, v| hash[k] = _to_hash(v) }
180
+ end
181
+ elsif value.respond_to? :to_hash
182
+ value.to_hash
183
+ else
184
+ value
185
+ end
186
+ end
187
+ end
188
+ end
189
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,153 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # UpdateNetworkSecurityGroupSecurityRulesDetails model.
8
+ class Core::Models::UpdateNetworkSecurityGroupSecurityRulesDetails
9
+ # The NSG security rules to update.
10
+ # @return [Array<OCI::Core::Models::UpdateSecurityRuleDetails>]
11
+ attr_accessor :security_rules
12
+
13
+ # Attribute mapping from ruby-style variable name to JSON key.
14
+ def self.attribute_map
15
+ {
16
+ # rubocop:disable Style/SymbolLiteral
17
+ 'security_rules': :'securityRules'
18
+ # rubocop:enable Style/SymbolLiteral
19
+ }
20
+ end
21
+
22
+ # Attribute type mapping.
23
+ def self.swagger_types
24
+ {
25
+ # rubocop:disable Style/SymbolLiteral
26
+ 'security_rules': :'Array<OCI::Core::Models::UpdateSecurityRuleDetails>'
27
+ # rubocop:enable Style/SymbolLiteral
28
+ }
29
+ end
30
+
31
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
32
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
33
+
34
+
35
+ # Initializes the object
36
+ # @param [Hash] attributes Model attributes in the form of hash
37
+ # @option attributes [Array<OCI::Core::Models::UpdateSecurityRuleDetails>] :security_rules The value to assign to the {#security_rules} property
38
+ def initialize(attributes = {})
39
+ return unless attributes.is_a?(Hash)
40
+
41
+ # convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
43
+
44
+ self.security_rules = attributes[:'securityRules'] if attributes[:'securityRules']
45
+
46
+ raise 'You cannot provide both :securityRules and :security_rules' if attributes.key?(:'securityRules') && attributes.key?(:'security_rules')
47
+
48
+ self.security_rules = attributes[:'security_rules'] if attributes[:'security_rules']
49
+ end
50
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
51
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
52
+
53
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
54
+
55
+
56
+ # Checks equality by comparing each attribute.
57
+ # @param [Object] other the other object to be compared
58
+ def ==(other)
59
+ return true if equal?(other)
60
+
61
+ self.class == other.class &&
62
+ security_rules == other.security_rules
63
+ end
64
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
65
+
66
+ # @see the `==` method
67
+ # @param [Object] other the other object to be compared
68
+ def eql?(other)
69
+ self == other
70
+ end
71
+
72
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
73
+
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [security_rules].hash
79
+ end
80
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
81
+
82
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
83
+
84
+
85
+ # Builds the object from hash
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ # @return [Object] Returns the model itself
88
+ def build_from_hash(attributes)
89
+ return nil unless attributes.is_a?(Hash)
90
+
91
+ self.class.swagger_types.each_pair do |key, type|
92
+ if type =~ /^Array<(.*)>/i
93
+ # check to ensure the input is an array given that the the attribute
94
+ # is documented as an array but the input is not
95
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
96
+ public_method("#{key}=").call(
97
+ attributes[self.class.attribute_map[key]]
98
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
99
+ )
100
+ end
101
+ elsif !attributes[self.class.attribute_map[key]].nil?
102
+ public_method("#{key}=").call(
103
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
104
+ )
105
+ end
106
+ # or else data not found in attributes(hash), not an issue as the data can be optional
107
+ end
108
+
109
+ self
110
+ end
111
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
112
+
113
+ # Returns the string representation of the object
114
+ # @return [String] String presentation of the object
115
+ def to_s
116
+ to_hash.to_s
117
+ end
118
+
119
+ # Returns the object in the form of hash
120
+ # @return [Hash] Returns the object in the form of hash
121
+ def to_hash
122
+ hash = {}
123
+ self.class.attribute_map.each_pair do |attr, param|
124
+ value = public_method(attr).call
125
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
126
+
127
+ hash[param] = _to_hash(value)
128
+ end
129
+ hash
130
+ end
131
+
132
+ private
133
+
134
+ # Outputs non-array value in the form of hash
135
+ # For object, use to_hash. Otherwise, just return the value
136
+ # @param [Object] value Any valid value
137
+ # @return [Hash] Returns the value in the form of hash
138
+ def _to_hash(value)
139
+ if value.is_a?(Array)
140
+ value.compact.map { |v| _to_hash(v) }
141
+ elsif value.is_a?(Hash)
142
+ {}.tap do |hash|
143
+ value.each { |k, v| hash[k] = _to_hash(v) }
144
+ end
145
+ elsif value.respond_to? :to_hash
146
+ value.to_hash
147
+ else
148
+ value
149
+ end
150
+ end
151
+ end
152
+ end
153
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -0,0 +1,404 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
+ module OCI
7
+ # A rule for allowing inbound (`direction`= INGRESS) or outbound (`direction`= EGRESS) IP packets.
8
+ #
9
+ class Core::Models::UpdateSecurityRuleDetails
10
+ DESTINATION_TYPE_ENUM = [
11
+ DESTINATION_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'.freeze,
12
+ DESTINATION_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'.freeze,
13
+ DESTINATION_TYPE_NETWORK_SECURITY_GROUP = 'NETWORK_SECURITY_GROUP'.freeze
14
+ ].freeze
15
+
16
+ DIRECTION_ENUM = [
17
+ DIRECTION_EGRESS = 'EGRESS'.freeze,
18
+ DIRECTION_INGRESS = 'INGRESS'.freeze
19
+ ].freeze
20
+
21
+ SOURCE_TYPE_ENUM = [
22
+ SOURCE_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'.freeze,
23
+ SOURCE_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'.freeze,
24
+ SOURCE_TYPE_NETWORK_SECURITY_GROUP = 'NETWORK_SECURITY_GROUP'.freeze
25
+ ].freeze
26
+
27
+ # An optional description of your choice for the rule.
28
+ #
29
+ # @return [String]
30
+ attr_accessor :description
31
+
32
+ # Conceptually, this is the range of IP addresses that a packet originating from the instance
33
+ # can go to.
34
+ #
35
+ # Allowed values:
36
+ #
37
+ # * An IP address range in CIDR notation. For example: `192.168.1.0/24`
38
+ #
39
+ # * The `cidrBlock` value for a {Service}, if you're
40
+ # setting up a security rule for traffic destined for a particular `Service` through
41
+ # a service gateway. For example: `oci-phx-objectstorage`.
42
+ #
43
+ # * The OCID of a {NetworkSecurityGroup} in the same
44
+ # VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control
45
+ # traffic between VNICs in the same NSG.
46
+ #
47
+ # @return [String]
48
+ attr_accessor :destination
49
+
50
+ # Type of destination for the rule. Required if `direction` = `EGRESS`.
51
+ #
52
+ # Allowed values:
53
+ #
54
+ # * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation.
55
+ #
56
+ # * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a
57
+ # {Service} (the rule is for traffic destined for a
58
+ # particular `Service` through a service gateway).
59
+ #
60
+ # * `NETWORK_SECURITY_GROUP`: If the rule's `destination` is the OCID of a
61
+ # {NetworkSecurityGroup}.
62
+ #
63
+ # @return [String]
64
+ attr_reader :destination_type
65
+
66
+ # **[Required]** Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets,
67
+ # or `INGRESS` for rules to allow inbound IP packets.
68
+ #
69
+ # @return [String]
70
+ attr_reader :direction
71
+
72
+ # Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code
73
+ # as defined in:
74
+ # - [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml)
75
+ # - [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml)
76
+ #
77
+ # If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and
78
+ # codes are allowed. If you do provide this object, the type is required and the code is optional.
79
+ # To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 (\"Destination
80
+ # Unreachable\") code 4 (\"Fragmentation Needed and Don't Fragment was Set\"). If you need to specify
81
+ # multiple codes for a single type, create a separate security rule for each.
82
+ #
83
+ # @return [OCI::Core::Models::IcmpOptions]
84
+ attr_accessor :icmp_options
85
+
86
+ # **[Required]** The Oracle-assigned ID of the security rule that you want to update. You can't change this value.
87
+ #
88
+ # Example: `04ABEC`
89
+ #
90
+ # @return [String]
91
+ attr_accessor :id
92
+
93
+ # A stateless rule allows traffic in one direction. Remember to add a corresponding
94
+ # stateless rule in the other direction if you need to support bidirectional traffic. For
95
+ # example, if egress traffic allows TCP destination port 80, there should be an ingress
96
+ # rule to allow TCP source port 80. Defaults to false, which means the rule is stateful
97
+ # and a corresponding rule is not necessary for bidirectional traffic.
98
+ #
99
+ # @return [BOOLEAN]
100
+ attr_accessor :is_stateless
101
+
102
+ # **[Required]** The transport protocol. Specify either `all` or an IPv4 protocol number as
103
+ # defined in
104
+ # [Protocol Numbers](http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml).
105
+ # Options are supported only for ICMP (\"1\"), TCP (\"6\"), UDP (\"17\"), and ICMPv6 (\"58\").
106
+ #
107
+ # @return [String]
108
+ attr_accessor :protocol
109
+
110
+ # Conceptually, this is the range of IP addresses that a packet coming into the instance
111
+ # can come from.
112
+ #
113
+ # Allowed values:
114
+ #
115
+ # * An IP address range in CIDR notation. For example: `192.168.1.0/24`
116
+ #
117
+ # * The `cidrBlock` value for a {Service}, if you're
118
+ # setting up a security rule for traffic coming from a particular `Service` through
119
+ # a service gateway. For example: `oci-phx-objectstorage`.
120
+ #
121
+ # * The OCID of a {NetworkSecurityGroup} in the same
122
+ # VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control
123
+ # traffic between VNICs in the same NSG.
124
+ #
125
+ # @return [String]
126
+ attr_accessor :source
127
+
128
+ # Type of source for the rule. Required if `direction` = `INGRESS`.
129
+ #
130
+ # * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation.
131
+ #
132
+ # * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a
133
+ # {Service} (the rule is for traffic coming from a
134
+ # particular `Service` through a service gateway).
135
+ #
136
+ # * `NETWORK_SECURITY_GROUP`: If the rule's `destination` is the OCID of a
137
+ # {NetworkSecurityGroup}.
138
+ #
139
+ # @return [String]
140
+ attr_reader :source_type
141
+
142
+ # Optional and valid only for TCP. Use to specify particular destination ports for TCP rules.
143
+ # If you specify TCP as the protocol but omit this object, then all destination ports are allowed.
144
+ #
145
+ # @return [OCI::Core::Models::TcpOptions]
146
+ attr_accessor :tcp_options
147
+
148
+ # Optional and valid only for UDP. Use to specify particular destination ports for UDP rules.
149
+ # If you specify UDP as the protocol but omit this object, then all destination ports are allowed.
150
+ #
151
+ # @return [OCI::Core::Models::UdpOptions]
152
+ attr_accessor :udp_options
153
+
154
+ # Attribute mapping from ruby-style variable name to JSON key.
155
+ def self.attribute_map
156
+ {
157
+ # rubocop:disable Style/SymbolLiteral
158
+ 'description': :'description',
159
+ 'destination': :'destination',
160
+ 'destination_type': :'destinationType',
161
+ 'direction': :'direction',
162
+ 'icmp_options': :'icmpOptions',
163
+ 'id': :'id',
164
+ 'is_stateless': :'isStateless',
165
+ 'protocol': :'protocol',
166
+ 'source': :'source',
167
+ 'source_type': :'sourceType',
168
+ 'tcp_options': :'tcpOptions',
169
+ 'udp_options': :'udpOptions'
170
+ # rubocop:enable Style/SymbolLiteral
171
+ }
172
+ end
173
+
174
+ # Attribute type mapping.
175
+ def self.swagger_types
176
+ {
177
+ # rubocop:disable Style/SymbolLiteral
178
+ 'description': :'String',
179
+ 'destination': :'String',
180
+ 'destination_type': :'String',
181
+ 'direction': :'String',
182
+ 'icmp_options': :'OCI::Core::Models::IcmpOptions',
183
+ 'id': :'String',
184
+ 'is_stateless': :'BOOLEAN',
185
+ 'protocol': :'String',
186
+ 'source': :'String',
187
+ 'source_type': :'String',
188
+ 'tcp_options': :'OCI::Core::Models::TcpOptions',
189
+ 'udp_options': :'OCI::Core::Models::UdpOptions'
190
+ # rubocop:enable Style/SymbolLiteral
191
+ }
192
+ end
193
+
194
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
195
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
196
+
197
+
198
+ # Initializes the object
199
+ # @param [Hash] attributes Model attributes in the form of hash
200
+ # @option attributes [String] :description The value to assign to the {#description} property
201
+ # @option attributes [String] :destination The value to assign to the {#destination} property
202
+ # @option attributes [String] :destination_type The value to assign to the {#destination_type} property
203
+ # @option attributes [String] :direction The value to assign to the {#direction} property
204
+ # @option attributes [OCI::Core::Models::IcmpOptions] :icmp_options The value to assign to the {#icmp_options} property
205
+ # @option attributes [String] :id The value to assign to the {#id} property
206
+ # @option attributes [BOOLEAN] :is_stateless The value to assign to the {#is_stateless} property
207
+ # @option attributes [String] :protocol The value to assign to the {#protocol} property
208
+ # @option attributes [String] :source The value to assign to the {#source} property
209
+ # @option attributes [String] :source_type The value to assign to the {#source_type} property
210
+ # @option attributes [OCI::Core::Models::TcpOptions] :tcp_options The value to assign to the {#tcp_options} property
211
+ # @option attributes [OCI::Core::Models::UdpOptions] :udp_options The value to assign to the {#udp_options} property
212
+ def initialize(attributes = {})
213
+ return unless attributes.is_a?(Hash)
214
+
215
+ # convert string to symbol for hash key
216
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
217
+
218
+ self.description = attributes[:'description'] if attributes[:'description']
219
+
220
+ self.destination = attributes[:'destination'] if attributes[:'destination']
221
+
222
+ self.destination_type = attributes[:'destinationType'] if attributes[:'destinationType']
223
+
224
+ raise 'You cannot provide both :destinationType and :destination_type' if attributes.key?(:'destinationType') && attributes.key?(:'destination_type')
225
+
226
+ self.destination_type = attributes[:'destination_type'] if attributes[:'destination_type']
227
+
228
+ self.direction = attributes[:'direction'] if attributes[:'direction']
229
+
230
+ self.icmp_options = attributes[:'icmpOptions'] if attributes[:'icmpOptions']
231
+
232
+ raise 'You cannot provide both :icmpOptions and :icmp_options' if attributes.key?(:'icmpOptions') && attributes.key?(:'icmp_options')
233
+
234
+ self.icmp_options = attributes[:'icmp_options'] if attributes[:'icmp_options']
235
+
236
+ self.id = attributes[:'id'] if attributes[:'id']
237
+
238
+ self.is_stateless = attributes[:'isStateless'] unless attributes[:'isStateless'].nil?
239
+
240
+ raise 'You cannot provide both :isStateless and :is_stateless' if attributes.key?(:'isStateless') && attributes.key?(:'is_stateless')
241
+
242
+ self.is_stateless = attributes[:'is_stateless'] unless attributes[:'is_stateless'].nil?
243
+
244
+ self.protocol = attributes[:'protocol'] if attributes[:'protocol']
245
+
246
+ self.source = attributes[:'source'] if attributes[:'source']
247
+
248
+ self.source_type = attributes[:'sourceType'] if attributes[:'sourceType']
249
+
250
+ raise 'You cannot provide both :sourceType and :source_type' if attributes.key?(:'sourceType') && attributes.key?(:'source_type')
251
+
252
+ self.source_type = attributes[:'source_type'] if attributes[:'source_type']
253
+
254
+ self.tcp_options = attributes[:'tcpOptions'] if attributes[:'tcpOptions']
255
+
256
+ raise 'You cannot provide both :tcpOptions and :tcp_options' if attributes.key?(:'tcpOptions') && attributes.key?(:'tcp_options')
257
+
258
+ self.tcp_options = attributes[:'tcp_options'] if attributes[:'tcp_options']
259
+
260
+ self.udp_options = attributes[:'udpOptions'] if attributes[:'udpOptions']
261
+
262
+ raise 'You cannot provide both :udpOptions and :udp_options' if attributes.key?(:'udpOptions') && attributes.key?(:'udp_options')
263
+
264
+ self.udp_options = attributes[:'udp_options'] if attributes[:'udp_options']
265
+ end
266
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
267
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
268
+
269
+ # Custom attribute writer method checking allowed values (enum).
270
+ # @param [Object] destination_type Object to be assigned
271
+ def destination_type=(destination_type)
272
+ raise "Invalid value for 'destination_type': this must be one of the values in DESTINATION_TYPE_ENUM." if destination_type && !DESTINATION_TYPE_ENUM.include?(destination_type)
273
+
274
+ @destination_type = destination_type
275
+ end
276
+
277
+ # Custom attribute writer method checking allowed values (enum).
278
+ # @param [Object] direction Object to be assigned
279
+ def direction=(direction)
280
+ raise "Invalid value for 'direction': this must be one of the values in DIRECTION_ENUM." if direction && !DIRECTION_ENUM.include?(direction)
281
+
282
+ @direction = direction
283
+ end
284
+
285
+ # Custom attribute writer method checking allowed values (enum).
286
+ # @param [Object] source_type Object to be assigned
287
+ def source_type=(source_type)
288
+ raise "Invalid value for 'source_type': this must be one of the values in SOURCE_TYPE_ENUM." if source_type && !SOURCE_TYPE_ENUM.include?(source_type)
289
+
290
+ @source_type = source_type
291
+ end
292
+
293
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
294
+
295
+
296
+ # Checks equality by comparing each attribute.
297
+ # @param [Object] other the other object to be compared
298
+ def ==(other)
299
+ return true if equal?(other)
300
+
301
+ self.class == other.class &&
302
+ description == other.description &&
303
+ destination == other.destination &&
304
+ destination_type == other.destination_type &&
305
+ direction == other.direction &&
306
+ icmp_options == other.icmp_options &&
307
+ id == other.id &&
308
+ is_stateless == other.is_stateless &&
309
+ protocol == other.protocol &&
310
+ source == other.source &&
311
+ source_type == other.source_type &&
312
+ tcp_options == other.tcp_options &&
313
+ udp_options == other.udp_options
314
+ end
315
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
316
+
317
+ # @see the `==` method
318
+ # @param [Object] other the other object to be compared
319
+ def eql?(other)
320
+ self == other
321
+ end
322
+
323
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
324
+
325
+
326
+ # Calculates hash code according to all attributes.
327
+ # @return [Fixnum] Hash code
328
+ def hash
329
+ [description, destination, destination_type, direction, icmp_options, id, is_stateless, protocol, source, source_type, tcp_options, udp_options].hash
330
+ end
331
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
332
+
333
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
334
+
335
+
336
+ # Builds the object from hash
337
+ # @param [Hash] attributes Model attributes in the form of hash
338
+ # @return [Object] Returns the model itself
339
+ def build_from_hash(attributes)
340
+ return nil unless attributes.is_a?(Hash)
341
+
342
+ self.class.swagger_types.each_pair do |key, type|
343
+ if type =~ /^Array<(.*)>/i
344
+ # check to ensure the input is an array given that the the attribute
345
+ # is documented as an array but the input is not
346
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
347
+ public_method("#{key}=").call(
348
+ attributes[self.class.attribute_map[key]]
349
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
350
+ )
351
+ end
352
+ elsif !attributes[self.class.attribute_map[key]].nil?
353
+ public_method("#{key}=").call(
354
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
355
+ )
356
+ end
357
+ # or else data not found in attributes(hash), not an issue as the data can be optional
358
+ end
359
+
360
+ self
361
+ end
362
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
363
+
364
+ # Returns the string representation of the object
365
+ # @return [String] String presentation of the object
366
+ def to_s
367
+ to_hash.to_s
368
+ end
369
+
370
+ # Returns the object in the form of hash
371
+ # @return [Hash] Returns the object in the form of hash
372
+ def to_hash
373
+ hash = {}
374
+ self.class.attribute_map.each_pair do |attr, param|
375
+ value = public_method(attr).call
376
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
377
+
378
+ hash[param] = _to_hash(value)
379
+ end
380
+ hash
381
+ end
382
+
383
+ private
384
+
385
+ # Outputs non-array value in the form of hash
386
+ # For object, use to_hash. Otherwise, just return the value
387
+ # @param [Object] value Any valid value
388
+ # @return [Hash] Returns the value in the form of hash
389
+ def _to_hash(value)
390
+ if value.is_a?(Array)
391
+ value.compact.map { |v| _to_hash(v) }
392
+ elsif value.is_a?(Hash)
393
+ {}.tap do |hash|
394
+ value.each { |k, v| hash[k] = _to_hash(v) }
395
+ end
396
+ elsif value.respond_to? :to_hash
397
+ value.to_hash
398
+ else
399
+ value
400
+ end
401
+ end
402
+ end
403
+ end
404
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength