// 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).

package main

import (
	"context"
	"fmt"

	"github.com/oracle/oci-go-sdk/v65/common"
	"github.com/oracle/oci-go-sdk/v65/core"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleUpdateIPSecConnectionTunnel() {
	// Create a default authentication provider that uses the DEFAULT
	// profile in the configuration file.
	// Refer to <see href="https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File>the public documentation</see> on how to prepare a configuration file.
	client, err := core.NewVirtualNetworkClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).

	req := core.UpdateIPSecConnectionTunnelRequest{IfMatch: common.String("EXAMPLE-ifMatch-Value"),
		IpscId:       common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-ipscId-Value"),
		OpcRequestId: common.String("E312GKGLEAMKKI0P1QXP<unique_ID>"),
		TunnelId:     common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-tunnelId-Value"),
		UpdateIpSecConnectionTunnelDetails: core.UpdateIpSecConnectionTunnelDetails{IkeVersion: core.UpdateIpSecConnectionTunnelDetailsIkeVersionV1,
			PhaseOneConfig: &core.PhaseOneConfigDetails{IsCustomPhaseOneConfig: common.Bool(false),
				LifetimeInSeconds:       common.Int(383),
				AuthenticationAlgorithm: core.PhaseOneConfigDetailsAuthenticationAlgorithmSha196,
				DiffieHelmanGroup:       core.PhaseOneConfigDetailsDiffieHelmanGroupGroup5,
				EncryptionAlgorithm:     core.PhaseOneConfigDetailsEncryptionAlgorithm128Cbc},
			PhaseTwoConfig: &core.PhaseTwoConfigDetails{EncryptionAlgorithm: core.PhaseTwoConfigDetailsEncryptionAlgorithm192Cbc,
				IsCustomPhaseTwoConfig:  common.Bool(false),
				IsPfsEnabled:            common.Bool(false),
				LifetimeInSeconds:       common.Int(928),
				PfsDhGroup:              core.PhaseTwoConfigDetailsPfsDhGroupGroup2,
				AuthenticationAlgorithm: core.PhaseTwoConfigDetailsAuthenticationAlgorithmSha2256128},
			BgpSessionConfig: &core.UpdateIpSecTunnelBgpSessionDetails{CustomerBgpAsn: common.String("EXAMPLE-customerBgpAsn-Value"),
				CustomerInterfaceIp:   common.String("EXAMPLE-customerInterfaceIp-Value"),
				CustomerInterfaceIpv6: common.String("EXAMPLE-customerInterfaceIpv6-Value"),
				OracleInterfaceIp:     common.String("EXAMPLE-oracleInterfaceIp-Value"),
				OracleInterfaceIpv6:   common.String("EXAMPLE-oracleInterfaceIpv6-Value")},
			DisplayName: common.String("EXAMPLE-displayName-Value"),
			DpdConfig: &core.DpdConfig{DpdMode: core.DpdConfigDpdModeRespondOnly,
				DpdTimeoutInSec: common.Int(381)},
			EncryptionDomainConfig: &core.UpdateIpSecTunnelEncryptionDomainDetails{CpeTrafficSelector: []string{"EXAMPLE--Value"},
				OracleTrafficSelector: []string{"EXAMPLE--Value"}},
			NatTranslationEnabled: core.UpdateIpSecConnectionTunnelDetailsNatTranslationEnabledDisabled,
			OracleInitiation:      core.UpdateIpSecConnectionTunnelDetailsOracleInitiationInitiatorOrResponder,
			Routing:               core.UpdateIpSecConnectionTunnelDetailsRoutingPolicy}}

	// Send the request using the service client
	resp, err := client.UpdateIPSecConnectionTunnel(context.Background(), req)
	helpers.FatalIfError(err)

	// Retrieve value from the response.
	fmt.Println(resp)
}