

Sono disponibili altri esempi AWS SDK nel repository [AWS Doc SDK](https://github.com/awsdocs/aws-doc-sdk-examples) 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à.

# Far scadere un'offerta privata utilizzando un SDK AWS
<a name="marketplace-catalog_example_marketplace-catalog_ExpirePrivateOffer_section"></a>

Gli esempi di codice seguenti mostrano come impostare la data di scadenza di un’offerta privata su una data precedente in modo che gli acquirenti non vedano più l’offerta.

------
#### [ Java ]

**SDK per Java 2.x**  
 C'è altro da fare. GitHub Trova l’esempio completo e scopri come eseguire la configurazione e l’esecuzione nel [repository di esempi di codice dell’API Marketplace AWS](https://github.com/aws-samples/aws-marketplace-reference-code/tree/main/java#catalog-api-reference-code). 
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": "UpdateAvailability",
            "Entity": {
                "Type": "Offer@1.0",
                "Identifier": "offer-1111111111111"
            },
            "DetailsDocument": {
                "AvailabilityEndDate": "2023-01-01"
            }
        }
    ]
}
```
+  Per i dettagli sull'API, consulta la [StartChangeSet](https://docs.aws.amazon.com/goto/SdkForJavaV2/marketplace-catalog-2018-09-17/StartChangeSet)sezione *AWS SDK for Java 2.x API Reference*. 

------
#### [ Python ]

**SDK per Python (Boto3)**  
 C'è di più su GitHub. Trova l’esempio completo e scopri come eseguire la configurazione e l’esecuzione nel [repository di esempi di codice dell’API Marketplace AWS](https://github.com/aws-samples/aws-marketplace-reference-code/blob/main/python##catalog-api-reference-code). 

```
{
    "Catalog": "AWSMarketplace",
    "ChangeSet": [
        {
            "ChangeType": "CreateOffer",
            "Entity": {
                "Type": "Offer@1.0"
            },
            "DetailsDocument": {
                "ProductId": "prod-1111111111111",
                "Name": "Test Private Offer"
            }
        }
    ]
}
```
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 create “draft” Private Offer
for any AMI or SAAS product type that can be reviewed internally
before publishing to buyers
CAPI-30
"""

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, "Private offer for AMI product")


if __name__ == "__main__":
    main()
```
+  Per i dettagli sull'API, consulta [StartChangeSet AWS](https://docs.aws.amazon.com/goto/boto3/marketplace-catalog-2018-09-17/StartChangeSet)*SDK for Python (Boto3) API Reference*. 

------