# 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 oci
from datetime import datetime

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
capacity_management_client = oci.capacity_management.CapacityManagementClient(
    config)


# Send the request to service, some parameters are not required, see API
# doc for more info
create_occ_capacity_request_response = capacity_management_client.create_occ_capacity_request(
    create_occ_capacity_request_details=oci.capacity_management.models.CreateOccCapacityRequestDetails(
        compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
        namespace="COMPUTE",
        region="EXAMPLE-region-Value",
        display_name="EXAMPLE-displayName-Value",
        date_expected_capacity_handover=datetime.strptime(
            "2013-10-29T17:19:07.117Z",
            "%Y-%m-%dT%H:%M:%S.%fZ"),
        details=[
            oci.capacity_management.models.OccCapacityRequestBaseDetails(
                resource_type="EXAMPLE-resourceType-Value",
                workload_type="EXAMPLE-workloadType-Value",
                resource_name="EXAMPLE-resourceName-Value",
                demand_quantity=555,
                source_workload_type="EXAMPLE-sourceWorkloadType-Value",
                expected_handover_quantity=206,
                date_expected_handover=datetime.strptime(
                    "2045-07-02T20:31:44.043Z",
                    "%Y-%m-%dT%H:%M:%S.%fZ"),
                actual_handover_quantity=347,
                date_actual_handover=datetime.strptime(
                    "2033-02-06T10:38:20.675Z",
                    "%Y-%m-%dT%H:%M:%S.%fZ"),
                availability_domain="EXAMPLE-availabilityDomain-Value",
                associated_occ_handover_resource_block_list=[
                    oci.capacity_management.models.AssociatedOccHandoverResourceBlock(
                        occ_handover_resource_block_id="ocid1.test.oc1..<unique_ID>EXAMPLE-occHandoverResourceBlockId-Value",
                        handover_quantity=798)])],
        occ_availability_catalog_id="ocid1.test.oc1..<unique_ID>EXAMPLE-occAvailabilityCatalogId-Value",
        request_type="NEW",
        description="EXAMPLE-description-Value",
        freeform_tags={
            'EXAMPLE_KEY_uOn1i': 'EXAMPLE_VALUE_i9x3YczLSOw703cGDfiU'},
        defined_tags={
            'EXAMPLE_KEY_Hw9X4': {
                'EXAMPLE_KEY_Nz5t4': 'EXAMPLE--Value'}},
        lifecycle_details="EXAMPLE-lifecycleDetails-Value",
        availability_domain="EXAMPLE-availabilityDomain-Value",
        request_state="CREATED"),
    opc_retry_token="EXAMPLE-opcRetryToken-Value",
    opc_request_id="OPIG2HZM9JWKVII2QIQM<unique_ID>")

# Get the data from response
print(create_occ_capacity_request_response.data)