Documentation ¶
Overview ¶
Package marketplacemetering provides a client for AWSMarketplace Metering.
Index ¶
Examples ¶
Constants ¶
const ServiceName = "metering.marketplace"
A ServiceName is the name of the service the client will make API calls to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MarketplaceMetering ¶
This reference provides descriptions of the low-level AWS Marketplace Metering Service API.
AWS Marketplace sellers can use this API to submit usage data for custom usage dimensions.
Submitting Metering Records
MeterUsage- Submits the metering record for a Marketplace product.
The service client's operations are safe to be used concurrently. It is not safe to mutate any of the client's properties though.
func New ¶
func New(p client.ConfigProvider, cfgs ...*aws.Config) *MarketplaceMetering
New creates a new instance of the MarketplaceMetering client with a session. If additional configuration is needed for the client instance use the optional aws.Config parameter to add your extra config.
Example:
// Create a MarketplaceMetering client from just a session. svc := marketplacemetering.New(mySession) // Create a MarketplaceMetering client with additional configuration svc := marketplacemetering.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
func (*MarketplaceMetering) MeterUsage ¶
func (c *MarketplaceMetering) MeterUsage(input *MeterUsageInput) (*MeterUsageOutput, error)
API to emit metering records. For identical requests, the API is idempotent. It simply returns the metering record ID.
Example ¶
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. package main import ( "bytes" "fmt" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/marketplacemetering" ) var _ time.Duration var _ bytes.Buffer func main() { svc := marketplacemetering.New(session.New()) params := &marketplacemetering.MeterUsageInput{ DryRun: aws.Bool(true), // Required ProductCode: aws.String("ProductCode"), // Required Timestamp: aws.Time(time.Now()), // Required UsageDimension: aws.String("UsageDimension"), // Required UsageQuantity: aws.Int64(1), // Required } resp, err := svc.MeterUsage(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. fmt.Println(err.Error()) return } // Pretty-print the response data. fmt.Println(resp) }
Output:
func (*MarketplaceMetering) MeterUsageRequest ¶
func (c *MarketplaceMetering) MeterUsageRequest(input *MeterUsageInput) (req *request.Request, output *MeterUsageOutput)
MeterUsageRequest generates a request for the MeterUsage operation.
type MeterUsageInput ¶
type MeterUsageInput struct { // Checks whether you have the permissions required for the action, but does // not make the request. If you have the permissions, the request returns DryRunOperation; // otherwise, it returns UnauthorizedException. DryRun *bool `type:"boolean" required:"true"` // Product code is used to uniquely identify a product in AWS Marketplace. The // product code should be the same as the one used during the publishing of // a new product. ProductCode *string `min:"1" type:"string" required:"true"` // Timestamp of the hour, recorded in UTC. The seconds and milliseconds portions // of the timestamp will be ignored. Timestamp *time.Time `type:"timestamp" timestampFormat:"unix" required:"true"` // It will be one of the 'fcp dimension name' provided during the publishing // of the product. UsageDimension *string `min:"1" type:"string" required:"true"` // Consumption value for the hour. UsageQuantity *int64 `type:"integer" required:"true"` // contains filtered or unexported fields }
func (MeterUsageInput) GoString ¶
func (s MeterUsageInput) GoString() string
GoString returns the string representation
func (MeterUsageInput) String ¶
func (s MeterUsageInput) String() string
String returns the string representation
func (*MeterUsageInput) Validate ¶ added in v1.1.21
func (s *MeterUsageInput) Validate() error
Validate inspects the fields of the type to determine if they are valid.
type MeterUsageOutput ¶
type MeterUsageOutput struct { MeteringRecordId *string `type:"string"` // contains filtered or unexported fields }
func (MeterUsageOutput) GoString ¶
func (s MeterUsageOutput) GoString() string
GoString returns the string representation
func (MeterUsageOutput) String ¶
func (s MeterUsageOutput) String() string
String returns the string representation
Directories ¶
Path | Synopsis |
---|---|
Package marketplacemeteringiface provides an interface for the AWSMarketplace Metering.
|
Package marketplacemeteringiface provides an interface for the AWSMarketplace Metering. |