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

     // Create a request and dependent object(s).
	const  updateOfferDetails = {
		displayName: "EXAMPLE-displayName-Value",
		buyerCompartmentId: "ocid1.test.oc1..<unique_ID>EXAMPLE-buyerCompartmentId-Value",
		description: "EXAMPLE-description-Value",
		internalNotes: "EXAMPLE-internalNotes-Value",
		timeStartDate: new Date("Sat Dec 09 17:44:56 UTC 2045"),
		duration: "EXAMPLE-duration-Value",
		timeAcceptBy: new Date("Thu Jun 23 05:25:27 UTC 2033"),
		pricing: {
			currencyType: "Y0P",
			totalAmount: 182,
			billingCycle: marketplaceprivateoffer.models.Pricing.BillingCycle.OneTime,

			}
,
		buyerInformation: {
			companyName: "EXAMPLE-companyName-Value",
			noteToBuyer: "EXAMPLE-noteToBuyer-Value",
			primaryContact: {
				firstName: "EXAMPLE-firstName-Value",
				lastName: "EXAMPLE-lastName-Value",
				email: "EXAMPLE-email-Value",

				}
,
			additionalContacts: [{
					firstName: "EXAMPLE-firstName-Value",
					lastName: "EXAMPLE-lastName-Value",
					email: "EXAMPLE-email-Value",

					}
					],

			}
,
		sellerInformation: {
			primaryContact: {
				firstName: "EXAMPLE-firstName-Value",
				lastName: "EXAMPLE-lastName-Value",
				email: "EXAMPLE-email-Value",

				}
,
			additionalContacts: [{
					firstName: "EXAMPLE-firstName-Value",
					lastName: "EXAMPLE-lastName-Value",
					email: "EXAMPLE-email-Value",

					}
					],

			}
,
		resourceBundles: [{
				type: marketplaceprivateoffer.models.ResourceBundle.Type.Listing,
				quantity: 193,
				unitOfMeasurement: marketplaceprivateoffer.models.ResourceBundle.UnitOfMeasurement.InstancePerHour,
				resourceIds: ["EXAMPLE--Value"						],

				}
				],
		customFields: [{
				key: "EXAMPLE-key-Value",
				value: "EXAMPLE-value-Value",

				}
				],
		freeformTags: {
			EXAMPLE_KEY_iEyHQ :"EXAMPLE_VALUE_eBnjGnZXL4mKwCs5Qief"
			},
		definedTags: {
			EXAMPLE_KEY_tDLzL :{
				EXAMPLE_KEY_idXCs :"EXAMPLE--Value"
				}
			},

		}

	const updateOfferRequest: marketplaceprivateoffer.requests.UpdateOfferRequest = { 
	offerId: "ocid1.test.oc1..<unique_ID>EXAMPLE-offerId-Value",
	updateOfferDetails: updateOfferDetails,
	ifMatch: "EXAMPLE-ifMatch-Value",
	opcRequestId: "JFFCO8KTKHWMCEJIRPYX<unique_ID>",

		}; 


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