【问题标题】:How to call ResolveCustomer and GetEntitlements from aws-marketplace using aws-sdk-go?如何使用 aws-sdk-go 从 aws-marketplace 调用 ResolveCustomer 和 GetEntitlements?
【发布时间】:2018-03-16 21:49:29
【问题描述】:

我需要使用 aws-sdk-go 调用 ResolveCustomer 和 GetEntitlements 服务。没有关于如何为此类调用配置 aws 客户端的代码示例。

有人可以帮忙看看 Go 代码示例吗?

如果有人对此类调用进行了单元测试,将会很有帮助;如何在 golang 中模拟 ResolveCustomer 和 GetEntitlements API 调用?

【问题讨论】:

    标签: aws-sdk-go aws-marketplace


    【解决方案1】:

    MarketPlaceMetering 包的新函数https://docs.aws.amazon.com/sdk-for-go/api/service/marketplacemetering/#New 有一个创建 MarketPlaceMetering 客户端的简短示例。

    GetEntitlements 是 MarketplaceEntitlementService 包的一部分,因此请参阅该包的新函数 https://docs.aws.amazon.com/sdk-for-go/api/service/marketplaceentitlementservice/#New,了解创建 MarketPlaceEntitlementService 客户端的简短示例。

    有关配置 SDK 的更多信息,请参阅https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/making-requests.html

    请注意,这些都在 Go SDK 的 V1 版本中。随意浏览 V2 版本,https://github.com/aws/aws-sdk-go-v2,它在您创建客户端的方式上有一些不同(您应该能够从那里的 DynamoDB 示例中弄清楚)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-10
      • 2021-04-23
      • 2017-03-15
      • 1970-01-01
      • 2022-11-21
      相关资源
      最近更新 更多