# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

require 'oci'

# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config

# Initialize service client with default config file
core_client = OCI::Core::VirtualNetworkClient.new(config: config)

# Send the request to service, some parameters are not required, see API doc for more info
update_security_list_response =
  core_client.update_security_list(
    'ocid1.test.oc1..<unique_ID>EXAMPLE-securityListId-Value',
    OCI::Core::Models::UpdateSecurityListDetails.new(
      defined_tags: {
        'EXAMPLE_KEY_pfl4o' => { 'EXAMPLE_KEY_1BgR3' => 'EXAMPLE--Value' }
      },
      display_name: 'EXAMPLE-displayName-Value',
      egress_security_rules: [
        OCI::Core::Models::EgressSecurityRule.new(
          destination: 'EXAMPLE-destination-Value',
          protocol: 'EXAMPLE-protocol-Value',
          destination_type: 'SERVICE_CIDR_BLOCK',
          icmp_options: OCI::Core::Models::IcmpOptions.new(type: 59, code: 4),
          is_stateless: true,
          tcp_options:
            OCI::Core::Models::TcpOptions.new(
              destination_port_range:
                OCI::Core::Models::PortRange.new(max: 167, min: 32_537),
              source_port_range:
                OCI::Core::Models::PortRange.new(max: 19_133, min: 5929)
            ),
          udp_options:
            OCI::Core::Models::UdpOptions.new(
              destination_port_range:
                OCI::Core::Models::PortRange.new(max: 21_151, min: 37_216),
              source_port_range:
                OCI::Core::Models::PortRange.new(max: 37_178, min: 2920)
            ),
          description: 'EXAMPLE-description-Value'
        )
      ],
      freeform_tags: {
        'EXAMPLE_KEY_VBGIv' => 'EXAMPLE_VALUE_NRgV4kvNzmZINcOhslV5'
      },
      ingress_security_rules: [
        OCI::Core::Models::IngressSecurityRule.new(
          protocol: 'EXAMPLE-protocol-Value',
          source: 'EXAMPLE-source-Value',
          icmp_options: OCI::Core::Models::IcmpOptions.new(type: 37, code: 12),
          is_stateless: false,
          source_type: 'SERVICE_CIDR_BLOCK',
          tcp_options:
            OCI::Core::Models::TcpOptions.new(
              destination_port_range:
                OCI::Core::Models::PortRange.new(max: 23_383, min: 57_254),
              source_port_range:
                OCI::Core::Models::PortRange.new(max: 15_697, min: 797)
            ),
          udp_options:
            OCI::Core::Models::UdpOptions.new(
              destination_port_range:
                OCI::Core::Models::PortRange.new(max: 34_789, min: 17_012),
              source_port_range:
                OCI::Core::Models::PortRange.new(max: 8351, min: 56_814)
            ),
          description: 'EXAMPLE-description-Value'
        )
      ]
    )
  )

# Get the data from response
puts "#{update_security_list_response.data}"