

文件 AWS 開發套件範例 GitHub 儲存庫中有更多可用的 [AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)。

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 使用 AWS SDKs的 AWS Marketplace 目錄 API 程式碼範例
<a name="marketplace-catalog_code_examples"></a>

下列程式碼範例示範如何搭配 AWS 軟體開發套件 (SDK) 使用 AWS Marketplace 目錄 API。

**其他資源**
+  **[AWS Marketplace Catalog API 賣方指南](https://docs.aws.amazon.com/marketplace/latest/userguide/what-is-marketplace.html)** – 有關 AWS Marketplace Catalog API 的詳細資訊。
+ **[AWS Marketplace Catalog API 參考](https://docs.aws.amazon.com/marketplace-catalog/latest/api-reference/welcome.html)** – 所有可用 AWS Marketplace Catalog API 動作的詳細資訊。
+ **[AWS 開發人員中心](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23)** – 您可以依類別或全文搜尋篩選的程式碼範例。
+ **[AWS SDK 範例](https://github.com/awsdocs/aws-doc-sdk-examples)** – GitHub 儲存庫使用慣用語言的完整程式碼。包含設定和執行程式碼的指示。

**Contents**
+ [AMI 產品](marketplace-catalog_code_examples_ami_products.md)
  + [將維度新增至現有的 AMI 產品，並更新優惠定價條款](marketplace-catalog_example_marketplace-catalog_AddDimensionToAmiProductAndSetPriceInPublicOffer_section.md)
  + [新增部署 AMI 產品的區域](marketplace-catalog_example_marketplace-catalog_AddRegionExistingAmiProduct_section.md)
  + [建立公有或有限 AMI 產品，以及依時數每年定價的公開優惠方案](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyAnnualPricing_section.md)
  + [建立公有或有限 AMI 產品，以及依時數每月定價的公開優惠方案](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyMonthlyPricing_section.md)
  + [建立公有或有限 AMI 產品，以及依時數定價的公開優惠方案](marketplace-catalog_example_marketplace-catalog_CreateLimitedAmiProductAndPublicOfferWithHourlyPricing_section.md)
  + [使用公開優惠草案建立 AMI 產品草案](marketplace-catalog_example_marketplace-catalog_CreateDraftAmiProductWithDraftPublicOffer_section.md)
  + [限制部署 AMI 產品的區域](marketplace-catalog_example_marketplace-catalog_RestrictRegionExistingAmiProduct_section.md)
  + [限制產品可見性](marketplace-catalog_example_marketplace-catalog_RestrictExistingAmi_section.md)
  + [指定是否在新區域部署 AMI 資產](marketplace-catalog_example_marketplace-catalog_UpdateFutureRegionSupport_section.md)
+ [通路合作夥伴優惠](marketplace-catalog_code_examples_channel_partner_offers.md)
  + [為任何產品類型建立 CPPO 草案](marketplace-catalog_example_marketplace-catalog_CreateDraftCppoOffer_section.md)
  + [建立具有合約定價的轉售授權替代私有優惠](marketplace-catalog_example_marketplace-catalog_CreateResaleAuthorizationReplacementOffer_section.md)
  + [列出通路合作夥伴建立的所有 CPPO](marketplace-catalog_example_marketplace-catalog_ListAllCppoOffers_section.md)
  + [列出通路合作夥伴可用的所有共享轉售授權](marketplace-catalog_example_marketplace-catalog_ListAllSharedResaleAuthorizations_section.md)
  + [發佈 CPPO 並附加買方 EULA](marketplace-catalog_example_marketplace-catalog_PublishCppoEula_section.md)
  + [使用一次性轉售授權和更新價格標記來發佈 CPPO](marketplace-catalog_example_marketplace-catalog_PublishOneTimeCppoWithPriceMarkup_section.md)
  + [發佈 CPPO 草案並更新價格標記](marketplace-catalog_example_marketplace-catalog_PublishCppoPriceMarkup_section.md)
  + [更新 CPPO 的到期日期](marketplace-catalog_example_marketplace-catalog_UpdateCppoExpiryDate_section.md)
+ [容器產品](marketplace-catalog_code_examples_container_products.md)
  + [建立具有公開優惠草案的容器產品草案](marketplace-catalog_example_marketplace-catalog_CreateDraftContainerProductWithDraftPublicOffer_section.md)
  + [使用公開優惠和合約定價建立有限的容器產品](marketplace-catalog_example_marketplace-catalog_CreateLimitedContainerProductPublicOffer_section.md)
+ [實體](marketplace-catalog_code_examples_entities.md)
  + [描述單一呼叫中的所有實體](marketplace-catalog_example_marketplace-catalog_BatchDescribeEntities_section.md)
  + [列出並描述與產品相關聯的所有優惠](marketplace-catalog_example_marketplace-catalog_ListProductOffers_section.md)
+ [Offers](marketplace-catalog_code_examples_offers.md)
  + [建立 SaaS 產品的自訂維度並建立私有優惠](marketplace-catalog_example_marketplace-catalog_CreateSaasProductCustomDimensionAndPrivateOffer_section.md)
  + [建立 AMI 或 SaaS 產品的私有優惠草案](marketplace-catalog_example_marketplace-catalog_CreateDraftPrivateOffer_section.md)
  + [為 SaaS 產品建立具有合約和依用量計費定價的私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractWithPayAsYouGoPricingForSaasProduct_section.md)
  + [為 SaaS 產品建立具有合約定價和彈性付費排程的私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingWithFlexiblePaymentScheduleForSaasProduct_section.md)
  + [使用容器產品的合約定價建立私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingForContainerProduct_section.md)
  + [使用 AMI 產品的合約定價建立私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithContractPricingForAmiProduct_section.md)
  + [為 AMI 產品建立具有依時數每年定價和彈性付費排程的私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyAnnualPricingAndFlexiblePaymentScheduleForAmiProduct_section.md)
  + [使用 AMI 產品的依時數每年定價建立私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyAnnualPricingForAmiProduct_section.md)
  + [使用 AMI 產品的依時數定價建立私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithHourlyPricingForAmiProduct_section.md)
  + [使用 SaaS 產品的訂閱定價建立私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithSubscriptionPricingForSaasProduct_section.md)
  + [為 SaaS 產品建立分級定價的私有優惠](marketplace-catalog_example_marketplace-catalog_CreatePrivateOfferWithTieredContractPricingForSaasProduct_section.md)
  + [使用 SaaS 產品的訂閱定價建立公開免費試用優惠](marketplace-catalog_example_marketplace-catalog_CreatePublicFreeTrialOfferWithSubscriptionPricingForSaasProduct_section.md)
  + [使用合約定價建立替代私有優惠](marketplace-catalog_example_marketplace-catalog_CreateReplacementPrivateOfferWithContractPricing_section.md)
  + [描述公開優惠](marketplace-catalog_example_marketplace-catalog_DescribeOffer_section.md)
  + [使私有優惠草案過期](marketplace-catalog_example_marketplace-catalog_ExpirePrivateOffer_section.md)
  + [列出所有私有優惠](marketplace-catalog_example_marketplace-catalog_ListAllPrivateOffers_section.md)
  + [列出特定產品 ID 的已發行公開優惠和私有優惠](marketplace-catalog_example_marketplace-catalog_ListProductPublicOrPrivateReleasedOffers_section.md)
  + [更新優惠以套用具有隨需依用量計費定價的合約](marketplace-catalog_example_marketplace-catalog_UpdateOfferWithContractAndPayAsYouGoPricing_section.md)
  + [更新優惠以套用依時數每年定價](marketplace-catalog_example_marketplace-catalog_UpdateOfferWithHourlyAnnualPricing_section.md)
  + [更新優惠方案，將目標定位到特定地理區域](marketplace-catalog_example_marketplace-catalog_UpdateOfferTargeting_section.md)
  + [更新公開優惠的名稱和描述](marketplace-catalog_example_marketplace-catalog_UpdateOfferNameAndDescription_section.md)
  + [更新優惠方案的 EULA](marketplace-catalog_example_marketplace-catalog_UpdateEula_section.md)
  + [將私有優惠的到期日期更新為未來日期](marketplace-catalog_example_marketplace-catalog_UpdateOfferExpirationDateOfPrivateOffer_section.md)
  + [更新 SaaS 產品的公開免費試用優惠的免費試用期的時間範圍](marketplace-catalog_example_marketplace-catalog_UpdateFreeTrialDurationOfPublicFreeTrialOfferForSaasProduct_section.md)
  + [更新優惠的退款政策](marketplace-catalog_example_marketplace-catalog_UpdateRefundPolicy_section.md)
+ [產品](marketplace-catalog_code_examples_products.md)
  + [描述 AMI、SaaS 或容器產品](marketplace-catalog_example_marketplace-catalog_DescribeProduct_section.md)
  + [列出所有 AMI、SaaS 或容器產品和相關聯的公開優惠](marketplace-catalog_example_marketplace-catalog_ListProducts_section.md)
+ [轉售授權](marketplace-catalog_code_examples_resale_authorization.md)
  + [建立轉售授權草案](marketplace-catalog_example_marketplace-catalog_DraftResaleauthAllproducttype_section.md)
  + [描述轉售授權](marketplace-catalog_example_marketplace-catalog_DescribeResaleAuthorization_section.md)
  + [使用私有優惠發佈一次性轉售授權](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthPrivateoffer_section.md)
  + [發佈具有到期日期的可多次使用轉售授權](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCppo_section.md)
  + [發佈具有到期日期和 EULA 的可多次使用轉售授權](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCustomEula_section.md)
  + [發佈具有到期日期和經銷商合約文件的可多次使用轉售授權](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthExpirydateCustomresellerContractdoc_section.md)
  + [發佈具有到期日的可多次使用轉售授權，並新增特定的買方帳戶](marketplace-catalog_example_marketplace-catalog_PublishMultiuseResaleAuthorizationExpirydateSpecificBuyer_section.md)
  + [發佈沒有到期日期的可多次使用轉售授權](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCppo_section.md)
  + [發佈不具到期日期和 EULA 的可多次使用轉售授權](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCustomEula_section.md)
  + [發佈不具到期日期和經銷商合約文件的可多次使用轉售授權](marketplace-catalog_example_marketplace-catalog_MultiuseResaleauthNoExpirydateCustomresellerContractdoc_section.md)
  + [發佈不具到期日的可多次使用轉售授權，並新增特定的買方帳戶](marketplace-catalog_example_marketplace-catalog_PublishMultiuseResaleAuthorizationNoExpirydateSpecificBuyer_section.md)
  + [發佈一次性轉售授權，並新增彈性付費排程](marketplace-catalog_example_marketplace-catalog_PublishOnetimeResaleAuthorizationFlexiblePayment_section.md)
  + [發佈一次性轉售授權，並新增 EULA](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthCustomEula_section.md)
  + [發佈一次性轉售授權，並新增特定的買方帳戶](marketplace-catalog_example_marketplace-catalog_PublishOnetimeResaleAuthorizationSpecificBuyer_section.md)
  + [發佈一次性轉售授權，並新增經銷商合約文件](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthCustomresellerContractdoc_section.md)
  + [發佈一次性轉售授權，並註明是否為續約](marketplace-catalog_example_marketplace-catalog_OnetimeResaleauthRenewal_section.md)
  + [限制轉售授權](marketplace-catalog_example_marketplace-catalog_RestrictResaleAuthorization_section.md)
  + [更新一次性或可多次使用轉售授權的名稱和描述](marketplace-catalog_example_marketplace-catalog_UpdateUnpublishedResaleAuthorization_section.md)
+ [SaaS 產品](marketplace-catalog_code_examples_saas_products.md)
  + [使用公開優惠草案建立 SaaS 產品草案](marketplace-catalog_example_marketplace-catalog_CreateDraftSaasProductWithDraftPublicOffer_section.md)
  + [使用合約定價，建立公有或有限的 SaaS 產品和公有優惠](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithContractPricing_section.md)
  + [使用依用量計費定價，建立公有或有限 SaaS 產品和公有優惠](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithContractWithPayAsYouGoPricing_section.md)
  + [使用訂閱定價，建立公有或有限的 SaaS 產品和公有優惠](marketplace-catalog_example_marketplace-catalog_CreateLimitedSaasProductAndPublicOfferWithSubscriptionPricing_section.md)
  + [發佈 SaaS 產品和相關聯的公開優惠](marketplace-catalog_example_marketplace-catalog_PublishSaasProductPublicOffer_section.md)
  + [從現有草案發佈 SaaS 產品和相關聯的公開優惠](marketplace-catalog_example_marketplace-catalog_PublishExistingSaas_section.md)
  + [更新 AMI 或 SaaS 產品的維度](marketplace-catalog_example_marketplace-catalog_UpdateNameDimensionSaasProduct_section.md)
+ [公用程式](marketplace-catalog_code_examples_utilities.md)
  + [啟動變更集的公用程式](marketplace-catalog_example_marketplace-catalog_ChangeSetUtilities_section.md)