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
@@ -4,7 +4,9 @@ require 'date'
4
4
 
5
5
  # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
6
  module OCI
7
- # Instance Configuration
7
+ # An instance configuration is a template that defines the settings to use when creating Compute instances
8
+ # as part of an instance pool. For more information about instance pools and instance configurations, see
9
+ # [Managing Compute Instances](https://docs.cloud.oracle.com/Content/Compute/Concepts/instancemanagement.htm).
8
10
  #
9
11
  class Core::Models::InstanceConfiguration
10
12
  # **[Required]** The OCID of the compartment containing the instance configuration.
@@ -26,6 +26,13 @@ module OCI
26
26
  # @return [String]
27
27
  attr_accessor :hostname_label
28
28
 
29
+ # A list of the OCIDs of the network security groups (NSGs) to add the VNIC to. For more
30
+ # information about NSGs, see
31
+ # {NetworkSecurityGroup}.
32
+ #
33
+ # @return [Array<String>]
34
+ attr_accessor :nsg_ids
35
+
29
36
  # A private IP address of your choice to assign to the VNIC.
30
37
  # See the `privateIp` attribute of {CreateVnicDetails} for more information.
31
38
  #
@@ -51,6 +58,7 @@ module OCI
51
58
  'assign_public_ip': :'assignPublicIp',
52
59
  'display_name': :'displayName',
53
60
  'hostname_label': :'hostnameLabel',
61
+ 'nsg_ids': :'nsgIds',
54
62
  'private_ip': :'privateIp',
55
63
  'skip_source_dest_check': :'skipSourceDestCheck',
56
64
  'subnet_id': :'subnetId'
@@ -65,6 +73,7 @@ module OCI
65
73
  'assign_public_ip': :'BOOLEAN',
66
74
  'display_name': :'String',
67
75
  'hostname_label': :'String',
76
+ 'nsg_ids': :'Array<String>',
68
77
  'private_ip': :'String',
69
78
  'skip_source_dest_check': :'BOOLEAN',
70
79
  'subnet_id': :'String'
@@ -81,6 +90,7 @@ module OCI
81
90
  # @option attributes [BOOLEAN] :assign_public_ip The value to assign to the {#assign_public_ip} property
82
91
  # @option attributes [String] :display_name The value to assign to the {#display_name} property
83
92
  # @option attributes [String] :hostname_label The value to assign to the {#hostname_label} property
93
+ # @option attributes [Array<String>] :nsg_ids The value to assign to the {#nsg_ids} property
84
94
  # @option attributes [String] :private_ip The value to assign to the {#private_ip} property
85
95
  # @option attributes [BOOLEAN] :skip_source_dest_check The value to assign to the {#skip_source_dest_check} property
86
96
  # @option attributes [String] :subnet_id The value to assign to the {#subnet_id} property
@@ -108,6 +118,12 @@ module OCI
108
118
 
109
119
  self.hostname_label = attributes[:'hostname_label'] if attributes[:'hostname_label']
110
120
 
121
+ self.nsg_ids = attributes[:'nsgIds'] if attributes[:'nsgIds']
122
+
123
+ raise 'You cannot provide both :nsgIds and :nsg_ids' if attributes.key?(:'nsgIds') && attributes.key?(:'nsg_ids')
124
+
125
+ self.nsg_ids = attributes[:'nsg_ids'] if attributes[:'nsg_ids']
126
+
111
127
  self.private_ip = attributes[:'privateIp'] if attributes[:'privateIp']
112
128
 
113
129
  raise 'You cannot provide both :privateIp and :private_ip' if attributes.key?(:'privateIp') && attributes.key?(:'private_ip')
@@ -141,6 +157,7 @@ module OCI
141
157
  assign_public_ip == other.assign_public_ip &&
142
158
  display_name == other.display_name &&
143
159
  hostname_label == other.hostname_label &&
160
+ nsg_ids == other.nsg_ids &&
144
161
  private_ip == other.private_ip &&
145
162
  skip_source_dest_check == other.skip_source_dest_check &&
146
163
  subnet_id == other.subnet_id
@@ -159,7 +176,7 @@ module OCI
159
176
  # Calculates hash code according to all attributes.
160
177
  # @return [Fixnum] Hash code
161
178
  def hash
162
- [assign_public_ip, display_name, hostname_label, private_ip, skip_source_dest_check, subnet_id].hash
179
+ [assign_public_ip, display_name, hostname_label, nsg_ids, private_ip, skip_source_dest_check, subnet_id].hash
163
180
  end
164
181
  # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
165
182
 
@@ -7,6 +7,10 @@ require_relative 'instance_configuration_instance_source_details'
7
7
  module OCI
8
8
  # InstanceConfigurationInstanceSourceViaImageDetails model.
9
9
  class Core::Models::InstanceConfigurationInstanceSourceViaImageDetails < Core::Models::InstanceConfigurationInstanceSourceDetails
10
+ # The size of the boot volume in GBs. The minimum value is 50 GB and the maximum value is 16384 GB (16TB).
11
+ # @return [Integer]
12
+ attr_accessor :boot_volume_size_in_gbs
13
+
10
14
  # The OCID of the image used to boot the instance.
11
15
  # @return [String]
12
16
  attr_accessor :image_id
@@ -16,6 +20,7 @@ module OCI
16
20
  {
17
21
  # rubocop:disable Style/SymbolLiteral
18
22
  'source_type': :'sourceType',
23
+ 'boot_volume_size_in_gbs': :'bootVolumeSizeInGBs',
19
24
  'image_id': :'imageId'
20
25
  # rubocop:enable Style/SymbolLiteral
21
26
  }
@@ -26,6 +31,7 @@ module OCI
26
31
  {
27
32
  # rubocop:disable Style/SymbolLiteral
28
33
  'source_type': :'String',
34
+ 'boot_volume_size_in_gbs': :'Integer',
29
35
  'image_id': :'String'
30
36
  # rubocop:enable Style/SymbolLiteral
31
37
  }
@@ -37,6 +43,7 @@ module OCI
37
43
 
38
44
  # Initializes the object
39
45
  # @param [Hash] attributes Model attributes in the form of hash
46
+ # @option attributes [Integer] :boot_volume_size_in_gbs The value to assign to the {#boot_volume_size_in_gbs} property
40
47
  # @option attributes [String] :image_id The value to assign to the {#image_id} property
41
48
  def initialize(attributes = {})
42
49
  return unless attributes.is_a?(Hash)
@@ -48,6 +55,12 @@ module OCI
48
55
  # convert string to symbol for hash key
49
56
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
57
 
58
+ self.boot_volume_size_in_gbs = attributes[:'bootVolumeSizeInGBs'] if attributes[:'bootVolumeSizeInGBs']
59
+
60
+ raise 'You cannot provide both :bootVolumeSizeInGBs and :boot_volume_size_in_gbs' if attributes.key?(:'bootVolumeSizeInGBs') && attributes.key?(:'boot_volume_size_in_gbs')
61
+
62
+ self.boot_volume_size_in_gbs = attributes[:'boot_volume_size_in_gbs'] if attributes[:'boot_volume_size_in_gbs']
63
+
51
64
  self.image_id = attributes[:'imageId'] if attributes[:'imageId']
52
65
 
53
66
  raise 'You cannot provide both :imageId and :image_id' if attributes.key?(:'imageId') && attributes.key?(:'image_id')
@@ -67,6 +80,7 @@ module OCI
67
80
 
68
81
  self.class == other.class &&
69
82
  source_type == other.source_type &&
83
+ boot_volume_size_in_gbs == other.boot_volume_size_in_gbs &&
70
84
  image_id == other.image_id
71
85
  end
72
86
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
@@ -83,7 +97,7 @@ module OCI
83
97
  # Calculates hash code according to all attributes.
84
98
  # @return [Fixnum] Hash code
85
99
  def hash
86
- [source_type, image_id].hash
100
+ [source_type, boot_volume_size_in_gbs, image_id].hash
87
101
  end
88
102
  # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
89
103
 
@@ -4,7 +4,7 @@ require 'date'
4
4
 
5
5
  # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
6
6
  module OCI
7
- # Instance Configuration Summary
7
+ # Summary information for an instance configuration.
8
8
  #
9
9
  class Core::Models::InstanceConfigurationSummary
10
10
  # **[Required]** The OCID of the compartment containing the instance configuration.
@@ -12,12 +12,12 @@ module OCI
12
12
  # @return [String]
13
13
  attr_accessor :compartment_id
14
14
 
15
- # A user-friendly name for the instance configuration
15
+ # A user-friendly name for the instance configuration.
16
16
  #
17
17
  # @return [String]
18
18
  attr_accessor :display_name
19
19
 
20
- # **[Required]** The OCID of the instance configuration
20
+ # **[Required]** The OCID of the instance configuration.
21
21
  # @return [String]
22
22
  attr_accessor :id
23
23
 
@@ -5,7 +5,10 @@ require 'logger'
5
5
 
6
6
  # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
7
  module OCI
8
- # Instance Pool
8
+ # An instance pool is a group of instances within the same region that are created based off of the same
9
+ # instance configuration. For more information about instance pools and instance configurations, see
10
+ # [Managing Compute Instances](https://docs.cloud.oracle.com/Content/Compute/Concepts/instancemanagement.htm).
11
+ #
9
12
  class Core::Models::InstancePool
10
13
  LIFECYCLE_STATE_ENUM = [
11
14
  LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
@@ -5,7 +5,7 @@ require 'logger'
5
5
 
6
6
  # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
7
  module OCI
8
- # Condensed InstancePool data when listing instance pools.
8
+ # Summary information for an instance pool.
9
9
  class Core::Models::InstancePoolSummary
10
10
  LIFECYCLE_STATE_ENUM = [
11
11
  LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
@@ -19,11 +19,11 @@ module OCI
19
19
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
20
20
  ].freeze
21
21
 
22
- # **[Required]** The OCID of the instance pool
22
+ # **[Required]** The OCID of the instance pool.
23
23
  # @return [String]
24
24
  attr_accessor :id
25
25
 
26
- # **[Required]** The OCID of the compartment containing the instance pool
26
+ # **[Required]** The OCID of the compartment containing the instance pool.
27
27
  # @return [String]
28
28
  attr_accessor :compartment_id
29
29
 
@@ -0,0 +1,324 @@
1
+ # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require 'logger'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
7
+ module OCI
8
+ # A *network security group* (NSG) provides virtual firewall rules for a specific set of
9
+ # {Vnic} in a VCN. Compare NSGs with {SecurityList},
10
+ # which provide virtual firewall rules to all the VNICs in a *subnet*.
11
+ #
12
+ # A network security group consists of two items:
13
+ #
14
+ # * The set of {Vnic} that all have the same security rule needs (for
15
+ # example, a group of Compute instances all running the same application)
16
+ # * A set of NSG {SecurityRule} that apply to the VNICs in the group
17
+ #
18
+ # After creating an NSG, you can add VNICs and security rules to it. For example, when you create
19
+ # an instance, you can specify one or more NSGs to add the instance to (see
20
+ # {#create_vnic_details create_vnic_details}). Or you can add an existing
21
+ # instance to an NSG with {#update_vnic update_vnic}.
22
+ #
23
+ # To add security rules to an NSG, see
24
+ # {#add_network_security_group_security_rules add_network_security_group_security_rules}.
25
+ #
26
+ # To list the VNICs in an NSG, see
27
+ # {#list_network_security_group_vnics list_network_security_group_vnics}.
28
+ #
29
+ # To list the security rules in an NSG, see
30
+ # {#list_network_security_group_security_rules list_network_security_group_security_rules}.
31
+ #
32
+ # For more information about network security groups, see
33
+ # [Network Security Groups](https://docs.cloud.oracle.com/iaas/Content/Network/Concepts/networksecuritygroups.htm).
34
+ #
35
+ # **Important:** Oracle Cloud Infrastructure Compute service images automatically include firewall rules (for example,
36
+ # Linux iptables, Windows firewall). If there are issues with some type of access to an instance,
37
+ # make sure all of the following are set correctly:
38
+ #
39
+ # * Any security rules in any NSGs the instance's VNIC belongs to
40
+ # * Any {SecurityList} associated with the instance's subnet
41
+ # * The instance's OS firewall rules
42
+ #
43
+ # To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized,
44
+ # talk to an administrator. If you're an administrator who needs to write policies to give users access, see
45
+ # [Getting Started with Policies](https://docs.cloud.oracle.com/Content/Identity/Concepts/policygetstarted.htm).
46
+ #
47
+ # **Warning:** Oracle recommends that you avoid using any confidential information when you
48
+ # supply string values using the API.
49
+ #
50
+ class Core::Models::NetworkSecurityGroup
51
+ LIFECYCLE_STATE_ENUM = [
52
+ LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING'.freeze,
53
+ LIFECYCLE_STATE_AVAILABLE = 'AVAILABLE'.freeze,
54
+ LIFECYCLE_STATE_TERMINATING = 'TERMINATING'.freeze,
55
+ LIFECYCLE_STATE_TERMINATED = 'TERMINATED'.freeze,
56
+ LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
57
+ ].freeze
58
+
59
+ # **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment the network security group is in.
60
+ #
61
+ # @return [String]
62
+ attr_accessor :compartment_id
63
+
64
+ # Defined tags for this resource. Each key is predefined and scoped to a
65
+ # namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
66
+ #
67
+ # Example: `{\"Operations\": {\"CostCenter\": \"42\"}}`
68
+ #
69
+ # @return [Hash<String, Hash<String, Object>>]
70
+ attr_accessor :defined_tags
71
+
72
+ # A user-friendly name. Does not have to be unique.
73
+ # Avoid entering confidential information.
74
+ #
75
+ # @return [String]
76
+ attr_accessor :display_name
77
+
78
+ # Free-form tags for this resource. Each tag is a simple key-value pair with no
79
+ # predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/Content/General/Concepts/resourcetags.htm).
80
+ #
81
+ # Example: `{\"Department\": \"Finance\"}`
82
+ #
83
+ # @return [Hash<String, String>]
84
+ attr_accessor :freeform_tags
85
+
86
+ # **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group.
87
+ # @return [String]
88
+ attr_accessor :id
89
+
90
+ # **[Required]** The network security group's current state.
91
+ # @return [String]
92
+ attr_reader :lifecycle_state
93
+
94
+ # **[Required]** The date and time the network security group was created, in the format defined by RFC3339.
95
+ #
96
+ # Example: `2016-08-25T21:10:29.600Z`
97
+ #
98
+ # @return [DateTime]
99
+ attr_accessor :time_created
100
+
101
+ # **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the network security group's VCN.
102
+ # @return [String]
103
+ attr_accessor :vcn_id
104
+
105
+ # Attribute mapping from ruby-style variable name to JSON key.
106
+ def self.attribute_map
107
+ {
108
+ # rubocop:disable Style/SymbolLiteral
109
+ 'compartment_id': :'compartmentId',
110
+ 'defined_tags': :'definedTags',
111
+ 'display_name': :'displayName',
112
+ 'freeform_tags': :'freeformTags',
113
+ 'id': :'id',
114
+ 'lifecycle_state': :'lifecycleState',
115
+ 'time_created': :'timeCreated',
116
+ 'vcn_id': :'vcnId'
117
+ # rubocop:enable Style/SymbolLiteral
118
+ }
119
+ end
120
+
121
+ # Attribute type mapping.
122
+ def self.swagger_types
123
+ {
124
+ # rubocop:disable Style/SymbolLiteral
125
+ 'compartment_id': :'String',
126
+ 'defined_tags': :'Hash<String, Hash<String, Object>>',
127
+ 'display_name': :'String',
128
+ 'freeform_tags': :'Hash<String, String>',
129
+ 'id': :'String',
130
+ 'lifecycle_state': :'String',
131
+ 'time_created': :'DateTime',
132
+ 'vcn_id': :'String'
133
+ # rubocop:enable Style/SymbolLiteral
134
+ }
135
+ end
136
+
137
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
138
+ # rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
139
+
140
+
141
+ # Initializes the object
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
144
+ # @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property
145
+ # @option attributes [String] :display_name The value to assign to the {#display_name} property
146
+ # @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property
147
+ # @option attributes [String] :id The value to assign to the {#id} property
148
+ # @option attributes [String] :lifecycle_state The value to assign to the {#lifecycle_state} property
149
+ # @option attributes [DateTime] :time_created The value to assign to the {#time_created} property
150
+ # @option attributes [String] :vcn_id The value to assign to the {#vcn_id} property
151
+ def initialize(attributes = {})
152
+ return unless attributes.is_a?(Hash)
153
+
154
+ # convert string to symbol for hash key
155
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
156
+
157
+ self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
158
+
159
+ raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
160
+
161
+ self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
162
+
163
+ self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']
164
+
165
+ raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')
166
+
167
+ self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']
168
+
169
+ self.display_name = attributes[:'displayName'] if attributes[:'displayName']
170
+
171
+ raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name')
172
+
173
+ self.display_name = attributes[:'display_name'] if attributes[:'display_name']
174
+
175
+ self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']
176
+
177
+ raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')
178
+
179
+ self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']
180
+
181
+ self.id = attributes[:'id'] if attributes[:'id']
182
+
183
+ self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']
184
+
185
+ raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')
186
+
187
+ self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']
188
+
189
+ self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']
190
+
191
+ raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')
192
+
193
+ self.time_created = attributes[:'time_created'] if attributes[:'time_created']
194
+
195
+ self.vcn_id = attributes[:'vcnId'] if attributes[:'vcnId']
196
+
197
+ raise 'You cannot provide both :vcnId and :vcn_id' if attributes.key?(:'vcnId') && attributes.key?(:'vcn_id')
198
+
199
+ self.vcn_id = attributes[:'vcn_id'] if attributes[:'vcn_id']
200
+ end
201
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
202
+ # rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
203
+
204
+ # Custom attribute writer method checking allowed values (enum).
205
+ # @param [Object] lifecycle_state Object to be assigned
206
+ def lifecycle_state=(lifecycle_state)
207
+ # rubocop:disable Style/ConditionalAssignment
208
+ if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
209
+ OCI.logger.debug("Unknown value for 'lifecycle_state' [" + lifecycle_state + "]. Mapping to 'LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE'") if OCI.logger
210
+ @lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
211
+ else
212
+ @lifecycle_state = lifecycle_state
213
+ end
214
+ # rubocop:enable Style/ConditionalAssignment
215
+ end
216
+
217
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
218
+
219
+
220
+ # Checks equality by comparing each attribute.
221
+ # @param [Object] other the other object to be compared
222
+ def ==(other)
223
+ return true if equal?(other)
224
+
225
+ self.class == other.class &&
226
+ compartment_id == other.compartment_id &&
227
+ defined_tags == other.defined_tags &&
228
+ display_name == other.display_name &&
229
+ freeform_tags == other.freeform_tags &&
230
+ id == other.id &&
231
+ lifecycle_state == other.lifecycle_state &&
232
+ time_created == other.time_created &&
233
+ vcn_id == other.vcn_id
234
+ end
235
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
236
+
237
+ # @see the `==` method
238
+ # @param [Object] other the other object to be compared
239
+ def eql?(other)
240
+ self == other
241
+ end
242
+
243
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
244
+
245
+
246
+ # Calculates hash code according to all attributes.
247
+ # @return [Fixnum] Hash code
248
+ def hash
249
+ [compartment_id, defined_tags, display_name, freeform_tags, id, lifecycle_state, time_created, vcn_id].hash
250
+ end
251
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
252
+
253
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
254
+
255
+
256
+ # Builds the object from hash
257
+ # @param [Hash] attributes Model attributes in the form of hash
258
+ # @return [Object] Returns the model itself
259
+ def build_from_hash(attributes)
260
+ return nil unless attributes.is_a?(Hash)
261
+
262
+ self.class.swagger_types.each_pair do |key, type|
263
+ if type =~ /^Array<(.*)>/i
264
+ # check to ensure the input is an array given that the the attribute
265
+ # is documented as an array but the input is not
266
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
267
+ public_method("#{key}=").call(
268
+ attributes[self.class.attribute_map[key]]
269
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
270
+ )
271
+ end
272
+ elsif !attributes[self.class.attribute_map[key]].nil?
273
+ public_method("#{key}=").call(
274
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
275
+ )
276
+ end
277
+ # or else data not found in attributes(hash), not an issue as the data can be optional
278
+ end
279
+
280
+ self
281
+ end
282
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
283
+
284
+ # Returns the string representation of the object
285
+ # @return [String] String presentation of the object
286
+ def to_s
287
+ to_hash.to_s
288
+ end
289
+
290
+ # Returns the object in the form of hash
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_hash
293
+ hash = {}
294
+ self.class.attribute_map.each_pair do |attr, param|
295
+ value = public_method(attr).call
296
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
297
+
298
+ hash[param] = _to_hash(value)
299
+ end
300
+ hash
301
+ end
302
+
303
+ private
304
+
305
+ # Outputs non-array value in the form of hash
306
+ # For object, use to_hash. Otherwise, just return the value
307
+ # @param [Object] value Any valid value
308
+ # @return [Hash] Returns the value in the form of hash
309
+ def _to_hash(value)
310
+ if value.is_a?(Array)
311
+ value.compact.map { |v| _to_hash(v) }
312
+ elsif value.is_a?(Hash)
313
+ {}.tap do |hash|
314
+ value.each { |k, v| hash[k] = _to_hash(v) }
315
+ end
316
+ elsif value.respond_to? :to_hash
317
+ value.to_hash
318
+ else
319
+ value
320
+ end
321
+ end
322
+ end
323
+ end
324
+ # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength