// 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 capacitymanagement from "oci-capacitymanagement";
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 capacitymanagement.CapacityManagementClient({ authenticationDetailsProvider: provider });

     // Create a request and dependent object(s).
	const  createOccCapacityRequestDetails = {
		compartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
		occAvailabilityCatalogId: "ocid1.test.oc1..<unique_ID>EXAMPLE-occAvailabilityCatalogId-Value",
		namespace: capacitymanagement.models.Namespace.Compute,
		region: "EXAMPLE-region-Value",
		displayName: "EXAMPLE-displayName-Value",
		requestType: capacitymanagement.requests.OccCapacityRequest.RequestType.Transfer,
		description: "EXAMPLE-description-Value",
		freeformTags: {
			EXAMPLE_KEY_Tk4UB :"EXAMPLE_VALUE_kXmyT4ShssSPI6wN6RAe"
			},
		definedTags: {
			EXAMPLE_KEY_JGL5n :{
				EXAMPLE_KEY_roF0J :"EXAMPLE--Value"
				}
			},
		lifecycleDetails: "EXAMPLE-lifecycleDetails-Value",
		availabilityDomain: "EXAMPLE-availabilityDomain-Value",
		dateExpectedCapacityHandover: new Date("Sat Dec 26 05:06:12 UTC 2037"),
		requestState: capacitymanagement.models.CreateOccCapacityRequestDetails.RequestState.Submitted,
		details: [{
				resourceType: "EXAMPLE-resourceType-Value",
				workloadType: "EXAMPLE-workloadType-Value",
				sourceWorkloadType: "EXAMPLE-sourceWorkloadType-Value",
				expectedHandoverQuantity: 52,
				dateExpectedHandover: new Date("Fri May 24 04:05:41 UTC 2013"),
				actualHandoverQuantity: 381,
				dateActualHandover: new Date("Thu Oct 27 23:07:21 UTC 2044"),
				availabilityDomain: "EXAMPLE-availabilityDomain-Value",
				associatedOccHandoverResourceBlockList: [{
						occHandoverResourceBlockId: "ocid1.test.oc1..<unique_ID>EXAMPLE-occHandoverResourceBlockId-Value",
						handoverQuantity: 409,

						}
						],
				resourceName: "EXAMPLE-resourceName-Value",
				demandQuantity: 332,

				}
				],

		}

	const createOccCapacityRequestRequest: capacitymanagement.requests.CreateOccCapacityRequestRequest = { 
	createOccCapacityRequestDetails: createOccCapacityRequestDetails,
	opcRetryToken: "EXAMPLE-opcRetryToken-Value",
	opcRequestId: "B3Y9NEW05UCWG1KVQ1PX<unique_ID>",

		}; 


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