L'AWS Marketplace API Reference è stato ristrutturato. Per ulteriori informazioni sulle operazioni API supportate, consulta l'AWS Marketplace API Reference.
Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Aggiorna un'offerta per applicare il targeting a aree geografiche specifiche utilizzando unAWSSDK
Gli esempi di codice seguenti mostrano come aggiornare un’offerta per applicare il targeting ad aree geografiche specifiche.
- Java
-
- SDK per Java 2.x
-
Per eseguire questo esempio, passa il seguente set di modifiche JSON a RunChangesets in Utilità per l’avvio di un set di modifiche nella sezione Utilità.
{
"Catalog": "AWSMarketplace",
"ChangeSet": [
{
"ChangeType": "UpdateTargeting",
"Entity": {
"Type": "Offer@1.0",
"Identifier": "offer-1111111111111"
},
"DetailsDocument": {
"PositiveTargeting": {
"CountryCodes": [
"US",
"ES",
"FR",
"AU"
]
}
}
}
]
}
- Python
-
- SDK per Python (Boto3)
-
{
"Catalog": "AWSMarketplace",
"ChangeSet": [
{
"ChangeType": "UpdateTargeting",
"Entity": {
"Type": "Offer@1.0",
"Identifier": "offer-1111111111111"
},
"DetailsDocument": {
"PositiveTargeting": {
"CountryCodes": [
"US",
"ES",
"FR",
"AU"
]
}
}
}
]
}
Esegui questo script per avviare il set di modifiche. Le funzioni helper sono definite Utilità per l’avvio di un set di modifiche nella sezione Utilità.
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to use the AWS SDK for Python (Boto3) to update an offer to apply targeting to certain geographic regions.
CAPI-19
"""
import os
import utils.start_changeset as sc
import utils.stringify_details as sd
fname = "changeset.json"
change_set_file = os.path.join(os.path.dirname(__file__), fname)
change_set = sd.stringify_changeset(change_set_file)
def main():
sc.usage_demo(change_set, "Update offer targeting")
if __name__ == "__main__":
main()
Per un elenco completo delle guide per sviluppatori AWS SDK e degli esempi di codice, consulta. Utilizzo di questo servizio con unAWSSDK Questo argomento include anche informazioni su come iniziare e dettagli sulle versioni precedenti dell’SDK.