Aggiorna un'offerta per applicare il targeting a aree geografiche specifiche utilizzando un SDK AWS - AWS Esempi di codice SDK

Sono disponibili altri esempi AWS SDK nel repository AWS Doc SDK Examples. GitHub

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 un SDK AWS

I seguenti esempi di codice mostrano come aggiornare un'offerta per applicare il targeting a aree geografiche specifiche.

Java
SDK per Java 2.x
Nota

C'è altro su. GitHub Trova l'esempio completo e scopri come configurarlo ed eseguirlo nel repository Marketplace AWS API Reference Code Library.

Per eseguire questo esempio, passa il seguente changeset JSON a RunChangesets in Utilities per avviare un changeset dalla sezione Utilities.

{ "Catalog": "AWSMarketplace", "ChangeSet": [ { "ChangeType": "UpdateTargeting", "Entity": { "Type": "Offer@1.0", "Identifier": "offer-1111111111111" }, "DetailsDocument": { "PositiveTargeting": { "CountryCodes": [ "US", "ES", "FR", "AU" ] } } } ] }
  • Per i dettagli sull'API, consulta API Reference. StartChangeSetAWS SDK for Java 2.x

Python
SDK per Python (Boto3)
Nota

C'è di più su GitHub. Trova l'esempio completo e scopri come configurarlo ed eseguirlo nel repository Marketplace AWS API Reference Code Library.

{ "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 changeset. Le funzioni di supporto sono definite in Utilities per avviare un changeset dalla sezione Utilities.

# 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 i dettagli sull'API, consulta StartChangeSet AWSSDK for Python (Boto3) API Reference.