This example assumes using Instill; is in scope and apiKey contains your Instill API key.
1 2 3 4 5 6 7 8 91011121314151617181920212223
usingvarclient=newInstillClient(apiKey);GetAuthenticatedUserResponseuserResponse=awaitclient.Namespace.MgmtPublicServiceGetAuthenticatedUserAsync();varnamespaceName=$"namespaces/{userResponse.User!.Id}";ListModelsResponseresponse;try{response=awaitclient.Model.ModelPublicServiceListModelsAsync(parent:namespaceName);}catch(ApiException<RpcStatus>ex)when(ex.Message.Contains("core-model-backend",StringComparison.Ordinal)){thrownewAssertInconclusiveException("Instill model backend is currently unavailable.",ex);}foreach(varmodelinresponse.Models??[]){Console.WriteLine($"Model: {model.Name}");Console.WriteLine($" ID: {model.Id}");Console.WriteLine($" Description: {model.Description}");Console.WriteLine();}