oci 2.0.6 → 2.0.7

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 (93) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +23 -1
  3. data/lib/oci.rb +4 -7
  4. data/lib/oci/api_client.rb +51 -6
  5. data/lib/oci/auth/auth.rb +5 -2
  6. data/lib/oci/auth/federation_client.rb +2 -2
  7. data/lib/oci/auth/internal/auth_token_request_signer.rb +2 -2
  8. data/lib/oci/auth/security_token_container.rb +2 -2
  9. data/lib/oci/auth/session_key_supplier.rb +3 -4
  10. data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +30 -17
  11. data/lib/oci/auth/signers/security_token_signer.rb +13 -6
  12. data/lib/oci/auth/signers/x509_federation_client_based_security_token_signer.rb +8 -4
  13. data/lib/oci/auth/url_based_certificate_retriever.rb +3 -4
  14. data/lib/oci/auth/util.rb +6 -4
  15. data/lib/oci/base_signer.rb +54 -50
  16. data/lib/oci/config_file_loader.rb +3 -11
  17. data/lib/oci/core/blockstorage_client.rb +211 -0
  18. data/lib/oci/core/compute_client.rb +4 -2
  19. data/lib/oci/core/core.rb +9 -0
  20. data/lib/oci/core/models/attach_i_scsi_volume_details.rb +5 -1
  21. data/lib/oci/core/models/attach_volume_details.rb +13 -1
  22. data/lib/oci/core/models/create_public_ip_details.rb +186 -0
  23. data/lib/oci/core/models/create_vnic_details.rb +8 -2
  24. data/lib/oci/core/models/create_volume_backup_details.rb +27 -1
  25. data/lib/oci/core/models/create_volume_backup_policy_assignment_details.rb +133 -0
  26. data/lib/oci/core/models/create_volume_details.rb +15 -1
  27. data/lib/oci/core/models/get_public_ip_by_ip_address_details.rb +125 -0
  28. data/lib/oci/core/models/get_public_ip_by_private_ip_id_details.rb +124 -0
  29. data/lib/oci/core/models/i_scsi_volume_attachment.rb +5 -1
  30. data/lib/oci/core/models/public_ip.rb +328 -0
  31. data/lib/oci/core/models/update_public_ip_details.rb +140 -0
  32. data/lib/oci/core/models/volume_attachment.rb +13 -1
  33. data/lib/oci/core/models/volume_backup.rb +72 -1
  34. data/lib/oci/core/models/volume_backup_policy.rb +161 -0
  35. data/lib/oci/core/models/volume_backup_policy_assignment.rb +159 -0
  36. data/lib/oci/core/models/volume_backup_schedule.rb +191 -0
  37. data/lib/oci/core/virtual_network_client.rb +374 -4
  38. data/lib/oci/database/database_client.rb +3 -1
  39. data/lib/oci/dns/dns.rb +34 -0
  40. data/lib/oci/dns/dns_client.rb +985 -0
  41. data/lib/oci/dns/models/create_zone_details.rb +174 -0
  42. data/lib/oci/dns/models/external_master.rb +145 -0
  43. data/lib/oci/dns/models/patch_domain_records_details.rb +120 -0
  44. data/lib/oci/dns/models/patch_rr_set_details.rb +120 -0
  45. data/lib/oci/dns/models/patch_zone_records_details.rb +120 -0
  46. data/lib/oci/dns/models/record.rb +204 -0
  47. data/lib/oci/dns/models/record_collection.rb +121 -0
  48. data/lib/oci/dns/models/record_details.rb +204 -0
  49. data/lib/oci/dns/models/record_operation.rb +253 -0
  50. data/lib/oci/dns/models/rr_set.rb +123 -0
  51. data/lib/oci/dns/models/sort_order.rb +12 -0
  52. data/lib/oci/dns/models/tsig.rb +149 -0
  53. data/lib/oci/dns/models/update_domain_records_details.rb +120 -0
  54. data/lib/oci/dns/models/update_rr_set_details.rb +120 -0
  55. data/lib/oci/dns/models/update_zone_details.rb +122 -0
  56. data/lib/oci/dns/models/update_zone_records_details.rb +120 -0
  57. data/lib/oci/dns/models/zone.rb +272 -0
  58. data/lib/oci/dns/models/zone_summary.rb +230 -0
  59. data/lib/oci/dns/util.rb +2 -0
  60. data/lib/oci/errors.rb +20 -0
  61. data/lib/oci/identity/identity_client.rb +1 -0
  62. data/lib/oci/identity/models/create_dynamic_group_details.rb +4 -2
  63. data/lib/oci/identity/models/dynamic_group.rb +9 -6
  64. data/lib/oci/identity/models/update_dynamic_group_details.rb +4 -2
  65. data/lib/oci/load_balancer/load_balancer.rb +6 -0
  66. data/lib/oci/load_balancer/load_balancer_client.rb +219 -0
  67. data/lib/oci/load_balancer/models/create_listener_details.rb +17 -1
  68. data/lib/oci/load_balancer/models/create_load_balancer_details.rb +12 -1
  69. data/lib/oci/load_balancer/models/create_path_route_set_details.rb +138 -0
  70. data/lib/oci/load_balancer/models/listener.rb +17 -1
  71. data/lib/oci/load_balancer/models/listener_details.rb +17 -1
  72. data/lib/oci/load_balancer/models/load_balancer.rb +12 -1
  73. data/lib/oci/load_balancer/models/path_match_type.rb +153 -0
  74. data/lib/oci/load_balancer/models/path_route.rb +161 -0
  75. data/lib/oci/load_balancer/models/path_route_set.rb +139 -0
  76. data/lib/oci/load_balancer/models/path_route_set_details.rb +122 -0
  77. data/lib/oci/load_balancer/models/update_listener_details.rb +17 -1
  78. data/lib/oci/load_balancer/models/update_path_route_set_details.rb +122 -0
  79. data/lib/oci/load_balancer/util.rb +1 -3
  80. data/lib/oci/object_storage/transfer/multipart/internal/file_part_io_wrapper.rb +111 -0
  81. data/lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb +41 -0
  82. data/lib/oci/object_storage/transfer/multipart/internal/seekable_non_file_part_io_wrapper.rb +48 -0
  83. data/lib/oci/object_storage/transfer/multipart/internal/stdin_part_io_wrapper.rb +54 -0
  84. data/lib/oci/object_storage/transfer/multipart/multipart_object_assembler.rb +545 -0
  85. data/lib/oci/object_storage/transfer/transfer.rb +31 -0
  86. data/lib/oci/object_storage/transfer/upload_manager.rb +212 -0
  87. data/lib/oci/object_storage/transfer/upload_manager_config.rb +60 -0
  88. data/lib/oci/regions.rb +3 -1
  89. data/lib/oci/response.rb +1 -3
  90. data/lib/oci/version.rb +1 -1
  91. data/lib/oci/waiter.rb +16 -11
  92. data/lib/oraclebmc.rb +1 -1
  93. metadata +46 -2
@@ -11,6 +11,12 @@ module OCI
11
11
  # @return [String]
12
12
  attr_accessor :availability_domain
13
13
 
14
+ # If provided, specifies the ID of the volume backup policy to assign to the newly
15
+ # created volume. If omitted, no policy will be assigned.
16
+ #
17
+ # @return [String]
18
+ attr_accessor :backup_policy_id
19
+
14
20
  # **[Required]** The OCID of the compartment that contains the volume.
15
21
  # @return [String]
16
22
  attr_accessor :compartment_id
@@ -66,6 +72,7 @@ module OCI
66
72
  # Initializes the object
67
73
  # @param [Hash] attributes Model attributes in the form of hash
68
74
  # @option attributes [String] :availabilityDomain The value to assign to the {#availability_domain} property
75
+ # @option attributes [String] :backupPolicyId The value to assign to the {#backup_policy_id} property
69
76
  # @option attributes [String] :compartmentId The value to assign to the {#compartment_id} property
70
77
  # @option attributes [Hash<String, Hash<String, Object>>] :definedTags The value to assign to the {#defined_tags} property
71
78
  # @option attributes [String] :displayName The value to assign to the {#display_name} property
@@ -84,6 +91,10 @@ module OCI
84
91
  self.availability_domain = attributes[:'availabilityDomain']
85
92
  end
86
93
 
94
+ if attributes[:'backupPolicyId']
95
+ self.backup_policy_id = attributes[:'backupPolicyId']
96
+ end
97
+
87
98
  if attributes[:'compartmentId']
88
99
  self.compartment_id = attributes[:'compartmentId']
89
100
  end
@@ -124,6 +135,7 @@ module OCI
124
135
  return true if self.equal?(other_object)
125
136
  self.class == other_object.class &&
126
137
  availability_domain == other_object.availability_domain &&
138
+ backup_policy_id == other_object.backup_policy_id &&
127
139
  compartment_id == other_object.compartment_id &&
128
140
  defined_tags == other_object.defined_tags &&
129
141
  display_name == other_object.display_name &&
@@ -143,7 +155,7 @@ module OCI
143
155
  # Calculates hash code according to all attributes.
144
156
  # @return [Fixnum] Hash code
145
157
  def hash
146
- [availability_domain, compartment_id, defined_tags, display_name, freeform_tags, size_in_gbs, size_in_mbs, source_details, volume_backup_id].hash
158
+ [availability_domain, backup_policy_id, compartment_id, defined_tags, display_name, freeform_tags, size_in_gbs, size_in_mbs, source_details, volume_backup_id].hash
147
159
  end
148
160
 
149
161
  # Builds the object from hash
@@ -210,6 +222,7 @@ module OCI
210
222
  def self.attribute_map
211
223
  {
212
224
  :'availability_domain' => :'availabilityDomain',
225
+ :'backup_policy_id' => :'backupPolicyId',
213
226
  :'compartment_id' => :'compartmentId',
214
227
  :'defined_tags' => :'definedTags',
215
228
  :'display_name' => :'displayName',
@@ -225,6 +238,7 @@ module OCI
225
238
  def self.swagger_types
226
239
  {
227
240
  :'availability_domain' => :'String',
241
+ :'backup_policy_id' => :'String',
228
242
  :'compartment_id' => :'String',
229
243
  :'defined_tags' => :'Hash<String, Hash<String, Object>>',
230
244
  :'display_name' => :'String',
@@ -0,0 +1,125 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ # IP address of the public IP.
7
+ #
8
+ class Core::Models::GetPublicIpByIpAddressDetails
9
+ # **[Required]** The public IP address.
10
+ # Example: 129.146.2.1
11
+ #
12
+ # @return [String]
13
+ attr_accessor :ip_address
14
+
15
+
16
+ # Initializes the object
17
+ # @param [Hash] attributes Model attributes in the form of hash
18
+ # @option attributes [String] :ipAddress The value to assign to the {#ip_address} property
19
+ def initialize(attributes = {})
20
+ return unless attributes.is_a?(Hash)
21
+
22
+ # convert string to symbol for hash key
23
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
24
+
25
+ if attributes[:'ipAddress']
26
+ self.ip_address = attributes[:'ipAddress']
27
+ end
28
+
29
+ end
30
+
31
+ # Checks equality by comparing each attribute.
32
+ # @param [Object] other_object to be compared
33
+ def ==(other_object)
34
+ return true if self.equal?(other_object)
35
+ self.class == other_object.class &&
36
+ ip_address == other_object.ip_address
37
+ end
38
+
39
+ # @see the `==` method
40
+ # @param [Object] other_object to be compared
41
+ def eql?(other_object)
42
+ self == other_object
43
+ end
44
+
45
+ # Calculates hash code according to all attributes.
46
+ # @return [Fixnum] Hash code
47
+ def hash
48
+ [ip_address].hash
49
+ end
50
+
51
+ # Builds the object from hash
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ # @return [Object] Returns the model itself
54
+ def build_from_hash(attributes)
55
+ return nil unless attributes.is_a?(Hash)
56
+ self.class.swagger_types.each_pair do |key, type|
57
+ if type =~ /^Array<(.*)>/i
58
+ # check to ensure the input is an array given that the the attribute
59
+ # is documented as an array but the input is not
60
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
61
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
62
+ end
63
+ elsif !attributes[self.class.attribute_map[key]].nil?
64
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
65
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
66
+ end
67
+
68
+ self
69
+ end
70
+
71
+ # Returns the string representation of the object
72
+ # @return [String] String presentation of the object
73
+ def to_s
74
+ to_hash.to_s
75
+ end
76
+
77
+ # Returns the object in the form of hash
78
+ # @return [Hash] Returns the object in the form of hash
79
+ def to_hash
80
+ hash = {}
81
+ self.class.attribute_map.each_pair do |attr, param|
82
+ value = public_method(attr).call
83
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
84
+ hash[param] = _to_hash(value)
85
+ end
86
+ hash
87
+ end
88
+
89
+ private
90
+
91
+ # Outputs non-array value in the form of hash
92
+ # For object, use to_hash. Otherwise, just return the value
93
+ # @param [Object] value Any valid value
94
+ # @return [Hash] Returns the value in the form of hash
95
+ def _to_hash(value)
96
+ if value.is_a?(Array)
97
+ value.compact.map{ |v| _to_hash(v) }
98
+ elsif value.is_a?(Hash)
99
+ {}.tap do |hash|
100
+ value.each { |k, v| hash[k] = _to_hash(v) }
101
+ end
102
+ elsif value.respond_to? :to_hash
103
+ value.to_hash
104
+ else
105
+ value
106
+ end
107
+ end
108
+
109
+
110
+
111
+ # Attribute mapping from ruby-style variable name to JSON key.
112
+ def self.attribute_map
113
+ {
114
+ :'ip_address' => :'ipAddress'
115
+ }
116
+ end
117
+
118
+ # Attribute type mapping.
119
+ def self.swagger_types
120
+ {
121
+ :'ip_address' => :'String'
122
+ }
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,124 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ # Details of the private IP that the public IP is assigned to.
7
+ #
8
+ class Core::Models::GetPublicIpByPrivateIpIdDetails
9
+ # **[Required]** OCID of the private IP.
10
+ #
11
+ # @return [String]
12
+ attr_accessor :private_ip_id
13
+
14
+
15
+ # Initializes the object
16
+ # @param [Hash] attributes Model attributes in the form of hash
17
+ # @option attributes [String] :privateIpId The value to assign to the {#private_ip_id} property
18
+ def initialize(attributes = {})
19
+ return unless attributes.is_a?(Hash)
20
+
21
+ # convert string to symbol for hash key
22
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
23
+
24
+ if attributes[:'privateIpId']
25
+ self.private_ip_id = attributes[:'privateIpId']
26
+ end
27
+
28
+ end
29
+
30
+ # Checks equality by comparing each attribute.
31
+ # @param [Object] other_object to be compared
32
+ def ==(other_object)
33
+ return true if self.equal?(other_object)
34
+ self.class == other_object.class &&
35
+ private_ip_id == other_object.private_ip_id
36
+ end
37
+
38
+ # @see the `==` method
39
+ # @param [Object] other_object to be compared
40
+ def eql?(other_object)
41
+ self == other_object
42
+ end
43
+
44
+ # Calculates hash code according to all attributes.
45
+ # @return [Fixnum] Hash code
46
+ def hash
47
+ [private_ip_id].hash
48
+ end
49
+
50
+ # Builds the object from hash
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ # @return [Object] Returns the model itself
53
+ def build_from_hash(attributes)
54
+ return nil unless attributes.is_a?(Hash)
55
+ self.class.swagger_types.each_pair do |key, type|
56
+ if type =~ /^Array<(.*)>/i
57
+ # check to ensure the input is an array given that the the attribute
58
+ # is documented as an array but the input is not
59
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
60
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
61
+ end
62
+ elsif !attributes[self.class.attribute_map[key]].nil?
63
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
64
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
65
+ end
66
+
67
+ self
68
+ end
69
+
70
+ # Returns the string representation of the object
71
+ # @return [String] String presentation of the object
72
+ def to_s
73
+ to_hash.to_s
74
+ end
75
+
76
+ # Returns the object in the form of hash
77
+ # @return [Hash] Returns the object in the form of hash
78
+ def to_hash
79
+ hash = {}
80
+ self.class.attribute_map.each_pair do |attr, param|
81
+ value = public_method(attr).call
82
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
83
+ hash[param] = _to_hash(value)
84
+ end
85
+ hash
86
+ end
87
+
88
+ private
89
+
90
+ # Outputs non-array value in the form of hash
91
+ # For object, use to_hash. Otherwise, just return the value
92
+ # @param [Object] value Any valid value
93
+ # @return [Hash] Returns the value in the form of hash
94
+ def _to_hash(value)
95
+ if value.is_a?(Array)
96
+ value.compact.map{ |v| _to_hash(v) }
97
+ elsif value.is_a?(Hash)
98
+ {}.tap do |hash|
99
+ value.each { |k, v| hash[k] = _to_hash(v) }
100
+ end
101
+ elsif value.respond_to? :to_hash
102
+ value.to_hash
103
+ else
104
+ value
105
+ end
106
+ end
107
+
108
+
109
+
110
+ # Attribute mapping from ruby-style variable name to JSON key.
111
+ def self.attribute_map
112
+ {
113
+ :'private_ip_id' => :'privateIpId'
114
+ }
115
+ end
116
+
117
+ # Attribute type mapping.
118
+ def self.swagger_types
119
+ {
120
+ :'private_ip_id' => :'String'
121
+ }
122
+ end
123
+ end
124
+ end
@@ -50,6 +50,7 @@ module OCI
50
50
  # @option attributes [String] :displayName The value to assign to the {OCI::Core::Models::VolumeAttachment#display_name #display_name} proprety
51
51
  # @option attributes [String] :id The value to assign to the {OCI::Core::Models::VolumeAttachment#id #id} proprety
52
52
  # @option attributes [String] :instanceId The value to assign to the {OCI::Core::Models::VolumeAttachment#instance_id #instance_id} proprety
53
+ # @option attributes [BOOLEAN] :isReadOnly The value to assign to the {OCI::Core::Models::VolumeAttachment#is_read_only #is_read_only} proprety
53
54
  # @option attributes [String] :lifecycleState The value to assign to the {OCI::Core::Models::VolumeAttachment#lifecycle_state #lifecycle_state} proprety
54
55
  # @option attributes [DateTime] :timeCreated The value to assign to the {OCI::Core::Models::VolumeAttachment#time_created #time_created} proprety
55
56
  # @option attributes [String] :volumeId The value to assign to the {OCI::Core::Models::VolumeAttachment#volume_id #volume_id} proprety
@@ -101,6 +102,7 @@ module OCI
101
102
  display_name == other_object.display_name &&
102
103
  id == other_object.id &&
103
104
  instance_id == other_object.instance_id &&
105
+ is_read_only == other_object.is_read_only &&
104
106
  lifecycle_state == other_object.lifecycle_state &&
105
107
  time_created == other_object.time_created &&
106
108
  volume_id == other_object.volume_id &&
@@ -120,7 +122,7 @@ module OCI
120
122
  # Calculates hash code according to all attributes.
121
123
  # @return [Fixnum] Hash code
122
124
  def hash
123
- [attachment_type, availability_domain, compartment_id, display_name, id, instance_id, lifecycle_state, time_created, volume_id, chap_secret, chap_username, ipv4, iqn, port].hash
125
+ [attachment_type, availability_domain, compartment_id, display_name, id, instance_id, is_read_only, lifecycle_state, time_created, volume_id, chap_secret, chap_username, ipv4, iqn, port].hash
124
126
  end
125
127
 
126
128
  # Builds the object from hash
@@ -192,6 +194,7 @@ module OCI
192
194
  :'display_name' => :'displayName',
193
195
  :'id' => :'id',
194
196
  :'instance_id' => :'instanceId',
197
+ :'is_read_only' => :'isReadOnly',
195
198
  :'lifecycle_state' => :'lifecycleState',
196
199
  :'time_created' => :'timeCreated',
197
200
  :'volume_id' => :'volumeId',
@@ -212,6 +215,7 @@ module OCI
212
215
  :'display_name' => :'String',
213
216
  :'id' => :'String',
214
217
  :'instance_id' => :'String',
218
+ :'is_read_only' => :'BOOLEAN',
215
219
  :'lifecycle_state' => :'String',
216
220
  :'time_created' => :'DateTime',
217
221
  :'volume_id' => :'String',
@@ -0,0 +1,328 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OCI
6
+ # A *public IP* is a conceptual term that refers to a public IP address and related properties.
7
+ # The `publicIp` object is the API representation of a public IP.
8
+ #
9
+ # There are two types of public IPs:
10
+ # 1. Ephemeral
11
+ # 2. Reserved
12
+ #
13
+ # For more information and comparison of the two types,
14
+ # see [Public IP Addresses](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm).
15
+ #
16
+ class Core::Models::PublicIp
17
+
18
+ LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
19
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE',
20
+ LIFECYCLE_STATE_ASSIGNING = 'ASSIGNING',
21
+ LIFECYCLE_STATE_ASSIGNED = 'ASSIGNED',
22
+ LIFECYCLE_STATE_UNASSIGNING = 'UNASSIGNING',
23
+ LIFECYCLE_STATE_UNASSIGNED = 'UNASSIGNED',
24
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
25
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED',
26
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
27
+
28
+
29
+ LIFETIME_ENUM = [LIFETIME_EPHEMERAL = 'EPHEMERAL',
30
+ LIFETIME_RESERVED = 'RESERVED',
31
+ LIFETIME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
32
+
33
+
34
+ SCOPE_ENUM = [SCOPE_REGION = 'REGION',
35
+ SCOPE_AVAILABILITY_DOMAIN = 'AVAILABILITY_DOMAIN',
36
+ SCOPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
37
+
38
+ # The public IP's Availability Domain. This property is set only for ephemeral public IPs
39
+ # (that is, when the `scope` of the public IP is set to AVAILABILITY_DOMAIN). The value
40
+ # is the Availability Domain of the assigned private IP.
41
+ #
42
+ # Example: `Uocm:PHX-AD-1`
43
+ #
44
+ # @return [String]
45
+ attr_accessor :availability_domain
46
+
47
+ # The OCID of the compartment containing the public IP. For an ephemeral public IP, this is
48
+ # the same compartment as the private IP's. For a reserved public IP that is currently assigned,
49
+ # this can be a different compartment than the assigned private IP's.
50
+ #
51
+ # @return [String]
52
+ attr_accessor :compartment_id
53
+
54
+ # A user-friendly name. Does not have to be unique, and it's changeable. Avoid
55
+ # entering confidential information.
56
+ #
57
+ # @return [String]
58
+ attr_accessor :display_name
59
+
60
+ # The public IP's Oracle ID (OCID).
61
+ # @return [String]
62
+ attr_accessor :id
63
+
64
+ # The public IP address of the `publicIp` object.
65
+ #
66
+ # Example: `129.146.2.1`
67
+ #
68
+ # @return [String]
69
+ attr_accessor :ip_address
70
+
71
+ # The public IP's current state.
72
+ # @return [String]
73
+ attr_accessor :lifecycle_state
74
+
75
+ # Defines when the public IP is deleted and released back to Oracle's public IP pool.
76
+ #
77
+ # * `EPHEMERAL`: The lifetime is tied to the lifetime of its assigned private IP. The
78
+ # ephemeral public IP is automatically deleted when its private IP is deleted, when
79
+ # the VNIC is terminated, or when the instance is terminated. An ephemeral
80
+ # public IP must always be assigned to a private IP.
81
+ #
82
+ # * `RESERVED`: You control the public IP's lifetime. You can delete a reserved public IP
83
+ # whenever you like. It does not need to be assigned to a private IP at all times.
84
+ #
85
+ # For more information and comparison of the two types,
86
+ # see [Public IP Addresses](https://docs.us-phoenix-1.oraclecloud.com/Content/Network/Tasks/managingpublicIPs.htm).
87
+ #
88
+ # @return [String]
89
+ attr_accessor :lifetime
90
+
91
+ # The OCID of the private IP that the public IP is currently assigned to, or in the
92
+ # process of being assigned to.
93
+ #
94
+ # @return [String]
95
+ attr_accessor :private_ip_id
96
+
97
+ # Whether the public IP is regional or specific to a particular Availability Domain.
98
+ #
99
+ # * `REGION`: The public IP exists within a region and can be assigned to a private IP
100
+ # in any Availability Domain in the region. Reserved public IPs have `scope` = `REGION`.
101
+ #
102
+ # * `AVAILABILITY_DOMAIN`: The public IP exists within the Availability Domain of the private IP
103
+ # it's assigned to, which is specified by the `availabilityDomain` property of the public IP object.
104
+ # Ephemeral public IPs have `scope` = `AVAILABILITY_DOMAIN`.
105
+ #
106
+ # @return [String]
107
+ attr_accessor :scope
108
+
109
+ # The date and time the public IP was created, in the format defined by RFC3339.
110
+ #
111
+ # Example: `2016-08-25T21:10:29.600Z`
112
+ #
113
+ # @return [DateTime]
114
+ attr_accessor :time_created
115
+
116
+
117
+ # Initializes the object
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @option attributes [String] :availabilityDomain The value to assign to the {#availability_domain} property
120
+ # @option attributes [String] :compartmentId The value to assign to the {#compartment_id} property
121
+ # @option attributes [String] :displayName The value to assign to the {#display_name} property
122
+ # @option attributes [String] :id The value to assign to the {#id} property
123
+ # @option attributes [String] :ipAddress The value to assign to the {#ip_address} property
124
+ # @option attributes [String] :lifecycleState The value to assign to the {#lifecycle_state} property
125
+ # @option attributes [String] :lifetime The value to assign to the {#lifetime} property
126
+ # @option attributes [String] :privateIpId The value to assign to the {#private_ip_id} property
127
+ # @option attributes [String] :scope The value to assign to the {#scope} property
128
+ # @option attributes [DateTime] :timeCreated The value to assign to the {#time_created} property
129
+ def initialize(attributes = {})
130
+ return unless attributes.is_a?(Hash)
131
+
132
+ # convert string to symbol for hash key
133
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
134
+
135
+ if attributes[:'availabilityDomain']
136
+ self.availability_domain = attributes[:'availabilityDomain']
137
+ end
138
+
139
+ if attributes[:'compartmentId']
140
+ self.compartment_id = attributes[:'compartmentId']
141
+ end
142
+
143
+ if attributes[:'displayName']
144
+ self.display_name = attributes[:'displayName']
145
+ end
146
+
147
+ if attributes[:'id']
148
+ self.id = attributes[:'id']
149
+ end
150
+
151
+ if attributes[:'ipAddress']
152
+ self.ip_address = attributes[:'ipAddress']
153
+ end
154
+
155
+ if attributes[:'lifecycleState']
156
+ self.lifecycle_state = attributes[:'lifecycleState']
157
+ end
158
+
159
+ if attributes[:'lifetime']
160
+ self.lifetime = attributes[:'lifetime']
161
+ end
162
+
163
+ if attributes[:'privateIpId']
164
+ self.private_ip_id = attributes[:'privateIpId']
165
+ end
166
+
167
+ if attributes[:'scope']
168
+ self.scope = attributes[:'scope']
169
+ end
170
+
171
+ if attributes[:'timeCreated']
172
+ self.time_created = attributes[:'timeCreated']
173
+ end
174
+
175
+ end
176
+
177
+ # Custom attribute writer method checking allowed values (enum).
178
+ # @param [Object] lifecycle_state Object to be assigned
179
+ def lifecycle_state=(lifecycle_state)
180
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
181
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
182
+ else
183
+ @lifecycle_state = lifecycle_state
184
+ end
185
+ end
186
+
187
+ # Custom attribute writer method checking allowed values (enum).
188
+ # @param [Object] lifetime Object to be assigned
189
+ def lifetime=(lifetime)
190
+ if lifetime && !LIFETIME_ENUM.include?(lifetime)
191
+ @lifetime = LIFETIME_UNKNOWN_ENUM_VALUE
192
+ else
193
+ @lifetime = lifetime
194
+ end
195
+ end
196
+
197
+ # Custom attribute writer method checking allowed values (enum).
198
+ # @param [Object] scope Object to be assigned
199
+ def scope=(scope)
200
+ if scope && !SCOPE_ENUM.include?(scope)
201
+ @scope = SCOPE_UNKNOWN_ENUM_VALUE
202
+ else
203
+ @scope = scope
204
+ end
205
+ end
206
+
207
+ # Checks equality by comparing each attribute.
208
+ # @param [Object] other_object to be compared
209
+ def ==(other_object)
210
+ return true if self.equal?(other_object)
211
+ self.class == other_object.class &&
212
+ availability_domain == other_object.availability_domain &&
213
+ compartment_id == other_object.compartment_id &&
214
+ display_name == other_object.display_name &&
215
+ id == other_object.id &&
216
+ ip_address == other_object.ip_address &&
217
+ lifecycle_state == other_object.lifecycle_state &&
218
+ lifetime == other_object.lifetime &&
219
+ private_ip_id == other_object.private_ip_id &&
220
+ scope == other_object.scope &&
221
+ time_created == other_object.time_created
222
+ end
223
+
224
+ # @see the `==` method
225
+ # @param [Object] other_object to be compared
226
+ def eql?(other_object)
227
+ self == other_object
228
+ end
229
+
230
+ # Calculates hash code according to all attributes.
231
+ # @return [Fixnum] Hash code
232
+ def hash
233
+ [availability_domain, compartment_id, display_name, id, ip_address, lifecycle_state, lifetime, private_ip_id, scope, time_created].hash
234
+ end
235
+
236
+ # Builds the object from hash
237
+ # @param [Hash] attributes Model attributes in the form of hash
238
+ # @return [Object] Returns the model itself
239
+ def build_from_hash(attributes)
240
+ return nil unless attributes.is_a?(Hash)
241
+ self.class.swagger_types.each_pair do |key, type|
242
+ if type =~ /^Array<(.*)>/i
243
+ # check to ensure the input is an array given that the the attribute
244
+ # is documented as an array but the input is not
245
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
246
+ self.public_method("#{key}=").call(attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
247
+ end
248
+ elsif !attributes[self.class.attribute_map[key]].nil?
249
+ self.public_method("#{key}=").call(OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
250
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
251
+ end
252
+
253
+ self
254
+ end
255
+
256
+ # Returns the string representation of the object
257
+ # @return [String] String presentation of the object
258
+ def to_s
259
+ to_hash.to_s
260
+ end
261
+
262
+ # Returns the object in the form of hash
263
+ # @return [Hash] Returns the object in the form of hash
264
+ def to_hash
265
+ hash = {}
266
+ self.class.attribute_map.each_pair do |attr, param|
267
+ value = public_method(attr).call
268
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ private
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map{ |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+
294
+
295
+
296
+ # Attribute mapping from ruby-style variable name to JSON key.
297
+ def self.attribute_map
298
+ {
299
+ :'availability_domain' => :'availabilityDomain',
300
+ :'compartment_id' => :'compartmentId',
301
+ :'display_name' => :'displayName',
302
+ :'id' => :'id',
303
+ :'ip_address' => :'ipAddress',
304
+ :'lifecycle_state' => :'lifecycleState',
305
+ :'lifetime' => :'lifetime',
306
+ :'private_ip_id' => :'privateIpId',
307
+ :'scope' => :'scope',
308
+ :'time_created' => :'timeCreated'
309
+ }
310
+ end
311
+
312
+ # Attribute type mapping.
313
+ def self.swagger_types
314
+ {
315
+ :'availability_domain' => :'String',
316
+ :'compartment_id' => :'String',
317
+ :'display_name' => :'String',
318
+ :'id' => :'String',
319
+ :'ip_address' => :'String',
320
+ :'lifecycle_state' => :'String',
321
+ :'lifetime' => :'String',
322
+ :'private_ip_id' => :'String',
323
+ :'scope' => :'String',
324
+ :'time_created' => :'DateTime'
325
+ }
326
+ end
327
+ end
328
+ end