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

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Oci.DataintegrationService;
using Oci.Common;
using Oci.Common.Auth;

namespace Oci.Sdk.DotNet.Example.Dataintegration
{
    public class UpdateExternalPublicationExample
    {
        public static async Task Main()
        {
            // Create a request and dependent object(s).
			var updateExternalPublicationDetails = new Oci.DataintegrationService.Models.UpdateExternalPublicationDetails
			{
				ApplicationId = "ocid1.test.oc1..<unique_ID>EXAMPLE-applicationId-Value",
				ApplicationCompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-applicationCompartmentId-Value",
				DisplayName = "EXAMPLE-displayName-Value",
				Description = "EXAMPLE-description-Value",
				ResourceConfiguration = new Oci.DataintegrationService.Models.ResourceConfiguration
				{
					SparkVersion = "EXAMPLE-sparkVersion-Value",
					DriverShape = "EXAMPLE-driverShape-Value",
					ExecutorShape = "EXAMPLE-executorShape-Value",
					TotalExecutors = 360
				},
				ConfigurationDetails = new Oci.DataintegrationService.Models.ConfigurationDetails
				{
					DataAsset = new Oci.DataintegrationService.Models.DataAssetFromLakeDetails
					{
						LakeId = "ocid1.test.oc1..<unique_ID>EXAMPLE-lakeId-Value",
						MetastoreId = "ocid1.test.oc1..<unique_ID>EXAMPLE-metastoreId-Value",
						LakeProxyEndpoint = "EXAMPLE-lakeProxyEndpoint-Value",
						DefaultConnection = new Oci.DataintegrationService.Models.ConnectionFromLakeDetails
						{
							Key = "EXAMPLE-key-Value",
							ModelVersion = "EXAMPLE-modelVersion-Value",
							ParentRef = new Oci.DataintegrationService.Models.ParentReference
							{
								Parent = "EXAMPLE-parent-Value",
								RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
							},
							Name = "EXAMPLE-name-Value",
							Description = "EXAMPLE-description-Value",
							ObjectVersion = 910,
							ObjectStatus = 523,
							Identifier = "EXAMPLE-identifier-Value",
							PrimarySchema = new Oci.DataintegrationService.Models.Schema
							{
								Key = "EXAMPLE-key-Value",
								ModelType = "EXAMPLE-modelType-Value",
								ModelVersion = "EXAMPLE-modelVersion-Value",
								ParentRef = new Oci.DataintegrationService.Models.ParentReference
								{
									Parent = "EXAMPLE-parent-Value",
									RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
								},
								Name = "EXAMPLE-name-Value",
								ResourceName = "EXAMPLE-resourceName-Value",
								Description = "EXAMPLE-description-Value",
								ObjectVersion = 95,
								ExternalKey = "EXAMPLE-externalKey-Value",
								IsHasContainers = true,
								DefaultConnection = "EXAMPLE-defaultConnection-Value",
								ObjectStatus = 105,
								Identifier = "EXAMPLE-identifier-Value",
								Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
								{
									CreatedBy = "EXAMPLE-createdBy-Value",
									CreatedByName = "EXAMPLE-createdByName-Value",
									UpdatedBy = "EXAMPLE-updatedBy-Value",
									UpdatedByName = "EXAMPLE-updatedByName-Value",
									TimeCreated = DateTime.Parse("10/30/2011 17:10:21"),
									TimeUpdated = DateTime.Parse("08/30/2026 18:37:59"),
									AggregatorKey = "EXAMPLE-aggregatorKey-Value",
									Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
									{
										Type = "EXAMPLE-type-Value",
										Key = "EXAMPLE-key-Value",
										Name = "EXAMPLE-name-Value",
										Identifier = "EXAMPLE-identifier-Value",
										Description = "EXAMPLE-description-Value"
									},
									IdentifierPath = "EXAMPLE-identifierPath-Value",
									InfoFields = new Dictionary<string, string>()
									{
										{
											"EXAMPLE_KEY_iVu7G", 
											"EXAMPLE_VALUE_Xpm0tie1Wx2lY3R9xUgK"
										}
									},
									RegistryVersion = 540,
									Labels = new List<string>
									{
										"EXAMPLE--Value"
									},
									IsFavorite = false,
									CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
									{
										ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
										{
											new Oci.DataintegrationService.Models.CountStatisticSummary
											{
												ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Project,
												ObjectCount = 569
											}
										}
									}
								}
							},
							ConnectionProperties = new List<Oci.DataintegrationService.Models.ConnectionProperty>
							{
								new Oci.DataintegrationService.Models.ConnectionProperty
								{
									Name = "EXAMPLE-name-Value",
									Value = "EXAMPLE-value-Value"
								}
							},
							IsDefault = false,
							Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
							{
								CreatedBy = "EXAMPLE-createdBy-Value",
								CreatedByName = "EXAMPLE-createdByName-Value",
								UpdatedBy = "EXAMPLE-updatedBy-Value",
								UpdatedByName = "EXAMPLE-updatedByName-Value",
								TimeCreated = DateTime.Parse("08/28/2019 10:54:52"),
								TimeUpdated = DateTime.Parse("11/17/2032 12:17:44"),
								AggregatorKey = "EXAMPLE-aggregatorKey-Value",
								Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
								{
									Type = "EXAMPLE-type-Value",
									Key = "EXAMPLE-key-Value",
									Name = "EXAMPLE-name-Value",
									Identifier = "EXAMPLE-identifier-Value",
									Description = "EXAMPLE-description-Value"
								},
								IdentifierPath = "EXAMPLE-identifierPath-Value",
								InfoFields = new Dictionary<string, string>()
								{
									{
										"EXAMPLE_KEY_tA7ZZ", 
										"EXAMPLE_VALUE_IAAEZKxuvVju2vY9pd0g"
									}
								},
								RegistryVersion = 286,
								Labels = new List<string>
								{
									"EXAMPLE--Value"
								},
								IsFavorite = false,
								CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
								{
									ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
									{
										new Oci.DataintegrationService.Models.CountStatisticSummary
										{
											ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.FunctionLibrary,
											ObjectCount = 716
										}
									}
								}
							}
						},
						Key = "EXAMPLE-key-Value",
						ModelVersion = "EXAMPLE-modelVersion-Value",
						Name = "EXAMPLE-name-Value",
						Description = "EXAMPLE-description-Value",
						ObjectStatus = 494,
						Identifier = "EXAMPLE-identifier-Value",
						ExternalKey = "EXAMPLE-externalKey-Value",
						AssetProperties = new Dictionary<string, string>()
						{
							{
								"EXAMPLE_KEY_cQw2I", 
								"EXAMPLE_VALUE_48aaZtlsyc5mXcQakHkN"
							}
						},
						NativeTypeSystem = new Oci.DataintegrationService.Models.TypeSystem
						{
							Key = "EXAMPLE-key-Value",
							ModelType = "EXAMPLE-modelType-Value",
							ModelVersion = "EXAMPLE-modelVersion-Value",
							ParentRef = new Oci.DataintegrationService.Models.ParentReference
							{
								Parent = "EXAMPLE-parent-Value",
								RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
							},
							Name = "EXAMPLE-name-Value",
							Description = "EXAMPLE-description-Value",
							ObjectVersion = 907,
							TypeMappingTo = new Dictionary<string, string>()
							{
								{
									"EXAMPLE_KEY_Dyn4q", 
									"EXAMPLE_VALUE_kPIRsL2IzLRbcRVKgmy5"
								}
							},
							TypeMappingFrom = new Dictionary<string, string>()
							{
								{
									"EXAMPLE_KEY_Csn5s", 
									"EXAMPLE_VALUE_8CAuF2zn1dPa4ecp6D2L"
								}
							},
							ObjectStatus = 955,
							Identifier = "EXAMPLE-identifier-Value",
							Types = new List<Oci.DataintegrationService.Models.DataType>
							{
								new Oci.DataintegrationService.Models.DataType
								{
									DtType = Oci.DataintegrationService.Models.DataType.DtTypeEnum.Structured,
									TypeSystemName = "EXAMPLE-typeSystemName-Value",
									ConfigDefinition = new Oci.DataintegrationService.Models.ConfigDefinition
									{
										Key = "EXAMPLE-key-Value",
										ModelType = "EXAMPLE-modelType-Value",
										ModelVersion = "EXAMPLE-modelVersion-Value",
										ParentRef = new Oci.DataintegrationService.Models.ParentReference
										{
											Parent = "EXAMPLE-parent-Value",
											RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
										},
										Name = "EXAMPLE-name-Value",
										IsContained = false,
										ObjectStatus = 191,
										ConfigParameterDefinitions = new Dictionary<string, Oci.DataintegrationService.Models.ConfigParameterDefinition>()
										{
											{
												"EXAMPLE_KEY_sihZu", 
												new Oci.DataintegrationService.Models.ConfigParameterDefinition
												{
													ParameterType = new Oci.DataintegrationService.Models.DerivedType
													{
														Key = "EXAMPLE-key-Value",
														ModelVersion = "EXAMPLE-modelVersion-Value",
														ParentRef = new Oci.DataintegrationService.Models.ParentReference
														{
															Parent = "EXAMPLE-parent-Value",
															RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
														},
														Name = "EXAMPLE-name-Value",
														ObjectStatus = 527,
														Description = "EXAMPLE-description-Value"
													},
													ParameterName = "EXAMPLE-parameterName-Value",
													Description = "EXAMPLE-description-Value",
													DefaultValue = "EXAMPLE-defaultValue-Value",
													ClassFieldName = "EXAMPLE-classFieldName-Value",
													IsStatic = false,
													IsClassFieldValue = true
												}
											}
										}
									},
									Key = "EXAMPLE-key-Value",
									ModelVersion = "EXAMPLE-modelVersion-Value",
									ParentRef = new Oci.DataintegrationService.Models.ParentReference
									{
										Parent = "EXAMPLE-parent-Value",
										RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
									},
									Name = "EXAMPLE-name-Value",
									ObjectStatus = 443,
									Description = "EXAMPLE-description-Value"
								}
							}
						},
						ObjectVersion = 191,
						ParentRef = new Oci.DataintegrationService.Models.ParentReference
						{
							Parent = "EXAMPLE-parent-Value",
							RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
						},
						Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
						{
							CreatedBy = "EXAMPLE-createdBy-Value",
							CreatedByName = "EXAMPLE-createdByName-Value",
							UpdatedBy = "EXAMPLE-updatedBy-Value",
							UpdatedByName = "EXAMPLE-updatedByName-Value",
							TimeCreated = DateTime.Parse("11/29/2037 04:18:51"),
							TimeUpdated = DateTime.Parse("01/03/2039 02:27:04"),
							AggregatorKey = "EXAMPLE-aggregatorKey-Value",
							Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
							{
								Type = "EXAMPLE-type-Value",
								Key = "EXAMPLE-key-Value",
								Name = "EXAMPLE-name-Value",
								Identifier = "EXAMPLE-identifier-Value",
								Description = "EXAMPLE-description-Value"
							},
							IdentifierPath = "EXAMPLE-identifierPath-Value",
							InfoFields = new Dictionary<string, string>()
							{
								{
									"EXAMPLE_KEY_xnB8e", 
									"EXAMPLE_VALUE_U9R2tgrazYD2puNHrckm"
								}
							},
							RegistryVersion = 696,
							Labels = new List<string>
							{
								"EXAMPLE--Value"
							},
							IsFavorite = true,
							CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
							{
								ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
								{
									new Oci.DataintegrationService.Models.CountStatisticSummary
									{
										ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Connection,
										ObjectCount = 975
									}
								}
							}
						},
						KeyMap = new Dictionary<string, string>()
						{
							{
								"EXAMPLE_KEY_eBdx3", 
								"EXAMPLE_VALUE_O8KDrfdCc8SafhkvMv7o"
							}
						}
					},
					Connection = new Oci.DataintegrationService.Models.ConnectionFromLake
					{
						Key = "EXAMPLE-key-Value",
						ModelVersion = "EXAMPLE-modelVersion-Value",
						ParentRef = new Oci.DataintegrationService.Models.ParentReference
						{
							Parent = "EXAMPLE-parent-Value",
							RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
						},
						Name = "EXAMPLE-name-Value",
						Description = "EXAMPLE-description-Value",
						ObjectVersion = 784,
						ObjectStatus = 102,
						Identifier = "EXAMPLE-identifier-Value",
						PrimarySchema = new Oci.DataintegrationService.Models.Schema
						{
							Key = "EXAMPLE-key-Value",
							ModelType = "EXAMPLE-modelType-Value",
							ModelVersion = "EXAMPLE-modelVersion-Value",
							ParentRef = new Oci.DataintegrationService.Models.ParentReference
							{
								Parent = "EXAMPLE-parent-Value",
								RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
							},
							Name = "EXAMPLE-name-Value",
							ResourceName = "EXAMPLE-resourceName-Value",
							Description = "EXAMPLE-description-Value",
							ObjectVersion = 146,
							ExternalKey = "EXAMPLE-externalKey-Value",
							IsHasContainers = true,
							DefaultConnection = "EXAMPLE-defaultConnection-Value",
							ObjectStatus = 932,
							Identifier = "EXAMPLE-identifier-Value",
							Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
							{
								CreatedBy = "EXAMPLE-createdBy-Value",
								CreatedByName = "EXAMPLE-createdByName-Value",
								UpdatedBy = "EXAMPLE-updatedBy-Value",
								UpdatedByName = "EXAMPLE-updatedByName-Value",
								TimeCreated = DateTime.Parse("02/28/2020 04:32:39"),
								TimeUpdated = DateTime.Parse("06/30/2024 10:28:51"),
								AggregatorKey = "EXAMPLE-aggregatorKey-Value",
								Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
								{
									Type = "EXAMPLE-type-Value",
									Key = "EXAMPLE-key-Value",
									Name = "EXAMPLE-name-Value",
									Identifier = "EXAMPLE-identifier-Value",
									Description = "EXAMPLE-description-Value"
								},
								IdentifierPath = "EXAMPLE-identifierPath-Value",
								InfoFields = new Dictionary<string, string>()
								{
									{
										"EXAMPLE_KEY_puqZk", 
										"EXAMPLE_VALUE_SDtOGtzEshcPv84LxQ5f"
									}
								},
								RegistryVersion = 202,
								Labels = new List<string>
								{
									"EXAMPLE--Value"
								},
								IsFavorite = true,
								CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
								{
									ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
									{
										new Oci.DataintegrationService.Models.CountStatisticSummary
										{
											ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.DataAsset,
											ObjectCount = 797
										}
									}
								}
							}
						},
						ConnectionProperties = new List<Oci.DataintegrationService.Models.ConnectionProperty>
						{
							new Oci.DataintegrationService.Models.ConnectionProperty
							{
								Name = "EXAMPLE-name-Value",
								Value = "EXAMPLE-value-Value"
							}
						},
						IsDefault = true,
						Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
						{
							CreatedBy = "EXAMPLE-createdBy-Value",
							CreatedByName = "EXAMPLE-createdByName-Value",
							UpdatedBy = "EXAMPLE-updatedBy-Value",
							UpdatedByName = "EXAMPLE-updatedByName-Value",
							TimeCreated = DateTime.Parse("04/29/2034 12:59:34"),
							TimeUpdated = DateTime.Parse("01/15/2045 03:11:25"),
							AggregatorKey = "EXAMPLE-aggregatorKey-Value",
							Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
							{
								Type = "EXAMPLE-type-Value",
								Key = "EXAMPLE-key-Value",
								Name = "EXAMPLE-name-Value",
								Identifier = "EXAMPLE-identifier-Value",
								Description = "EXAMPLE-description-Value"
							},
							IdentifierPath = "EXAMPLE-identifierPath-Value",
							InfoFields = new Dictionary<string, string>()
							{
								{
									"EXAMPLE_KEY_ZbI7u", 
									"EXAMPLE_VALUE_Or3F7Ir25UBmk1WsEfz6"
								}
							},
							RegistryVersion = 945,
							Labels = new List<string>
							{
								"EXAMPLE--Value"
							},
							IsFavorite = false,
							CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
							{
								ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
								{
									new Oci.DataintegrationService.Models.CountStatisticSummary
									{
										ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.Application,
										ObjectCount = 437
									}
								}
							}
						},
						KeyMap = new Dictionary<string, string>()
						{
							{
								"EXAMPLE_KEY_xGEOB", 
								"EXAMPLE_VALUE_bHhuVSsNGqLfrYrkej7s"
							}
						}
					},
					CompartmentId = "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
					Schema = new Oci.DataintegrationService.Models.Schema
					{
						Key = "EXAMPLE-key-Value",
						ModelType = "EXAMPLE-modelType-Value",
						ModelVersion = "EXAMPLE-modelVersion-Value",
						ParentRef = new Oci.DataintegrationService.Models.ParentReference
						{
							Parent = "EXAMPLE-parent-Value",
							RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
						},
						Name = "EXAMPLE-name-Value",
						ResourceName = "EXAMPLE-resourceName-Value",
						Description = "EXAMPLE-description-Value",
						ObjectVersion = 235,
						ExternalKey = "EXAMPLE-externalKey-Value",
						IsHasContainers = true,
						DefaultConnection = "EXAMPLE-defaultConnection-Value",
						ObjectStatus = 18,
						Identifier = "EXAMPLE-identifier-Value",
						Metadata = new Oci.DataintegrationService.Models.ObjectMetadata
						{
							CreatedBy = "EXAMPLE-createdBy-Value",
							CreatedByName = "EXAMPLE-createdByName-Value",
							UpdatedBy = "EXAMPLE-updatedBy-Value",
							UpdatedByName = "EXAMPLE-updatedByName-Value",
							TimeCreated = DateTime.Parse("09/18/2029 14:37:19"),
							TimeUpdated = DateTime.Parse("08/02/2013 09:50:06"),
							AggregatorKey = "EXAMPLE-aggregatorKey-Value",
							Aggregator = new Oci.DataintegrationService.Models.AggregatorSummary
							{
								Type = "EXAMPLE-type-Value",
								Key = "EXAMPLE-key-Value",
								Name = "EXAMPLE-name-Value",
								Identifier = "EXAMPLE-identifier-Value",
								Description = "EXAMPLE-description-Value"
							},
							IdentifierPath = "EXAMPLE-identifierPath-Value",
							InfoFields = new Dictionary<string, string>()
							{
								{
									"EXAMPLE_KEY_1wLRX", 
									"EXAMPLE_VALUE_ZuxsAHUDNLfeecEIzAuu"
								}
							},
							RegistryVersion = 757,
							Labels = new List<string>
							{
								"EXAMPLE--Value"
							},
							IsFavorite = true,
							CountStatistics = new Oci.DataintegrationService.Models.CountStatistic
							{
								ObjectTypeCountList = new List<Oci.DataintegrationService.Models.CountStatisticSummary>
								{
									new Oci.DataintegrationService.Models.CountStatisticSummary
									{
										ObjectType = Oci.DataintegrationService.Models.CountStatisticSummary.ObjectTypeEnum.DataFlow,
										ObjectCount = 322
									}
								}
							}
						}
					}
				}
			};
			var updateExternalPublicationRequest = new Oci.DataintegrationService.Requests.UpdateExternalPublicationRequest
			{
				WorkspaceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
				TaskKey = "EXAMPLE-taskKey-Value",
				ExternalPublicationsKey = "EXAMPLE-externalPublicationsKey-Value",
				UpdateExternalPublicationDetails = updateExternalPublicationDetails,
				OpcRequestId = "ET1ZFRUTTFFDBAXS9FJO<unique_ID>",
				IfMatch = "EXAMPLE-ifMatch-Value"
			};

            // 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. 
            var provider = new ConfigFileAuthenticationDetailsProvider("DEFAULT");
            try
            {
                // Create a service client and send the request.
				using (var client = new DataIntegrationClient(provider, new ClientConfiguration()))
				{
					var response = await client.UpdateExternalPublication(updateExternalPublicationRequest);
					// Retrieve value from the response.
					var applicationIdValue = response.ExternalPublication.ApplicationId;
				}
            }
            catch (Exception e)
            {
                Console.WriteLine($"UpdateExternalPublication Failed with {e.Message}");
                throw e;
            }
        }

    }
}