# 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).
require 'date'
require '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::ConfigFileLoader.load_config
# Initialize service client with default config file
marketplace_private_offer_client =
OCI::MarketplacePrivateOffer::OfferClient.new(config: 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(
OCI::MarketplacePrivateOffer::Models::CreateOfferDetails.new(
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.parse('2010-08-29T03:38:13.585Z'),
duration: 'EXAMPLE-duration-Value',
time_accept_by: DateTime.parse('2022-05-04T08:53:25.188Z'),
pricing:
OCI::MarketplacePrivateOffer::Models::Pricing.new(
currency_type: 'LJf', total_amount: 896, billing_cycle: 'ONE_TIME'
),
buyer_information:
OCI::MarketplacePrivateOffer::Models::BuyerInformation.new(
company_name: 'EXAMPLE-companyName-Value',
note_to_buyer: 'EXAMPLE-noteToBuyer-Value',
primary_contact:
OCI::MarketplacePrivateOffer::Models::Contact.new(
first_name: 'EXAMPLE-firstName-Value',
last_name: 'EXAMPLE-lastName-Value',
email: 'EXAMPLE-email-Value'
),
additional_contacts: [
OCI::MarketplacePrivateOffer::Models::Contact.new(
first_name: 'EXAMPLE-firstName-Value',
last_name: 'EXAMPLE-lastName-Value',
email: 'EXAMPLE-email-Value'
)
]
),
seller_information:
OCI::MarketplacePrivateOffer::Models::SellerInformation.new(
primary_contact:
OCI::MarketplacePrivateOffer::Models::Contact.new(
first_name: 'EXAMPLE-firstName-Value',
last_name: 'EXAMPLE-lastName-Value',
email: 'EXAMPLE-email-Value'
),
additional_contacts: [
OCI::MarketplacePrivateOffer::Models::Contact.new(
first_name: 'EXAMPLE-firstName-Value',
last_name: 'EXAMPLE-lastName-Value',
email: 'EXAMPLE-email-Value'
)
]
),
resource_bundles: [
OCI::MarketplacePrivateOffer::Models::ResourceBundle.new(
type: 'LISTING',
quantity: 540,
unit_of_measurement: 'OCPU_PER_HOUR',
resource_ids: %w[EXAMPLE--Value]
)
],
custom_fields: [
OCI::MarketplacePrivateOffer::Models::CustomField.new(
key: 'EXAMPLE-key-Value', value: 'EXAMPLE-value-Value'
)
],
freeform_tags: {
'EXAMPLE_KEY_hWMce' => 'EXAMPLE_VALUE_JirpYXV3v5NoHZI6hVku'
},
defined_tags: {
'EXAMPLE_KEY_Wg5eo' => { 'EXAMPLE_KEY_h44LQ' => 'EXAMPLE--Value' }
}
)
)
# Get the data from response
puts "#{create_offer_response.data}"