// 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"
	"time"

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

func ExampleUpdateExternalPublication() {
	// 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 := dataintegration.NewDataIntegrationClientWithConfigurationProvider(common.DefaultConfigProvider())
	helpers.FatalIfError(err)

	// Create a request and dependent object(s).
	var defaultValue interface{}
	defaultValue = "EXAMPLE-defaultValue-Value"
	var wrappedType interface{}
	wrappedType = "EXAMPLE-wrappedType-Value"
	var objectValue interface{}
	objectValue = "EXAMPLE-objectValue-Value"
	var refValue interface{}
	refValue = "EXAMPLE-refValue-Value"
	var rootObjectValue interface{}
	rootObjectValue = "EXAMPLE-rootObjectValue-Value"
	req := dataintegration.UpdateExternalPublicationRequest{TaskKey: common.String("EXAMPLE-taskKey-Value"),
		UpdateExternalPublicationDetails: dataintegration.UpdateExternalPublicationDetails{ApplicationCompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-applicationCompartmentId-Value"),
			ApplicationId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value"),
			ConfigurationDetails: &dataintegration.ConfigurationDetails{CompartmentId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value"),
				Connection: dataintegration.ConnectionFromLake{ObjectStatus: common.Int(868),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					KeyMap:        map[string]string{"EXAMPLE_KEY_djBLv": "EXAMPLE_VALUE_fCStXxej3v0A2quDfviB"},
					ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
					Description:   common.String("EXAMPLE-description-Value"),
					Identifier:    common.String("EXAMPLE-identifier-Value"),
					Key:           common.String("EXAMPLE-key-Value"),
					ObjectVersion: common.Int(726),
					PrimarySchema: &dataintegration.Schema{IsHasContainers: common.Bool(false),
						Name: common.String("EXAMPLE-name-Value"),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						ExternalKey:       common.String("EXAMPLE-externalKey-Value"),
						Identifier:        common.String("EXAMPLE-identifier-Value"),
						ResourceName:      common.String("EXAMPLE-resourceName-Value"),
						Description:       common.String("EXAMPLE-description-Value"),
						ModelVersion:      common.String("EXAMPLE-modelVersion-Value"),
						ObjectVersion:     common.Int(93),
						Key:               common.String("EXAMPLE-key-Value"),
						ObjectStatus:      common.Int(943),
						DefaultConnection: common.String("EXAMPLE-defaultConnection-Value"),
						Metadata: &dataintegration.ObjectMetadata{TimeUpdated: &common.SDKTime{Time: time.Now()},
							UpdatedBy:     common.String("EXAMPLE-updatedBy-Value"),
							UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
							CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(725),
								ObjectType: dataintegration.CountStatisticSummaryObjectTypeTask}}},
							CreatedByName:   common.String("EXAMPLE-createdByName-Value"),
							InfoFields:      map[string]string{"EXAMPLE_KEY_uUmIq": "EXAMPLE_VALUE_btwOPON01PlhXor1LTj8"},
							RegistryVersion: common.Int(722),
							TimeCreated:     &common.SDKTime{Time: time.Now()},
							AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
							Labels:          []string{"EXAMPLE--Value"},
							IdentifierPath:  common.String("EXAMPLE-identifierPath-Value"),
							IsFavorite:      common.Bool(false),
							Aggregator: &dataintegration.AggregatorSummary{Description: common.String("EXAMPLE-description-Value"),
								Identifier: common.String("EXAMPLE-identifier-Value"),
								Key:        common.String("EXAMPLE-key-Value"),
								Name:       common.String("EXAMPLE-name-Value"),
								Type:       common.String("EXAMPLE-type-Value")},
							CreatedBy: common.String("EXAMPLE-createdBy-Value")}},
					ConnectionProperties: []dataintegration.ConnectionProperty{dataintegration.ConnectionProperty{Name: common.String("EXAMPLE-name-Value"),
						Value: common.String("EXAMPLE-value-Value")}},
					Metadata: &dataintegration.ObjectMetadata{IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
						Labels:        []string{"EXAMPLE--Value"},
						TimeCreated:   &common.SDKTime{Time: time.Now()},
						UpdatedBy:     common.String("EXAMPLE-updatedBy-Value"),
						UpdatedByName: common.String("EXAMPLE-updatedByName-Value"),
						Aggregator: &dataintegration.AggregatorSummary{Key: common.String("EXAMPLE-key-Value"),
							Name:        common.String("EXAMPLE-name-Value"),
							Type:        common.String("EXAMPLE-type-Value"),
							Description: common.String("EXAMPLE-description-Value"),
							Identifier:  common.String("EXAMPLE-identifier-Value")},
						AggregatorKey: common.String("EXAMPLE-aggregatorKey-Value"),
						CreatedByName: common.String("EXAMPLE-createdByName-Value"),
						CreatedBy:     common.String("EXAMPLE-createdBy-Value"),
						TimeUpdated:   &common.SDKTime{Time: time.Now()},
						CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(999),
							ObjectType: dataintegration.CountStatisticSummaryObjectTypeUserDefinedFunction}}},
						InfoFields:      map[string]string{"EXAMPLE_KEY_GtE5y": "EXAMPLE_VALUE_1fDGdgfN68rUeuIKisPR"},
						IsFavorite:      common.Bool(false),
						RegistryVersion: common.Int(819)},
					Name:      common.String("EXAMPLE-name-Value"),
					IsDefault: common.Bool(true)},
				DataAsset: dataintegration.DataAssetFromOracleDetails{Sid: common.String("EXAMPLE-sid-Value"),
					WalletPasswordSecret: &dataintegration.SensitiveAttribute{SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")},
						Value: common.String("EXAMPLE-value-Value")},
					WalletSecret: &dataintegration.SensitiveAttribute{SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")},
						Value: common.String("EXAMPLE-value-Value")},
					KeyMap:      map[string]string{"EXAMPLE_KEY_GPo4s": "EXAMPLE_VALUE_or0zvOzl5XzKvYIwWQW6"},
					ServiceName: common.String("EXAMPLE-serviceName-Value"),
					Name:        common.String("EXAMPLE-name-Value"),
					NativeTypeSystem: &dataintegration.TypeSystem{Description: common.String("EXAMPLE-description-Value"),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						ObjectStatus: common.Int(690),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						TypeMappingFrom: map[string]string{"EXAMPLE_KEY_ZWr7l": "EXAMPLE_VALUE_MKhiKVPd5soszfkk9ous"},
						Identifier:      common.String("EXAMPLE-identifier-Value"),
						Key:             common.String("EXAMPLE-key-Value"),
						Name:            common.String("EXAMPLE-name-Value"),
						ObjectVersion:   common.Int(971),
						TypeMappingTo:   map[string]string{"EXAMPLE_KEY_WZCeb": "EXAMPLE_VALUE_yBeV5iB10oaCpSfoSBG8"},
						Types: []dataintegration.DataType{dataintegration.DataType{Description: common.String("EXAMPLE-description-Value"),
							DtType: dataintegration.DataTypeDtTypeStructured,
							Name:   common.String("EXAMPLE-name-Value"),
							ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
								RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
							TypeSystemName: common.String("EXAMPLE-typeSystemName-Value"),
							ConfigDefinition: &dataintegration.ConfigDefinition{ObjectStatus: common.Int(616),
								ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
									RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
								ConfigParameterDefinitions: map[string]dataintegration.ConfigParameterDefinition{"EXAMPLE_KEY_SCQFG": dataintegration.ConfigParameterDefinition{DefaultValue: &defaultValue,
									Description:       common.String("EXAMPLE-description-Value"),
									IsClassFieldValue: common.Bool(true),
									IsStatic:          common.Bool(false),
									ParameterName:     common.String("EXAMPLE-parameterName-Value"),
									ParameterType: dataintegration.ConfiguredType{ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
										Name: common.String("EXAMPLE-name-Value"),
										ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
											RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
										WrappedType: &wrappedType,
										ConfigValues: &dataintegration.ConfigValues{ConfigParamValues: map[string]dataintegration.ConfigParameterValue{"EXAMPLE_KEY_KaWcr": dataintegration.ConfigParameterValue{ObjectValue: &objectValue,
											ParameterValue:  common.String("EXAMPLE-parameterValue-Value"),
											RefValue:        &refValue,
											RootObjectValue: &rootObjectValue,
											StringValue:     common.String("EXAMPLE-stringValue-Value"),
											IntValue:        common.Int(113)}},
											ParentRef: &dataintegration.ParentReference{RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"),
												Parent: common.String("EXAMPLE-parent-Value")}},
										Description:  common.String("EXAMPLE-description-Value"),
										Key:          common.String("EXAMPLE-key-Value"),
										ObjectStatus: common.Int(93)},
									ClassFieldName: common.String("EXAMPLE-classFieldName-Value")}},
								IsContained:  common.Bool(true),
								Key:          common.String("EXAMPLE-key-Value"),
								ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
								Name:         common.String("EXAMPLE-name-Value")},
							Key:          common.String("EXAMPLE-key-Value"),
							ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
							ObjectStatus: common.Int(210)}}},
					ObjectStatus: common.Int(456),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					Port:         common.String("EXAMPLE-port-Value"),
					Key:          common.String("EXAMPLE-key-Value"),
					ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
					Host:         common.String("EXAMPLE-host-Value"),
					Identifier:   common.String("EXAMPLE-identifier-Value"),
					Metadata: &dataintegration.ObjectMetadata{CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(987),
						ObjectType: dataintegration.CountStatisticSummaryObjectTypeTask}}},
						CreatedBy:      common.String("EXAMPLE-createdBy-Value"),
						CreatedByName:  common.String("EXAMPLE-createdByName-Value"),
						TimeCreated:    &common.SDKTime{Time: time.Now()},
						UpdatedBy:      common.String("EXAMPLE-updatedBy-Value"),
						IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
						InfoFields:     map[string]string{"EXAMPLE_KEY_esrDA": "EXAMPLE_VALUE_FLIjAxjKFVRvIQSxI9yo"},
						Labels:         []string{"EXAMPLE--Value"},
						Aggregator: &dataintegration.AggregatorSummary{Description: common.String("EXAMPLE-description-Value"),
							Identifier: common.String("EXAMPLE-identifier-Value"),
							Key:        common.String("EXAMPLE-key-Value"),
							Name:       common.String("EXAMPLE-name-Value"),
							Type:       common.String("EXAMPLE-type-Value")},
						AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
						IsFavorite:      common.Bool(true),
						RegistryVersion: common.Int(197),
						UpdatedByName:   common.String("EXAMPLE-updatedByName-Value"),
						TimeUpdated:     &common.SDKTime{Time: time.Now()}},
					DefaultConnection: &dataintegration.ConnectionFromOracleDetails{Description: common.String("EXAMPLE-description-Value"),
						ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
							RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
						Password: common.String("EXAMPLE-password-Value"),
						PrimarySchema: &dataintegration.Schema{ObjectStatus: common.Int(232),
							ExternalKey: common.String("EXAMPLE-externalKey-Value"),
							Name:        common.String("EXAMPLE-name-Value"),
							ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
								RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
							ObjectVersion:     common.Int(254),
							ResourceName:      common.String("EXAMPLE-resourceName-Value"),
							DefaultConnection: common.String("EXAMPLE-defaultConnection-Value"),
							Description:       common.String("EXAMPLE-description-Value"),
							Identifier:        common.String("EXAMPLE-identifier-Value"),
							Metadata: &dataintegration.ObjectMetadata{Aggregator: &dataintegration.AggregatorSummary{Type: common.String("EXAMPLE-type-Value"),
								Description: common.String("EXAMPLE-description-Value"),
								Identifier:  common.String("EXAMPLE-identifier-Value"),
								Key:         common.String("EXAMPLE-key-Value"),
								Name:        common.String("EXAMPLE-name-Value")},
								CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(176),
									ObjectType: dataintegration.CountStatisticSummaryObjectTypeFunctionLibrary}}},
								InfoFields:      map[string]string{"EXAMPLE_KEY_8xJU2": "EXAMPLE_VALUE_x5NqB93TKLwyzDpIjO06"},
								IsFavorite:      common.Bool(false),
								RegistryVersion: common.Int(411),
								TimeCreated:     &common.SDKTime{Time: time.Now()},
								UpdatedByName:   common.String("EXAMPLE-updatedByName-Value"),
								IdentifierPath:  common.String("EXAMPLE-identifierPath-Value"),
								Labels:          []string{"EXAMPLE--Value"},
								AggregatorKey:   common.String("EXAMPLE-aggregatorKey-Value"),
								CreatedBy:       common.String("EXAMPLE-createdBy-Value"),
								CreatedByName:   common.String("EXAMPLE-createdByName-Value"),
								TimeUpdated:     &common.SDKTime{Time: time.Now()},
								UpdatedBy:       common.String("EXAMPLE-updatedBy-Value")},
							IsHasContainers: common.Bool(true),
							Key:             common.String("EXAMPLE-key-Value"),
							ModelVersion:    common.String("EXAMPLE-modelVersion-Value")},
						Identifier:   common.String("EXAMPLE-identifier-Value"),
						ObjectStatus: common.Int(631),
						PasswordSecret: &dataintegration.SensitiveAttribute{SecretConfig: dataintegration.OciVaultSecretConfig{SecretId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-secretId-Value")},
							Value: common.String("EXAMPLE-value-Value")},
						ConnectionProperties: []dataintegration.ConnectionProperty{dataintegration.ConnectionProperty{Name: common.String("EXAMPLE-name-Value"),
							Value: common.String("EXAMPLE-value-Value")}},
						IsDefault:    common.Bool(true),
						ModelVersion: common.String("EXAMPLE-modelVersion-Value"),
						Name:         common.String("EXAMPLE-name-Value"),
						Username:     common.String("EXAMPLE-username-Value"),
						Key:          common.String("EXAMPLE-key-Value"),
						Metadata: &dataintegration.ObjectMetadata{CreatedByName: common.String("EXAMPLE-createdByName-Value"),
							RegistryVersion: common.Int(924),
							Aggregator: &dataintegration.AggregatorSummary{Description: common.String("EXAMPLE-description-Value"),
								Identifier: common.String("EXAMPLE-identifier-Value"),
								Key:        common.String("EXAMPLE-key-Value"),
								Name:       common.String("EXAMPLE-name-Value"),
								Type:       common.String("EXAMPLE-type-Value")},
							CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(59),
								ObjectType: dataintegration.CountStatisticSummaryObjectTypeApplication}}},
							CreatedBy:      common.String("EXAMPLE-createdBy-Value"),
							IsFavorite:     common.Bool(true),
							TimeCreated:    &common.SDKTime{Time: time.Now()},
							UpdatedBy:      common.String("EXAMPLE-updatedBy-Value"),
							UpdatedByName:  common.String("EXAMPLE-updatedByName-Value"),
							AggregatorKey:  common.String("EXAMPLE-aggregatorKey-Value"),
							IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
							Labels:         []string{"EXAMPLE--Value"},
							InfoFields:     map[string]string{"EXAMPLE_KEY_MfcQj": "EXAMPLE_VALUE_YCzsaRJDBdaoddWlqpNe"},
							TimeUpdated:    &common.SDKTime{Time: time.Now()}},
						ObjectVersion: common.Int(37)},
					Description:           common.String("EXAMPLE-description-Value"),
					DriverClass:           common.String("EXAMPLE-driverClass-Value"),
					ExternalKey:           common.String("EXAMPLE-externalKey-Value"),
					ObjectVersion:         common.Int(893),
					AssetProperties:       map[string]string{"EXAMPLE_KEY_sti2C": "EXAMPLE_VALUE_ttBEDsPpzLpLbsRAWO6h"},
					CredentialFileContent: common.String("EXAMPLE-credentialFileContent-Value")},
				Schema: &dataintegration.Schema{DefaultConnection: common.String("EXAMPLE-defaultConnection-Value"),
					IsHasContainers: common.Bool(true),
					Name:            common.String("EXAMPLE-name-Value"),
					Description:     common.String("EXAMPLE-description-Value"),
					Identifier:      common.String("EXAMPLE-identifier-Value"),
					Key:             common.String("EXAMPLE-key-Value"),
					ModelType:       common.String("EXAMPLE-modelType-Value"),
					ParentRef: &dataintegration.ParentReference{Parent: common.String("EXAMPLE-parent-Value"),
						RootDocId: common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value")},
					ResourceName: common.String("EXAMPLE-resourceName-Value"),
					ExternalKey:  common.String("EXAMPLE-externalKey-Value"),
					Metadata: &dataintegration.ObjectMetadata{TimeCreated: &common.SDKTime{Time: time.Now()},
						TimeUpdated:    &common.SDKTime{Time: time.Now()},
						UpdatedBy:      common.String("EXAMPLE-updatedBy-Value"),
						UpdatedByName:  common.String("EXAMPLE-updatedByName-Value"),
						AggregatorKey:  common.String("EXAMPLE-aggregatorKey-Value"),
						CreatedBy:      common.String("EXAMPLE-createdBy-Value"),
						IdentifierPath: common.String("EXAMPLE-identifierPath-Value"),
						Aggregator: &dataintegration.AggregatorSummary{Description: common.String("EXAMPLE-description-Value"),
							Identifier: common.String("EXAMPLE-identifier-Value"),
							Key:        common.String("EXAMPLE-key-Value"),
							Name:       common.String("EXAMPLE-name-Value"),
							Type:       common.String("EXAMPLE-type-Value")},
						CountStatistics: &dataintegration.CountStatistic{ObjectTypeCountList: []dataintegration.CountStatisticSummary{dataintegration.CountStatisticSummary{ObjectCount: common.Int64(134),
							ObjectType: dataintegration.CountStatisticSummaryObjectTypeApplication}}},
						InfoFields:      map[string]string{"EXAMPLE_KEY_13ERP": "EXAMPLE_VALUE_NShihXo4PIXr9ZKosuqX"},
						CreatedByName:   common.String("EXAMPLE-createdByName-Value"),
						IsFavorite:      common.Bool(true),
						Labels:          []string{"EXAMPLE--Value"},
						RegistryVersion: common.Int(132)},
					ModelVersion:  common.String("EXAMPLE-modelVersion-Value"),
					ObjectStatus:  common.Int(756),
					ObjectVersion: common.Int(609)}},
			Description: common.String("EXAMPLE-description-Value"),
			DisplayName: common.String("EXAMPLE-displayName-Value"),
			ResourceConfiguration: &dataintegration.ResourceConfiguration{SparkVersion: common.String("EXAMPLE-sparkVersion-Value"),
				TotalExecutors: common.Int(848),
				DriverShape:    common.String("EXAMPLE-driverShape-Value"),
				ExecutorShape:  common.String("EXAMPLE-executorShape-Value")}},
		WorkspaceId:             common.String("ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value"),
		ExternalPublicationsKey: common.String("EXAMPLE-externalPublicationsKey-Value"),
		IfMatch:                 common.String("EXAMPLE-ifMatch-Value"),
		OpcRequestId:            common.String("A96SKEKRYRINKBG7EEWO<unique_ID>")}

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

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