# 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
osp_gateway_client = oci.osp_gateway.SubscriptionServiceClient(config)
# Send the request to service, some parameters are not required, see API
# doc for more info
update_subscription_response = osp_gateway_client.update_subscription(
subscription_id="ocid1.test.oc1..<unique_ID>EXAMPLE-subscriptionId-Value",
osp_home_region="EXAMPLE-ospHomeRegion-Value",
compartment_id="ocid1.test.oc1..<unique_ID>EXAMPLE-compartmentId-Value",
update_subscription_details=oci.osp_gateway.models.UpdateSubscriptionDetails(
subscription=oci.osp_gateway.models.Subscription(
subscription_plan_number="EXAMPLE-subscriptionPlanNumber-Value",
id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
plan_type="PAYG",
time_start=datetime.strptime(
"2017-10-13T08:05:28.918Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
ship_to_cust_acct_site_id="ocid1.test.oc1..<unique_ID>EXAMPLE-shipToCustAcctSiteId-Value",
ship_to_cust_acct_role_id="ocid1.test.oc1..<unique_ID>EXAMPLE-shipToCustAcctRoleId-Value",
bill_to_cust_account_id="ocid1.test.oc1..<unique_ID>EXAMPLE-billToCustAccountId-Value",
is_intent_to_pay=False,
currency_code="EXAMPLE-currencyCode-Value",
gsi_org_code="EXAMPLE-gsiOrgCode-Value",
language_code="EXAMPLE-languageCode-Value",
organization_id="ocid1.test.oc1..<unique_ID>EXAMPLE-organizationId-Value",
upgrade_state="ERROR",
upgrade_state_details="TAX_ERROR",
account_type="CORPORATE_SUBMITTED",
tax_info=oci.osp_gateway.models.TaxInfo(
tax_payer_id="ocid1.test.oc1..<unique_ID>EXAMPLE-taxPayerId-Value",
tax_reg_number="EXAMPLE-taxRegNumber-Value",
no_tax_reason_code="EXAMPLE-noTaxReasonCode-Value",
no_tax_reason_code_details="EXAMPLE-noTaxReasonCodeDetails-Value",
tax_cnpj="EXAMPLE-taxCnpj-Value",
giro="EXAMPLE-giro-Value"),
payment_options=[
oci.osp_gateway.models.CreditCardPaymentOption(
payment_method="CREDIT_CARD",
wallet_instrument_id="ocid1.test.oc1..<unique_ID>EXAMPLE-walletInstrumentId-Value",
wallet_transaction_id="ocid1.test.oc1..<unique_ID>EXAMPLE-walletTransactionId-Value",
credit_card_type="VISA",
last_digits="EXAMPLE-lastDigits-Value",
name_on_card="EXAMPLE-nameOnCard-Value",
time_expiration=datetime.strptime(
"2035-07-27T18:42:42.119Z",
"%Y-%m-%dT%H:%M:%S.%fZ"))],
payment_gateway=oci.osp_gateway.models.PaymentGateway(
merchant_defined_data=oci.osp_gateway.models.MerchantDefinedData(
promo_type="EXAMPLE-promoType-Value",
cloud_account_name="EXAMPLE-cloudAccountName-Value")),
billing_address=oci.osp_gateway.models.Address(
address_key="EXAMPLE-addressKey-Value",
line1="EXAMPLE-line1-Value",
line2="EXAMPLE-line2-Value",
line3="EXAMPLE-line3-Value",
line4="EXAMPLE-line4-Value",
street_name="EXAMPLE-streetName-Value",
street_number="EXAMPLE-streetNumber-Value",
city="EXAMPLE-city-Value",
county="EXAMPLE-county-Value",
country="EXAMPLE-country-Value",
province="EXAMPLE-province-Value",
postal_code="EXAMPLE-postalCode-Value",
state="EXAMPLE-state-Value",
email_address="EXAMPLE-emailAddress-Value",
company_name="EXAMPLE-companyName-Value",
first_name="EXAMPLE-firstName-Value",
middle_name="EXAMPLE-middleName-Value",
last_name="EXAMPLE-lastName-Value",
phone_country_code="EXAMPLE-phoneCountryCode-Value",
phone_number="EXAMPLE-phoneNumber-Value",
job_title="EXAMPLE-jobTitle-Value",
department_name="EXAMPLE-departmentName-Value",
internal_number="EXAMPLE-internalNumber-Value",
contributor_class="EXAMPLE-contributorClass-Value",
state_inscription="EXAMPLE-stateInscription-Value",
municipal_inscription="EXAMPLE-municipalInscription-Value"),
time_plan_upgrade=datetime.strptime(
"2014-06-08T13:14:37.298Z",
"%Y-%m-%dT%H:%M:%S.%fZ"),
time_personal_to_corporate_conv=datetime.strptime(
"2034-04-25T08:56:36.635Z",
"%Y-%m-%dT%H:%M:%S.%fZ")),
email="EXAMPLE-email-Value"),
opc_request_id="SCJE32OVPYWWFMVKH1FX<unique_ID>",
if_match="EXAMPLE-ifMatch-Value")
# Get the data from response
print(update_subscription_response.data)