oci 2.3.0 → 2.3.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 (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/core/blockstorage_client.rb +412 -13
  4. data/lib/oci/core/blockstorage_client_composite_operations.rb +158 -0
  5. data/lib/oci/core/compute_client.rb +6 -7
  6. data/lib/oci/core/core.rb +13 -0
  7. data/lib/oci/core/models/boot_volume.rb +68 -1
  8. data/lib/oci/core/models/boot_volume_backup.rb +435 -0
  9. data/lib/oci/core/models/boot_volume_source_details.rb +163 -0
  10. data/lib/oci/core/models/boot_volume_source_from_boot_volume_backup_details.rb +154 -0
  11. data/lib/oci/core/models/boot_volume_source_from_boot_volume_details.rb +154 -0
  12. data/lib/oci/core/models/create_boot_volume_backup_details.rb +227 -0
  13. data/lib/oci/core/models/create_boot_volume_details.rb +250 -0
  14. data/lib/oci/core/models/create_service_gateway_details.rb +228 -0
  15. data/lib/oci/core/models/egress_security_rule.rb +44 -3
  16. data/lib/oci/core/models/ingress_security_rule.rb +47 -3
  17. data/lib/oci/core/models/instance_source_via_image_details.rb +0 -1
  18. data/lib/oci/core/models/route_rule.rb +59 -2
  19. data/lib/oci/core/models/service.rb +185 -0
  20. data/lib/oci/core/models/service_gateway.rb +325 -0
  21. data/lib/oci/core/models/service_id_request_details.rb +151 -0
  22. data/lib/oci/core/models/service_id_response_details.rb +165 -0
  23. data/lib/oci/core/models/update_boot_volume_backup_details.rb +189 -0
  24. data/lib/oci/core/models/update_boot_volume_details.rb +41 -4
  25. data/lib/oci/core/models/update_service_gateway_details.rb +225 -0
  26. data/lib/oci/core/models/volume_group.rb +21 -7
  27. data/lib/oci/core/models/volume_group_backup.rb +39 -7
  28. data/lib/oci/core/models/volume_group_source_from_volumes_details.rb +1 -1
  29. data/lib/oci/core/virtual_network_client.rb +582 -1
  30. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  31. data/lib/oci/version.rb +1 -1
  32. metadata +15 -2
@@ -0,0 +1,228 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # CreateServiceGatewayDetails model.
8
+ class Core::Models::CreateServiceGatewayDetails # rubocop:disable Metrics/LineLength
9
+ # **[Required]** The [OCID] (https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment to contain the Service Gateway.
10
+ #
11
+ # @return [String]
12
+ attr_accessor :compartment_id
13
+
14
+ # Defined tags for this resource. Each key is predefined and scoped to a namespace.
15
+ # For more information, see [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
16
+ #
17
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
18
+ #
19
+ # @return [Hash<String, Hash<String, Object>>]
20
+ attr_accessor :defined_tags
21
+
22
+ # A user-friendly name. Does not have to be unique, and it's changeable.
23
+ # Avoid entering confidential information.
24
+ #
25
+ # @return [String]
26
+ attr_accessor :display_name
27
+
28
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
29
+ # predefined name, type, or namespace. For more information, see
30
+ # [Resource Tags](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/resourcetags.htm).
31
+ #
32
+ # Example: `{\"Department\": \"Finance\"}`
33
+ #
34
+ # @return [Hash<String, String>]
35
+ attr_accessor :freeform_tags
36
+
37
+ # **[Required]** List of the Service OCIDs. These are the Services which will be enabled on the Service Gateway. This list can be empty.
38
+ # @return [Array<OCI::Core::Models::ServiceIdRequestDetails>]
39
+ attr_accessor :services
40
+
41
+ # **[Required]** The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the VCN.
42
+ # @return [String]
43
+ attr_accessor :vcn_id
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ # rubocop:disable Style/SymbolLiteral
49
+ 'compartment_id': :'compartmentId',
50
+ 'defined_tags': :'definedTags',
51
+ 'display_name': :'displayName',
52
+ 'freeform_tags': :'freeformTags',
53
+ 'services': :'services',
54
+ 'vcn_id': :'vcnId'
55
+ # rubocop:enable Style/SymbolLiteral
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ # rubocop:disable Style/SymbolLiteral
63
+ 'compartment_id': :'String',
64
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
65
+ 'display_name': :'String',
66
+ 'freeform_tags': :'Hash<String, String>',
67
+ 'services': :'Array<OCI::Core::Models::ServiceIdRequestDetails>',
68
+ 'vcn_id': :'String'
69
+ # rubocop:enable Style/SymbolLiteral
70
+ }
71
+ end
72
+
73
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
74
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
75
+
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
80
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
81
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
82
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
83
+ # @option attributes [Array<OCI::Core::Models::ServiceIdRequestDetails>] :services The value to assign to the {#services} property
84
+ # @option attributes [String] :vcn_id The value to assign to the {#vcn_id} property
85
+ def initialize(attributes = {})
86
+ return unless attributes.is_a?(Hash)
87
+
88
+ # convert string to symbol for hash key
89
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
90
+
91
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
92
+
93
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
94
+
95
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
96
+
97
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
98
+
99
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
100
+
101
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
102
+
103
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
104
+
105
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
106
+
107
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
108
+
109
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
110
+
111
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
112
+
113
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
114
+
115
+ self.services = attributes[:'services'] if attributes[:'services']
116
+
117
+ self.vcn_id = attributes[:'vcnId'] if attributes[:'vcnId']
118
+
119
+ raise 'You cannot provide both :vcnId and :vcn_id' if attributes.key?(:'vcnId') && attributes.key?(:'vcn_id')
120
+
121
+ self.vcn_id = attributes[:'vcn_id'] if attributes[:'vcn_id']
122
+ end
123
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
124
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
125
+
126
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
127
+
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] other the other object to be compared
131
+ def ==(other)
132
+ return true if equal?(other)
133
+ self.class == other.class &&
134
+ compartment_id == other.compartment_id &&
135
+ defined_tags == other.defined_tags &&
136
+ display_name == other.display_name &&
137
+ freeform_tags == other.freeform_tags &&
138
+ services == other.services &&
139
+ vcn_id == other.vcn_id
140
+ end
141
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
142
+
143
+ # @see the `==` method
144
+ # @param [Object] other the other object to be compared
145
+ def eql?(other)
146
+ self == other
147
+ end
148
+
149
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
150
+
151
+
152
+ # Calculates hash code according to all attributes.
153
+ # @return [Fixnum] Hash code
154
+ def hash
155
+ [compartment_id, defined_tags, display_name, freeform_tags, services, vcn_id].hash
156
+ end
157
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
158
+
159
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
160
+
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def build_from_hash(attributes)
166
+ return nil unless attributes.is_a?(Hash)
167
+ self.class.swagger_types.each_pair do |key, type|
168
+ if type =~ /^Array<(.*)>/i
169
+ # check to ensure the input is an array given that the the attribute
170
+ # is documented as an array but the input is not
171
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
172
+ public_method("#{key}=").call(
173
+ attributes[self.class.attribute_map[key]]
174
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
175
+ )
176
+ end
177
+ elsif !attributes[self.class.attribute_map[key]].nil?
178
+ public_method("#{key}=").call(
179
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
180
+ )
181
+ end
182
+ # or else data not found in attributes(hash), not an issue as the data can be optional
183
+ end
184
+
185
+ self
186
+ end
187
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = public_method(attr).call
201
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
202
+ hash[param] = _to_hash(value)
203
+ end
204
+ hash
205
+ end
206
+
207
+ private
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end
228
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -1,17 +1,31 @@
1
1
  # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
+ require 'logger'
4
5
 
5
6
  # rubocop:disable Lint/UnneededCopDisableDirective
6
7
  module OCI
7
8
  # A rule for allowing outbound IP packets.
8
9
  class Core::Models::EgressSecurityRule # rubocop:disable Metrics/LineLength
9
- # **[Required]** The destination CIDR block for the egress rule. This is the range of IP addresses that a
10
- # packet originating from the instance can go to.
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_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
14
+ ].freeze
15
+
16
+ # **[Required]** The destination service cidrBlock or destination IP address range in CIDR notation for the egress rule.
17
+ # This is the range of IP addresses that a packet originating from the instance can go to.
11
18
  #
12
19
  # @return [String]
13
20
  attr_accessor :destination
14
21
 
22
+ # Type of destination for EgressSecurityRule. SERVICE_CIDR_BLOCK should be used if destination is a service
23
+ # cidrBlock. CIDR_BLOCK should be used if destination is IP address range in CIDR notation.
24
+ # It defaults to CIDR_BLOCK, if not specified.
25
+ #
26
+ # @return [String]
27
+ attr_reader :destination_type
28
+
15
29
  # Optional and valid only for ICMP. Use to specify a particular ICMP type and code
16
30
  # as defined in
17
31
  # [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml).
@@ -58,6 +72,7 @@ module OCI
58
72
  {
59
73
  # rubocop:disable Style/SymbolLiteral
60
74
  'destination': :'destination',
75
+ 'destination_type': :'destinationType',
61
76
  'icmp_options': :'icmpOptions',
62
77
  'is_stateless': :'isStateless',
63
78
  'protocol': :'protocol',
@@ -72,6 +87,7 @@ module OCI
72
87
  {
73
88
  # rubocop:disable Style/SymbolLiteral
74
89
  'destination': :'String',
90
+ 'destination_type': :'String',
75
91
  'icmp_options': :'OCI::Core::Models::IcmpOptions',
76
92
  'is_stateless': :'BOOLEAN',
77
93
  'protocol': :'String',
@@ -88,6 +104,7 @@ module OCI
88
104
  # Initializes the object
89
105
  # @param [Hash] attributes Model attributes in the form of hash
90
106
  # @option attributes [String] :destination The value to assign to the {#destination} property
107
+ # @option attributes [String] :destination_type The value to assign to the {#destination_type} property
91
108
  # @option attributes [OCI::Core::Models::IcmpOptions] :icmp_options The value to assign to the {#icmp_options} property
92
109
  # @option attributes [BOOLEAN] :is_stateless The value to assign to the {#is_stateless} property
93
110
  # @option attributes [String] :protocol The value to assign to the {#protocol} property
@@ -101,6 +118,14 @@ module OCI
101
118
 
102
119
  self.destination = attributes[:'destination'] if attributes[:'destination']
103
120
 
121
+ self.destination_type = attributes[:'destinationType'] if attributes[:'destinationType']
122
+ self.destination_type = "CIDR_BLOCK" if destination_type.nil? && !attributes.key?(:'destinationType') # rubocop:disable Style/StringLiterals
123
+
124
+ raise 'You cannot provide both :destinationType and :destination_type' if attributes.key?(:'destinationType') && attributes.key?(:'destination_type')
125
+
126
+ self.destination_type = attributes[:'destination_type'] if attributes[:'destination_type']
127
+ self.destination_type = "CIDR_BLOCK" if destination_type.nil? && !attributes.key?(:'destinationType') && !attributes.key?(:'destination_type') # rubocop:disable Style/StringLiterals
128
+
104
129
  self.icmp_options = attributes[:'icmpOptions'] if attributes[:'icmpOptions']
105
130
 
106
131
  raise 'You cannot provide both :icmpOptions and :icmp_options' if attributes.key?(:'icmpOptions') && attributes.key?(:'icmp_options')
@@ -130,6 +155,21 @@ module OCI
130
155
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
131
156
  # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
132
157
 
158
+ # Custom attribute writer method checking allowed values (enum).
159
+ # @param [Object] destination_type Object to be assigned
160
+ def destination_type=(destination_type)
161
+ # rubocop:disable Style/ConditionalAssignment
162
+ if destination_type && !DESTINATION_TYPE_ENUM.include?(destination_type)
163
+ # rubocop: disable Metrics/LineLength
164
+ OCI.logger.debug("Unknown value for 'destination_type' [" + destination_type + "]. Mapping to 'DESTINATION_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
165
+ # rubocop: enable Metrics/LineLength
166
+ @destination_type = DESTINATION_TYPE_UNKNOWN_ENUM_VALUE
167
+ else
168
+ @destination_type = destination_type
169
+ end
170
+ # rubocop:enable Style/ConditionalAssignment
171
+ end
172
+
133
173
  # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
134
174
 
135
175
 
@@ -139,6 +179,7 @@ module OCI
139
179
  return true if equal?(other)
140
180
  self.class == other.class &&
141
181
  destination == other.destination &&
182
+ destination_type == other.destination_type &&
142
183
  icmp_options == other.icmp_options &&
143
184
  is_stateless == other.is_stateless &&
144
185
  protocol == other.protocol &&
@@ -159,7 +200,7 @@ module OCI
159
200
  # Calculates hash code according to all attributes.
160
201
  # @return [Fixnum] Hash code
161
202
  def hash
162
- [destination, icmp_options, is_stateless, protocol, tcp_options, udp_options].hash
203
+ [destination, destination_type, icmp_options, is_stateless, protocol, tcp_options, udp_options].hash
163
204
  end
164
205
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
165
206
 
@@ -1,11 +1,18 @@
1
1
  # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'date'
4
+ require 'logger'
4
5
 
5
6
  # rubocop:disable Lint/UnneededCopDisableDirective
6
7
  module OCI
7
8
  # A rule for allowing inbound IP packets.
8
9
  class Core::Models::IngressSecurityRule # rubocop:disable Metrics/LineLength
10
+ SOURCE_TYPE_ENUM = [
11
+ SOURCE_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'.freeze,
12
+ SOURCE_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'.freeze,
13
+ SOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
14
+ ].freeze
15
+
9
16
  # Optional and valid only for ICMP. Use to specify a particular ICMP type and code
10
17
  # as defined in
11
18
  # [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml).
@@ -35,12 +42,22 @@ module OCI
35
42
  # @return [String]
36
43
  attr_accessor :protocol
37
44
 
38
- # **[Required]** The source CIDR block for the ingress rule. This is the range of IP addresses that a
39
- # packet coming into the instance can come from.
45
+ # **[Required]** The source service cidrBlock or source IP address range in CIDR notation for the ingress rule. This is the
46
+ # range of IP addresses that a packet coming into the instance can come from.
47
+ #
48
+ # Examples: `10.12.0.0/16`
49
+ # `oci-phx-objectstorage`
40
50
  #
41
51
  # @return [String]
42
52
  attr_accessor :source
43
53
 
54
+ # Type of source for IngressSecurityRule. SERVICE_CIDR_BLOCK should be used if source is a service cidrBlock.
55
+ # CIDR_BLOCK should be used if source is IP address range in CIDR notation. It defaults to CIDR_BLOCK, if
56
+ # not specified.
57
+ #
58
+ # @return [String]
59
+ attr_reader :source_type
60
+
44
61
  # Optional and valid only for TCP. Use to specify particular destination ports for TCP rules.
45
62
  # If you specify TCP as the protocol but omit this object, then all destination ports are allowed.
46
63
  #
@@ -61,6 +78,7 @@ module OCI
61
78
  'is_stateless': :'isStateless',
62
79
  'protocol': :'protocol',
63
80
  'source': :'source',
81
+ 'source_type': :'sourceType',
64
82
  'tcp_options': :'tcpOptions',
65
83
  'udp_options': :'udpOptions'
66
84
  # rubocop:enable Style/SymbolLiteral
@@ -75,6 +93,7 @@ module OCI
75
93
  'is_stateless': :'BOOLEAN',
76
94
  'protocol': :'String',
77
95
  'source': :'String',
96
+ 'source_type': :'String',
78
97
  'tcp_options': :'OCI::Core::Models::TcpOptions',
79
98
  'udp_options': :'OCI::Core::Models::UdpOptions'
80
99
  # rubocop:enable Style/SymbolLiteral
@@ -91,6 +110,7 @@ module OCI
91
110
  # @option attributes [BOOLEAN] :is_stateless The value to assign to the {#is_stateless} property
92
111
  # @option attributes [String] :protocol The value to assign to the {#protocol} property
93
112
  # @option attributes [String] :source The value to assign to the {#source} property
113
+ # @option attributes [String] :source_type The value to assign to the {#source_type} property
94
114
  # @option attributes [OCI::Core::Models::TcpOptions] :tcp_options The value to assign to the {#tcp_options} property
95
115
  # @option attributes [OCI::Core::Models::UdpOptions] :udp_options The value to assign to the {#udp_options} property
96
116
  def initialize(attributes = {})
@@ -115,6 +135,14 @@ module OCI
115
135
 
116
136
  self.source = attributes[:'source'] if attributes[:'source']
117
137
 
138
+ self.source_type = attributes[:'sourceType'] if attributes[:'sourceType']
139
+ self.source_type = "CIDR_BLOCK" if source_type.nil? && !attributes.key?(:'sourceType') # rubocop:disable Style/StringLiterals
140
+
141
+ raise 'You cannot provide both :sourceType and :source_type' if attributes.key?(:'sourceType') && attributes.key?(:'source_type')
142
+
143
+ self.source_type = attributes[:'source_type'] if attributes[:'source_type']
144
+ self.source_type = "CIDR_BLOCK" if source_type.nil? && !attributes.key?(:'sourceType') && !attributes.key?(:'source_type') # rubocop:disable Style/StringLiterals
145
+
118
146
  self.tcp_options = attributes[:'tcpOptions'] if attributes[:'tcpOptions']
119
147
 
120
148
  raise 'You cannot provide both :tcpOptions and :tcp_options' if attributes.key?(:'tcpOptions') && attributes.key?(:'tcp_options')
@@ -130,6 +158,21 @@ module OCI
130
158
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
131
159
  # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
132
160
 
161
+ # Custom attribute writer method checking allowed values (enum).
162
+ # @param [Object] source_type Object to be assigned
163
+ def source_type=(source_type)
164
+ # rubocop:disable Style/ConditionalAssignment
165
+ if source_type && !SOURCE_TYPE_ENUM.include?(source_type)
166
+ # rubocop: disable Metrics/LineLength
167
+ OCI.logger.debug("Unknown value for 'source_type' [" + source_type + "]. Mapping to 'SOURCE_TYPE_UNKNOWN_ENUM_VALUE'") if OCI.logger
168
+ # rubocop: enable Metrics/LineLength
169
+ @source_type = SOURCE_TYPE_UNKNOWN_ENUM_VALUE
170
+ else
171
+ @source_type = source_type
172
+ end
173
+ # rubocop:enable Style/ConditionalAssignment
174
+ end
175
+
133
176
  # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
134
177
 
135
178
 
@@ -142,6 +185,7 @@ module OCI
142
185
  is_stateless == other.is_stateless &&
143
186
  protocol == other.protocol &&
144
187
  source == other.source &&
188
+ source_type == other.source_type &&
145
189
  tcp_options == other.tcp_options &&
146
190
  udp_options == other.udp_options
147
191
  end
@@ -159,7 +203,7 @@ module OCI
159
203
  # Calculates hash code according to all attributes.
160
204
  # @return [Fixnum] Hash code
161
205
  def hash
162
- [icmp_options, is_stateless, protocol, source, tcp_options, udp_options].hash
206
+ [icmp_options, is_stateless, protocol, source, source_type, tcp_options, udp_options].hash
163
207
  end
164
208
  # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
165
209