// 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.Threading.Tasks;
using Oci.DtsService;
using Oci.Common;
using Oci.Common.Auth;
namespace Oci.Sdk.DotNet.Example.Dts
{
public class UpdateTransferApplianceExample
{
public static async Task Main()
{
// Create a request and dependent object(s).
var updateTransferApplianceDetails = new Oci.DtsService.Models.UpdateTransferApplianceDetails
{
LifecycleState = Oci.DtsService.Models.UpdateTransferApplianceDetails.LifecycleStateEnum.ReturnLabelAvailable,
CustomerShippingAddress = new Oci.DtsService.Models.ShippingAddress
{
Addressee = "EXAMPLE-addressee-Value",
CareOf = "EXAMPLE-careOf-Value",
Address1 = "EXAMPLE-address1-Value",
Address2 = "EXAMPLE-address2-Value",
Address3 = "EXAMPLE-address3-Value",
Address4 = "EXAMPLE-address4-Value",
CityOrLocality = "EXAMPLE-cityOrLocality-Value",
StateOrRegion = "EXAMPLE-stateOrRegion-Value",
Zipcode = "EXAMPLE-zipcode-Value",
Country = "EXAMPLE-country-Value",
PhoneNumber = "EXAMPLE-phoneNumber-Value",
Email = "EXAMPLE-email-Value"
},
ExpectedReturnDate = DateTime.Parse("09/26/2016 10:58:01"),
PickupWindowStartTime = DateTime.Parse("03/18/2045 08:23:14"),
PickupWindowEndTime = DateTime.Parse("04/19/2001 14:35:26"),
MinimumStorageCapacityInTerabytes = 685
};
var updateTransferApplianceRequest = new Oci.DtsService.Requests.UpdateTransferApplianceRequest
{
Id = "ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
TransferApplianceLabel = "EXAMPLE-transferApplianceLabel-Value",
UpdateTransferApplianceDetails = updateTransferApplianceDetails,
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 TransferApplianceClient(provider, new ClientConfiguration()))
{
var response = await client.UpdateTransferAppliance(updateTransferApplianceRequest);
// Retrieve value from the response.
var labelValue = response.TransferAppliance.Label;
}
}
catch (Exception e)
{
Console.WriteLine($"UpdateTransferAppliance Failed with {e.Message}");
throw e;
}
}
}
}