// 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 UpdateApplicationExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateApplicationDetails = new Oci.DataintegrationService.Models.UpdateApplicationDetails
{
Key = "EXAMPLE-key-Value",
ModelType = "EXAMPLE-modelType-Value",
ModelVersion = "EXAMPLE-modelVersion-Value",
Name = "EXAMPLE-name-Value",
Description = "EXAMPLE-description-Value",
ApplicationVersion = 513,
ObjectStatus = 245,
Identifier = "EXAMPLE-identifier-Value",
ParentRef = new Oci.DataintegrationService.Models.ParentReference
{
Parent = "EXAMPLE-parent-Value",
RootDocId = "ocid1.test.oc1..<unique_ID>EXAMPLE-rootDocId-Value"
},
ObjectVersion = 464,
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("01/09/2023 00:24:00"),
TimeUpdated = DateTime.Parse("11/29/2038 11:15:09"),
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_D6z32",
"EXAMPLE_VALUE_byvmKeNYUVEycWew30TA"
}
},
RegistryVersion = 493,
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 = 663
}
}
}
},
DisplayName = "EXAMPLE-displayName-Value",
FreeformTags = new Dictionary<string, string>()
{
{
"EXAMPLE_KEY_jZT4f",
"EXAMPLE_VALUE_V55gC5fh2LLnP8xZcAPc"
}
},
DefinedTags = new Dictionary<string, Dictionary<string, Object>>()
{
{
"EXAMPLE_KEY_3j49l",
new Dictionary<string, Object>()
{
{
"EXAMPLE_KEY_Mmm98",
"EXAMPLE--Value"
}
}
}
},
LifecycleState = Oci.DataintegrationService.Models.UpdateApplicationDetails.LifecycleStateEnum.Creating
};
var updateApplicationRequest = new Oci.DataintegrationService.Requests.UpdateApplicationRequest
{
WorkspaceId = "ocid1.test.oc1..<unique_ID>EXAMPLE-workspaceId-Value",
ApplicationKey = "EXAMPLE-applicationKey-Value",
UpdateApplicationDetails = updateApplicationDetails,
IfMatch = "EXAMPLE-ifMatch-Value",
OpcRequestId = "82SZ6I0SIBJ7OBZD0PAP<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 DataIntegrationClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateApplication(updateApplicationRequest);
// Retrieve value from the response.
var id = response.Application.Id;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateApplication Failed with {e.Message}");
throw e;
}
}
}
}