// 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/dataflow"
	"github.com/oracle/oci-go-sdk/v65/example/helpers"
)

func ExampleUpdateSqlEndpoint() {
	// 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 := dataflow.NewDataFlowClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

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

	req := dataflow.UpdateSqlEndpointRequest{OpcRequestId: common.String("RZG4GV0ZHTU8QBGLCJ2V<unique_ID>"),
		SqlEndpointId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-sqlEndpointId-Value"),
		UpdateSqlEndpointDetails: dataflow.UpdateSqlEndpointDetails{DriverShape: common.String("EXAMPLE-driverShape-Value"),
			LakeId:                      common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-lakeId-Value"),
			MaxExecutorCount:            common.Int(502),
			MinExecutorCount:            common.Int(374),
			SparkAdvancedConfigurations: map[string]string{"EXAMPLE_KEY_16sI5": "EXAMPLE_VALUE_DaqM8Oq1r0jOypeiuTB4"},
			Description:                 common.String("EXAMPLE-description-Value"),
			DisplayName:                 common.String("EXAMPLE-displayName-Value"),
			DriverShapeConfig: &dataflow.ShapeConfig{MemoryInGBs: common.Float32(4015.7688),
				Ocpus: common.Float32(5060.974)},
			ExecutorShape: common.String("EXAMPLE-executorShape-Value"),
			ExecutorShapeConfig: &dataflow.ShapeConfig{MemoryInGBs: common.Float32(6414.5415),
				Ocpus: common.Float32(9765.354)},
			FreeformTags: map[string]string{"EXAMPLE_KEY_ZlmmU": "EXAMPLE_VALUE_0oUzx6AOO0AF0OKkTIm0"},
			MetastoreId:  common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-metastoreId-Value"),
			DefinedTags:  map[string]map[string]interface{}{"EXAMPLE_KEY_9W5KU": map[string]interface{}{"EXAMPLE_KEY_Po3rE": "EXAMPLE--Value"}}},
		IfMatch: common.String("EXAMPLE-ifMatch-Value")}

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

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