// 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.AispeechService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Aispeech
{
public class UpdateCustomizationExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateCustomizationDetails = new Oci.AispeechService.Models.UpdateCustomizationDetails
{
Alias = "EXAMPLE-alias-Value",
DisplayName = "EXAMPLE-displayName-Value",
Description = "EXAMPLE-description-Value",
ModelDetails = new Oci.AispeechService.Models.CustomizationModelDetails
{
Domain = Oci.AispeechService.Models.CustomizationModelDetails.DomainEnum.Generic,
LanguageCode = "EXAMPLE-languageCode-Value"
},
TrainingDataset = new Oci.AispeechService.Models.EntityListDataset
{
ReferenceExamples = new List<string>
{
"EXAMPLE--Value"
},
EntityList = new List<Oci.AispeechService.Models.EntityList>
{
new Oci.AispeechService.Models.EntityList
{
Alias = "EXAMPLE-alias-Value",
Id = "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
EntityType = "EXAMPLE-entityType-Value",
Entities = new List<Oci.AispeechService.Models.Entity>
{
new Oci.AispeechService.Models.Entity
{
EntityValue = "EXAMPLE-entityValue-Value",
Pronunciations = new List<Oci.AispeechService.Models.Pronunciation>
{
new Oci.AispeechService.Models.Pronunciation
{
SoundsLike = "EXAMPLE-soundsLike-Value",
Audio = new Oci.AispeechService.Models.ObjectListDataset
{
BucketName = "EXAMPLE-bucketName-Value",
NamespaceName = "EXAMPLE-namespaceName-Value",
ObjectNames = new List<string>
{
"EXAMPLE--Value"
}
}
}
},
Weight = (float)3897.686
}
}
}
}
},
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_cA7rX",
"EXAMPLE_VALUE_zChVk4mXHLLbyZve1YWp"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_hl5o7",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_kKirQ",
"EXAMPLE--Value"
}
}
}
}
};
var updateCustomizationRequest = new Oci.AispeechService.Requests.UpdateCustomizationRequest
{
CustomizationId = "ocid1.test.oc1..<unique_ID>EXAMPLE-customizationId-Value",
UpdateCustomizationDetails = updateCustomizationDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "U9FCAVFROAL5AFIP1S7Y<unique_ID>"
};
// 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 AIServiceSpeechClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateCustomization(updateCustomizationRequest);
// Retrieve value from the response.
var id = response.Customization.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateCustomization Failed with {e.Message}");
throw e;
}
}
}
}