# 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).
from datetime import datetime
import oci
# 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
marketplace_private_offer_client = oci.marketplace_private_offer.OfferClient(
config)
# Send the request to service, some parameters are not required, see API
# doc for more info
create_offer_response = marketplace_private_offer_client.create_offer(
create_offer_details=oci.marketplace_private_offer.models.CreateOfferDetails(
display_name="EXAMPLE-displayName-Value",
seller_compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-sellerCompartmentId-Value",
buyer_compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-buyerCompartmentId-Value",
description="EXAMPLE-description-Value",
internal_notes="EXAMPLE-internalNotes-Value",
time_start_date=datetime.strptime(
"2035-03-04T01:39:43.685Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
duration="EXAMPLE-duration-Value",
time_accept_by=datetime.strptime(
"2004-07-23T06:38:12.134Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
pricing=oci.marketplace_private_offer.models.Pricing(
currency_type="qhE",
total_amount=537,
billing_cycle="ONE_TIME"),
buyer_information=oci.marketplace_private_offer.models.BuyerInformation(
company_name="EXAMPLE-companyName-Value",
note_to_buyer="EXAMPLE-noteToBuyer-Value",
primary_contact=oci.marketplace_private_offer.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value"),
additional_contacts=[
oci.marketplace_private_offer.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value")]),
seller_information=oci.marketplace_private_offer.models.SellerInformation(
primary_contact=oci.marketplace_private_offer.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value"),
additional_contacts=[
oci.marketplace_private_offer.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value")]),
resource_bundles=[
oci.marketplace_private_offer.models.ResourceBundle(
type="LISTING",
quantity=151,
unit_of_measurement="INSTANCES",
resource_ids=["EXAMPLE--Value"])],
custom_fields=[
oci.marketplace_private_offer.models.CustomField(
key="EXAMPLE-key-Value",
value="EXAMPLE-value-Value")],
freeform_tags={
'EXAMPLE_KEY_O3czV': 'EXAMPLE_VALUE_THPFo2t64YpWOtgCse6f'},
defined_tags={
'EXAMPLE_KEY_xaDNr': {
'EXAMPLE_KEY_VnAJG': 'EXAMPLE--Value'}}),
opc_retry_token="EXAMPLE-opcRetryToken-Value",
opc_request_id="PHGUDGKO9SUNJHHCGXIL<unique_ID>")
# Get the data from response
print(create_offer_response.data)