# 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_publisher_client = oci.marketplace_publisher.OfferClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_offer_response = marketplace_publisher_client.update_offer(
offer_id="ocid1.test.oc1..<unique_ID>EXAMPLE-offerId-Value",
update_offer_details=oci.marketplace_publisher.models.UpdateOfferDetails(
display_name="EXAMPLE-displayName-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(
"2029-08-04T07:47:45.962Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
duration="EXAMPLE-duration-Value",
time_accept_by=datetime.strptime(
"2022-04-22T06:54:56.494Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
pricing=oci.marketplace_publisher.models.Pricing(
currency_type="y66",
total_amount=229,
billing_cycle="ONE_TIME"),
buyer_information=oci.marketplace_publisher.models.BuyerInformation(
company_name="EXAMPLE-companyName-Value",
note_to_buyer="EXAMPLE-noteToBuyer-Value",
primary_contact=oci.marketplace_publisher.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value"),
additional_contacts=[
oci.marketplace_publisher.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value")]),
seller_information=oci.marketplace_publisher.models.SellerInformation(
primary_contact=oci.marketplace_publisher.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value"),
additional_contacts=[
oci.marketplace_publisher.models.Contact(
first_name="EXAMPLE-firstName-Value",
last_name="EXAMPLE-lastName-Value",
email="EXAMPLE-email-Value")]),
resource_bundles=[
oci.marketplace_publisher.models.ResourceBundle(
type="LISTING",
quantity=195,
unit_of_measurement="INSTANCE_PER_HOUR",
resource_ids=["EXAMPLE--Value"])],
custom_fields=[
oci.marketplace_publisher.models.CustomField(
key="EXAMPLE-key-Value",
value="EXAMPLE-value-Value")],
freeform_tags={
'EXAMPLE_KEY_u6OhW': 'EXAMPLE_VALUE_Pt6HJHaY2Jy0UAswSkEI'},
defined_tags={
'EXAMPLE_KEY_PZw0L': {
'EXAMPLE_KEY_TlPxM': 'EXAMPLE--Value'}}),
if_match="EXAMPLE-ifMatch-Value",
opc_request_id="NWS5GNN39EQBZGOOZOCN<unique_ID>")
# Get the data from response
print(update_offer_response.data)