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

import * as aispeech from "oci-aispeech";
import common = require("oci-common");

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

const provider: common.ConfigFileAuthenticationDetailsProvider = new common.ConfigFileAuthenticationDetailsProvider();

(async () => {
    try {
     // Create a service client
     const client = new aispeech.AIServiceSpeechClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  updateCustomizationDetails = {
		alias: "EXAMPLE-alias-Value",
		displayName: "EXAMPLE-displayName-Value",
		description: "EXAMPLE-description-Value",
		modelDetails: {
			domain: aispeech.models.CustomizationModelDetails.Domain.Generic,
			languageCode: "EXAMPLE-languageCode-Value",

			}
,
		trainingDataset: {
			datasetType: "ENTITY_LIST",			referenceExamples: ["EXAMPLE--Value"					],
			entityList: [{
					alias: "EXAMPLE-alias-Value",
					id: "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
					entityType: "EXAMPLE-entityType-Value",
					entities: [{
							entityValue: "EXAMPLE-entityValue-Value",
							pronunciations: [{
									soundsLike: "EXAMPLE-soundsLike-Value",
									audio: {
										locationType: "OBJECT_LIST",										bucketName: "EXAMPLE-bucketName-Value",
										namespaceName: "EXAMPLE-namespaceName-Value",
										objectNames: ["EXAMPLE--Value"												]

										}
,

									}
									],
							weight: 3126.8757,

							}
							],

					}
					]

			}
,
		freeformTags: {
			EXAMPLE_KEY_FcRKf :"EXAMPLE_VALUE_b0jxLhbpf63YxeHhVg2h"
			},
		definedTags: {
			EXAMPLE_KEY_maB4t :{
				EXAMPLE_KEY_2q9zb :"EXAMPLE--Value"
				}
			},

		}

	const updateCustomizationRequest: aispeech.requests.UpdateCustomizationRequest = { 
	customizationId: "ocid1.test.oc1..<unique_ID>EXAMPLE-customizationId-Value",
	updateCustomizationDetails: updateCustomizationDetails,
	ifMatch: "EXAMPLE-ifMatch-Value",
	opcRequestId: "JGSZGJOWUJDNCAHQDEP9<unique_ID>",

		}; 


     // Send request to the Client.
     const updateCustomizationResponse = await client.updateCustomization(updateCustomizationRequest);
     }
     catch (error) {
         console.log("updateCustomization Failed with error  " + error);
     }
})();