Class: Aws::AppMonetization::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb

Overview

An API client for AppMonetization. To construct a client, you need to configure a :region and :credentials.

client = Aws::AppMonetization::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the developer guide.

See #initialize for a full list of supported configuration options.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#api_requests, #stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

add_plugin, api, clear_plugins, define, new, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :plugins (Array<Seahorse::Client::Plugin>) — default: []] —

    A list of plugins to apply to the client. Each plugin is either a class name or an instance of a plugin class.

  • :credentials (required, Aws::CredentialProvider) —

    Your AWS credentials used for authentication. This can be any class that includes and implements Aws::CredentialProvider, or instance of any one of the following classes:

    • Aws::Credentials - Used for configuring static, non-refreshing credentials.

    • Aws::SharedCredentials - Used for loading static credentials from a shared file, such as ~/.aws/config.

    • Aws::AssumeRoleCredentials - Used when you need to assume a role.

    • Aws::AssumeRoleWebIdentityCredentials - Used when you need to assume a role after providing credentials via the web.

    • Aws::SSOCredentials - Used for loading credentials from AWS SSO using an access token generated from aws login.

    • Aws::ProcessCredentials - Used for loading credentials from a process that outputs to stdout.

    • Aws::InstanceProfileCredentials - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • Aws::ECSCredentials - Used for loading credentials from instances running in ECS.

    • Aws::CognitoIdentityCredentials - Used for loading credentials from the Cognito Identity service.

    When :credentials are not configured directly, the following locations will be searched for credentials:

    • Aws.config[:credentials]

    • The :access_key_id, :secret_access_key, :session_token, and :account_id options.

    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'], ENV['AWS_SESSION_TOKEN'], and ENV['AWS_ACCOUNT_ID'].

    • ~/.aws/credentials

    • ~/.aws/config

    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of Aws::InstanceProfileCredentials or Aws::ECSCredentials to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV['AWS_EC2_METADATA_DISABLED'] to true.

  • :region (required, String) —

    The AWS region to connect to. The configured :region is used to determine the service :endpoint. When not passed, a default :region is searched for in the following locations:

    • Aws.config[:region]
    • ENV['AWS_REGION']
    • ENV['AMAZON_REGION']
    • ENV['AWS_DEFAULT_REGION']
    • ~/.aws/credentials
    • ~/.aws/config
  • :access_key_id (String)
  • :account_id (String)
  • :active_endpoint_cache (Boolean) — default: false —

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true —

    Used only in adaptive retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a RetryCapacityNotAvailableError and will not retry instead of sleeping.

  • :auth_scheme_preference (Array<String>) —

    A list of preferred authentication schemes to use when making a request. Supported values are: sigv4, sigv4a, httpBearerAuth, and noAuth. When set using ENV['AWS_AUTH_SCHEME_PREFERENCE'] or in shared config as auth_scheme_preference, the value should be a comma-separated list.

  • :client_side_monitoring (Boolean) — default: false —

    When true, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: "" —

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1" —

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000 —

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher —

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true —

    When true, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true —

    Used only in standard and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks. Takes effect only when disable_clock_skew_correction is not set.

  • :defaults_mode (String) — default: "legacy" —

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_clock_skew_correction (Boolean) —

    Used only in standard and adaptive retry modes. When true, the SDK does not apply a clock skew correction, does not update its stored skew from responses, and does not retry clock skew errors. Clock skew correction is enabled by default.

  • :disable_host_prefix_injection (Boolean) — default: false —

    When true, the SDK will not prepend the modeled host prefix to the endpoint.

  • :disable_request_compression (Boolean) — default: false —

    When set to 'true' the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP) —

    Normally you should not configure the :endpoint option directly. This is normally constructed from the :region option. Configuring :endpoint is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000 —

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10 —

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60 —

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false —

    When set to true, endpoint discovery will be enabled for operations when available.

  • :ignore_configured_endpoint_urls (Boolean) —

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default —

    The log formatter.

  • :log_level (Symbol) — default: :info —

    The log level to send messages to the :logger at.

  • :logger (Logger) —

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3 —

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in standard and adaptive retry modes. Defaults to 3, except for DynamoDB and DynamoDB Streams, which default to 4.

  • :profile (String) — default: "default" —

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used.

  • :request_checksum_calculation (String) — default: "when_supported" —

    Determines when a checksum will be calculated for request payloads. Values are:

    • when_supported - (default) When set, a checksum will be calculated for all request payloads of operations modeled with the httpChecksum trait where requestChecksumRequired is true and/or a requestAlgorithmMember is modeled.
    • when_required - When set, a checksum will only be calculated for request payloads of operations modeled with the httpChecksum trait where requestChecksumRequired is true or where a requestAlgorithmMember is modeled and supplied.
  • :request_min_compression_size_bytes (Integer) — default: 10240 —

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :response_checksum_validation (String) — default: "when_supported" —

    Determines when checksum validation will be performed on response payloads. Values are:

    • when_supported - (default) When set, checksum validation is performed on all response payloads of operations modeled with the httpChecksum trait where responseAlgorithms is modeled, except when no modeled checksum algorithms are supported.
    • when_required - When set, checksum validation is not performed on response payloads of operations unless the checksum algorithm is supported and the requestValidationModeMember member is set to ENABLED.
  • :retry_backoff (Proc) —

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the legacy retry mode.

  • :retry_base_delay (Float) — default: 0.3 —

    The base delay in seconds used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_jitter (Symbol) — default: :none —

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the legacy retry mode.

    @see https://www.awsarchitectureblog.com/2015/03/backoff.html

  • :retry_limit (Integer) — default: 3 —

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the legacy retry mode.

  • :retry_max_delay (Integer) — default: 0 —

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the legacy retry mode.

  • :retry_mode (String) — default: "standard" —

    Specifies which retry algorithm to use. Values are:

    • legacy - The pre-existing retry behavior.

    • standard - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make. This is the default value if no retry mode is provided.

    • adaptive - A retry mode that includes all the functionality of standard mode along with automatic client side throttling.

  • :sdk_ua_app_id (String) —

    A unique and opaque application ID that is appended to the User-Agent header as app/sdk_ua_app_id. It should have a maximum length of 50. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.

  • :secret_access_key (String)
  • :session_token (String)
  • :sigv4a_signing_region_set (Array) —

    A list of regions that should be signed with SigV4a signing. When not passed, a default :sigv4a_signing_region_set is searched for in the following locations:

    • Aws.config[:sigv4a_signing_region_set]
    • ENV['AWS_SIGV4A_SIGNING_REGION_SET']
    • ~/.aws/config
  • :stub_responses (Boolean) — default: false —

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled.

  • :telemetry_provider (Aws::Telemetry::TelemetryProviderBase) — default: Aws::Telemetry::NoOpTelemetryProvider —

    Allows you to provide a telemetry provider, which is used to emit telemetry data. By default, uses NoOpTelemetryProvider which will not record or emit any telemetry data. The SDK supports the following telemetry providers:

    • OpenTelemetry (OTel) - To use the OTel provider, install and require the opentelemetry-sdk gem and then, pass in an instance of a Aws::Telemetry::OTelProvider for telemetry provider.
  • :token_provider (Aws::TokenProvider) —

    Your Bearer token used for authentication. This can be any class that includes and implements Aws::TokenProvider, or instance of any one of the following classes:

    • Aws::StaticTokenProvider - Used for configuring static, non-refreshing tokens.

    • Aws::SSOTokenProvider - Used for loading tokens from AWS SSO using an access token generated from aws login.

    When :token_provider is not configured directly, the Aws::TokenProviderChain will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean) —

    When set to true, dualstack enabled endpoints (with .aws TLD) will be used if available.

  • :use_fips_endpoint (Boolean) —

    When set to true, fips compatible endpoints will be used if available. When a fips region is used, the region is normalized and this config is set to true.

  • :validate_params (Boolean) — default: true —

    When true, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::AppMonetization::EndpointProvider) —

    The endpoint provider used to resolve endpoints. Any object that responds to #resolve_endpoint(parameters) where parameters is a Struct similar to Aws::AppMonetization::EndpointParameters.

  • :http_continue_timeout (Float) — default: 1 —

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has "Expect" header set to "100-continue". Defaults to nil which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5 —

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15 —

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String) —

    A proxy to send requests through. Formatted like 'http://proxy.com:123'.

  • :http_read_timeout (Float) — default: 60 —

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false —

    When true, HTTP debug output will be sent to the :logger.

  • :on_chunk_received (Proc) —

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a content-length).

  • :on_chunk_sent (Proc) —

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true —

    When true, response errors are raised.

  • :ssl_ca_bundle (String) —

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_directory (String) —

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass :ssl_ca_bundle or :ssl_ca_directory the the system default will be used if available.

  • :ssl_ca_store (String) —

    Sets the X509::Store to verify peer certificate.

  • :ssl_cert (OpenSSL::X509::Certificate) —

    Sets a client certificate when creating http connections.

  • :ssl_key (OpenSSL::PKey) —

    Sets a client key when creating http connections.

  • :ssl_timeout (Float) —

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true —

    When true, SSL peer certificates are verified when establishing a connection.



479
480
481
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 479

def initialize(*args)
  super
end

Instance Method Details

#archive_metric(params = {}) ⇒ Types::ArchiveMetricResponse

Archives a metric, removing its definition from the app's draft configuration. The removal takes effect on the next call to PublishDraft. Already-recorded usage events and usage history are retained; archiving only stops the metric from aggregating further usage. Any plan quota or usage pack keyed to the metric is removed with it. If the metric was published, its metric ID and display name are permanently retired and cannot be reused.

Examples:

Request syntax with placeholder values


resp = client.archive_metric({
  app_id: "AppId", # required
  metric_id: "MetricId", # required
})

Response structure


resp.app_id #=> String
resp.metric_id #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :metric_id (required, String) —

    The ID of the metric to archive.

Returns:

See Also:



520
521
522
523
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 520

def archive_metric(params = {}, options = {})
  req = build_request(:archive_metric, params)
  req.send_request(options)
end

#archive_plan(params = {}) ⇒ Types::ArchivePlanResponse

Archives a plan, removing it from the app's draft configuration so that it can no longer be subscribed to. The removal takes effect on the next call to PublishDraft. Existing subscriptions to the plan are unaffected, and the plan's display name is freed for reuse. The plan's included quotas are removed with it.

Examples:

Request syntax with placeholder values


resp = client.archive_plan({
  app_id: "AppId", # required
  plan_id: "PlanId", # required
})

Response structure


resp.app_id #=> String
resp.plan_id #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :plan_id (required, String) —

    The identifier of the plan. We generate this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.

Returns:

See Also:



560
561
562
563
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 560

def archive_plan(params = {}, options = {})
  req = build_request(:archive_plan, params)
  req.send_request(options)
end

#cancel_subscription(params = {}) ⇒ Types::CancelSubscriptionResponse

Cancels a user's subscription at the end of the current billing period.

Examples:

Request syntax with placeholder values


resp = client.cancel_subscription({
  app_id: "AppId", # required
  user_id: "UserId", # required
  effective_at: Time.now, # required
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.subscription.app_id #=> String
resp.subscription.user_id #=> String
resp.subscription.plan_id #=> String
resp.subscription.effective_at #=> Time
resp.subscription.billing_anchor_date #=> Time
resp.subscription.billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.cancellation_effective_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :user_id (required, String) —

    An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.

  • :effective_at (required, Time, DateTime, Date, Integer, String) —

    The subscription's current effective time, as returned by GetSubscription, used as an optimistic-concurrency check. If GetSubscription returns a pending change, pass pendingChange.effectiveAt; otherwise pass subscription.effectiveAt. This value does not choose when the cancellation takes effect: a new cancellation takes effect at the end of the current billing period, returned as cancellationEffectiveAt. If the subscription's effective time has changed since you read it (for example, because another plan change was made), the value no longer matches and the request fails with ConflictException; call GetSubscription again and retry with the new value. If the subscription is already cancelled or a cancellation is already scheduled, the request returns its current state and does not compare this value.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



622
623
624
625
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 622

def cancel_subscription(params = {}, options = {})
  req = build_request(:cancel_subscription, params)
  req.send_request(options)
end

#create_app(params = {}) ⇒ Types::CreateAppResponse

Creates an app. AWS App Monetization assigns a unique app identifier. This operation is idempotent: a repeated request with the same clientToken returns the app created by the original request.

Examples:

Request syntax with placeholder values


resp = client.create_app({
  name: "AppName", # required
  description: "AppDescription",
  client_token: "ClientToken",
  tags: {
    "TagKey" => "TagValue",
  },
  cost_tracking: {
    role_arn: "CostTrackingRoleArn", # required
  },
})

Response structure


resp.app.app_id #=> String
resp.app.name #=> String
resp.app.description #=> String
resp.app.status #=> String, one of "ACTIVE", "DELETED"
resp.app.created_at #=> Time
resp.app.arn #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :name (required, String) —

    A human-readable display name for the app.

  • :description (String) —

    A longer description of what the app does.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :tags (Hash<String,String>) —

    Optional tags to add to the app when it is created. To add tags when you create the app, you must also have permission for appmonetization:TagResource.

  • :cost_tracking (Types::CostTrackingConfiguration) —

    Optional cost-tracking configuration: the IAM role AWS App Monetization uses to track this app's AWS costs. To pass a role, you must have permission for iam:PassRole on it.

Returns:

See Also:



687
688
689
690
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 687

def create_app(params = {}, options = {})
  req = build_request(:create_app, params)
  req.send_request(options)
end

#create_app_payment_registration(params = {}) ⇒ Types::CreateAppPaymentRegistrationResponse

Creates a hosted URL that an app owner uses to register payment and tax details.

Examples:

Request syntax with placeholder values


resp = client.create_app_payment_registration({
  app_id: "AppId", # required
  legal_name: "LegalName",
  developer_address: {
    street1: "AddressLine", # required
    street2: "AddressLine",
    city: "AddressCity", # required
    state: "AddressState", # required
    postal_code: "PostalCode", # required
    country: "CountryCode", # required
  },
  tax_registration_number: "TaxRegistrationNumber",
  business_type: "INDIVIDUAL", # accepts INDIVIDUAL, REGISTERED_BUSINESS
  email: "Email",
  support_email: "Email",
  display_name: "SellerDisplayName",
  support_phone: "SupportPhone",
  invoice_logo: "data",
  tax_registrations: [
    {
      country_code: "CountryCode", # required
      state: "AddressState",
      collection_type: "TaxCollectionType", # required
      registration_type: "SALES_USE", # accepts SALES_USE, RETAIL_DELIVERY_FEE, VAT, VAT_OSS, VAT_IOSS, GST, FEDERAL_EIN, CPF, CNPJ, SST, TIN, NIP, NPWP, NCID
      registration_id: "TaxRegistrationId",
      locality: "TaxLocalityCode",
    },
  ],
  return_url: "Url", # required
  refresh_url: "Url", # required
  client_token: "ClientToken",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.registration_url #=> String
resp.expires_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app being registered for payment.

  • :legal_name (String) —

    Your registered legal name.

  • :developer_address (Types::DeveloperAddress) —

    Your business address.

  • :tax_registration_number (String) —

    Your tax registration number (for example, VAT, GST, or EIN).

  • :business_type (String) —

    Whether the seller is an individual or a registered business.

  • :email (String) —

    Your primary contact email for this registration, distinct from supportEmail (the address shown to customers). If you omit it, AWS App Monetization uses supportEmail.

  • :support_email (String) —

    Your support email address, displayed in the invoice footer.

  • :display_name (String) —

    Customer-facing name (doing-business-as) shown to buyers on invoices, distinct from legalName.

  • :support_phone (String) —

    Customer-facing support phone number shown to buyers on invoices.

  • :invoice_logo (String, StringIO, File) —

    Logo printed on the seller's invoices: raw PNG or JPEG bytes, up to 100 KiB. The image type is detected from the bytes. Write-only: the logo is not returned by GetAppPaymentRegistration.

  • :tax_registrations (Array<Types::TaxRegistration>) —

    The jurisdictions where the seller is registered to collect tax.

  • :return_url (required, String) —

    The URL the seller's browser is redirected to after completing hosted registration.

  • :refresh_url (required, String) —

    The URL the seller's browser is redirected to if the hosted registration session expires.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



801
802
803
804
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 801

def create_app_payment_registration(params = {}, options = {})
  req = build_request(:create_app_payment_registration, params)
  req.send_request(options)
end

#create_billing_portal_session(params = {}) ⇒ Types::CreateBillingPortalSessionResponse

Opens the AWS App Monetization hosted customer billing portal for a user. This operation returns the billing portal URL that your application redirects the user's browser to. No state is persisted.

Examples:

Request syntax with placeholder values


resp = client.create_billing_portal_session({
  app_id: "AppId", # required
  user_id: "UserId", # required
  return_url: "Url", # required
  refresh_url: "Url", # required
  session_duration_seconds: 1,
  client_token: "ClientToken",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.billing_portal_url #=> String
resp.session_token #=> String
resp.expires_at #=> Time
resp.manage_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the portal is for.

  • :user_id (required, String) —

    The ID of the end user the portal is for. Do not include personally identifiable or otherwise sensitive data in this value.

  • :return_url (required, String) —

    A URL in your app. A plan checkout started from the portal doesn't redirect here: after payment, the buyer returns to the portal's My subscription page. Bound into the session and reused for every checkout the buyer launches from the portal.

  • :refresh_url (required, String) —

    A URL in your app. A plan checkout started from the portal doesn't redirect here: if the buyer cancels, they return to the portal's plans page. Bound into the session alongside returnUrl.

  • :session_duration_seconds (Integer) —

    The lifetime of the hosted session, in seconds, counted from this call. Omit to use the service default. It does not set how long billingPortalUrl works; see expiresAt.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



874
875
876
877
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 874

def create_billing_portal_session(params = {}, options = {})
  req = build_request(:create_billing_portal_session, params)
  req.send_request(options)
end

#create_metric(params = {}) ⇒ Types::CreateMetricResponse

Creates a usage metric definition for an app. A metric beyond the Metrics per app quota is refused with ServiceQuotaExceededException.

Examples:

Request syntax with placeholder values


resp = client.create_metric({
  app_id: "AppId", # required
  name: "MetricDisplayName", # required
  description: "MetricDescription", # required
  event_type: "SourceEventType", # required
  unit_name: "UnitName", # required
  definition: { # required
    filters: [ # required
      {
        field: "IdentifierField", # required
        operator: "EQUALS", # required, accepts EQUALS, NOT_EQUALS, IN, NOT_IN
        values: ["FilterValueListMemberString"], # required
      },
    ],
    function: "SUM", # required, accepts SUM, COUNT, MAX
    function_field: "IdentifierField",
    group_by: ["IdentifierField"], # required
    period: "MONTHLY", # required, accepts MONTHLY
  },
  client_token: "ClientToken",
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.metric.app_id #=> String
resp.metric.metric_id #=> String
resp.metric.name #=> String
resp.metric.description #=> String
resp.metric.event_type #=> String
resp.metric.unit_name #=> String
resp.metric.definition.filters #=> Array
resp.metric.definition.filters[0].field #=> String
resp.metric.definition.filters[0].operator #=> String, one of "EQUALS", "NOT_EQUALS", "IN", "NOT_IN"
resp.metric.definition.filters[0].values #=> Array
resp.metric.definition.filters[0].values[0] #=> String
resp.metric.definition.function #=> String, one of "SUM", "COUNT", "MAX"
resp.metric.definition.function_field #=> String
resp.metric.definition.group_by #=> Array
resp.metric.definition.group_by[0] #=> String
resp.metric.definition.period #=> String, one of "MONTHLY"
resp.metric.arn #=> String
resp.metric.stage #=> String, one of "DRAFT", "PUBLISHED"

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the metric belongs to.

  • :name (required, String) —

    A human-readable display name for the metric (for example, Riddles Solved).

  • :description (required, String) —

    A description of what the metric measures.

  • :event_type (required, String) —

    The event type this metric aggregates. Must match the eventType sent on PutEvent.

  • :unit_name (required, String) —

    The unit of measure for the metric (for example, "requests" or "tokens").

  • :definition (required, Types::MetricDefinition) —

    The aggregation definition: filters, aggregation function, grouping, and period.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :tags (Hash<String,String>) —

    Optional tags to add to the metric when it is created. Tagging on create also requires permission for appmonetization:TagResource.

Returns:

See Also:



972
973
974
975
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 972

def create_metric(params = {}, options = {})
  req = build_request(:create_metric, params)
  req.send_request(options)
end

#create_one_time_checkout_session(params = {}) ⇒ Types::CreateOneTimeCheckoutSessionResponse

Creates a checkout session for a one-time purchase of usage packs or add-ons against the user's current subscription, or against the app when the user has no subscription. A one-time purchase always requires payment, so the response returns a checkout URL and a checkout session identifier. To subscribe a user to a plan or change the user's plan, use CreateSubscriptionCheckoutSession.

Examples:

Request syntax with placeholder values


resp = client.create_one_time_checkout_session({
  app_id: "AppId", # required
  user_id: "UserId", # required
  items: [ # required
    {
      one_time_price_id: "OneTimePriceId", # required
      quantity: 1,
    },
  ],
  return_url: "Url", # required
  client_token: "ClientToken",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.checkout_url #=> String
resp.expires_at #=> Time
resp.checkout_session_id #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the purchase is for.

  • :user_id (required, String) —

    The ID of the end user making the purchase. Do not include personally identifiable or otherwise sensitive data in this value.

  • :items (required, Array<Types::CheckoutItem>) —

    The purchasables to buy. Each line is a usage pack or add-on and the number of units to buy.

  • :return_url (required, String) —

    The URL the buyer's browser is sent to after they complete payment at checkout (the checkout page's success-redirect target). A one-time purchase always requires payment, so there is no cancel-redirect field on this operation.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



1044
1045
1046
1047
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1044

def create_one_time_checkout_session(params = {}, options = {})
  req = build_request(:create_one_time_checkout_session, params)
  req.send_request(options)
end

#create_one_time_price(params = {}) ⇒ Types::CreateOneTimePriceResponse

Creates a one-time price for an app. The one-time price exists on the draft (DRAFT) offering until published.

Examples:

Request syntax with placeholder values


resp = client.create_one_time_price({
  app_id: "AppId", # required
  definition: { # required
    name: "DisplayName", # required
    price: { # required
      currency_code: "CurrencyCode", # required
      amount: "PriceAmount", # required
    },
    metric_id: "MetricId", # required
    capacity: 1, # required
  },
  client_token: "ClientToken",
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.one_time_price.arn #=> String
resp.one_time_price.app_id #=> String
resp.one_time_price.one_time_price_id #=> String
resp.one_time_price.definition.name #=> String
resp.one_time_price.definition.price.currency_code #=> String
resp.one_time_price.definition.price.amount #=> String
resp.one_time_price.definition.metric_id #=> String
resp.one_time_price.definition.capacity #=> Integer
resp.one_time_price.stage #=> String, one of "DRAFT", "PUBLISHED"

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the one-time price belongs to.

  • :definition (required, Types::OneTimePriceDefinition) —

    The definition of the one-time price to create, including its display name, price, metric, and credited capacity.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :tags (Hash<String,String>) —

    Optional tags to add to the one-time price when it is created. Tagging on create also requires permission for appmonetization:TagResource.

Returns:

See Also:



1110
1111
1112
1113
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1110

def create_one_time_price(params = {}, options = {})
  req = build_request(:create_one_time_price, params)
  req.send_request(options)
end

#create_plan(params = {}) ⇒ Types::CreatePlanResponse

Creates a pricing plan for an app. The plan's identifier is not supplied in the request; AWS App Monetization mints a server-generated planId and returns it on the created plan. The new plan exists on the draft (DRAFT) offering until it is published with PublishDraft.

Examples:

Request syntax with placeholder values


resp = client.create_plan({
  app_id: "AppId", # required
  definition: { # required
    name: "DisplayName", # required
    description: "Description",
    billing_cycle: "MONTHLY", # required, accepts MONTHLY, ANNUAL, ONE_TIME
    subscription_price: { # required
      currency_code: "CurrencyCode", # required
      amount: "PriceAmount", # required
    },
    included_quotas: {
      "MetricId" => {
        flat: {
          included_quantity: 1, # required
          overage_policy: "NO_OVERAGE_THROTTLE", # accepts NO_OVERAGE_THROTTLE, APPLY_FIXED_OVERAGE, APPLY_TIERED_OVERAGE
          overage_price: {
            currency_code: "CurrencyCode", # required
            amount: "PriceAmount", # required
          },
          tiered_overage: {
            semantics: "GRADUATED", # required, accepts GRADUATED, VOLUME
            tiers: [ # required
              {
                first_unit: 1, # required
                last_unit: 1,
                unit_price: { # required
                  currency_code: "CurrencyCode", # required
                  amount: "PriceAmount", # required
                },
              },
            ],
          },
          max_quantity: 1,
        },
        tiered: {
          included_quantity: 1, # required
          tiered_price: { # required
            semantics: "GRADUATED", # required, accepts GRADUATED, VOLUME
            tiers: [ # required
              {
                first_unit: 1, # required
                last_unit: 1,
                unit_price: { # required
                  currency_code: "CurrencyCode", # required
                  amount: "PriceAmount", # required
                },
              },
            ],
          },
          max_quantity: 1,
        },
      },
    },
    tax_code: "ProductTaxCode",
    payment_failure_policy: {
      retry_attempts: 1,
      retry_window_days: 1,
      downgrade_to_plan_id: "PlanId",
    },
  },
  client_token: "ClientToken",
  tags: {
    "TagKey" => "TagValue",
  },
})

Response structure


resp.plan.app_id #=> String
resp.plan.plan_id #=> String
resp.plan.definition.name #=> String
resp.plan.definition.description #=> String
resp.plan.definition.billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.plan.definition.subscription_price.currency_code #=> String
resp.plan.definition.subscription_price.amount #=> String
resp.plan.definition.included_quotas #=> Hash
resp.plan.definition.included_quotas["MetricId"].flat.included_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.overage_policy #=> String, one of "NO_OVERAGE_THROTTLE", "APPLY_FIXED_OVERAGE", "APPLY_TIERED_OVERAGE"
resp.plan.definition.included_quotas["MetricId"].flat.overage_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].flat.overage_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.semantics #=> String, one of "GRADUATED", "VOLUME"
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers #=> Array
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].first_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].last_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].unit_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].unit_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].flat.max_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.included_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.semantics #=> String, one of "GRADUATED", "VOLUME"
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers #=> Array
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].first_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].last_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].unit_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].unit_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].tiered.max_quantity #=> Integer
resp.plan.definition.tax_code #=> String
resp.plan.definition.payment_failure_policy.retry_attempts #=> Integer
resp.plan.definition.payment_failure_policy.retry_window_days #=> Integer
resp.plan.definition.payment_failure_policy.downgrade_to_plan_id #=> String
resp.plan.stage #=> String, one of "DRAFT", "PUBLISHED"
resp.plan.created_at #=> Time
resp.plan.updated_at #=> Time
resp.plan.arn #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the plan belongs to.

  • :definition (required, Types::PlanDefinition) —

    The pricing and packaging definition for the plan. The plan's identifier is not supplied here: CreatePlan mints a server-generated planId and returns it on the created plan.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :tags (Hash<String,String>) —

    Optional tags to add to the plan when it is created. Tagging on create also requires permission for appmonetization:TagResource.

Returns:

See Also:



1254
1255
1256
1257
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1254

def create_plan(params = {}, options = {})
  req = build_request(:create_plan, params)
  req.send_request(options)
end

#create_subscription_checkout_session(params = {}) ⇒ Types::CreateSubscriptionCheckoutSessionResponse

Subscribes a user to a plan or changes the user's current plan. The response returns exactly one outcome: payment is required (a checkout URL is returned), payment is not required (an effective date is returned), or, when no plan identifier is provided, plan selection is required (the hosted pricing page URL is returned). To make a one-time purchase of usage packs or add-ons, use CreateOneTimeCheckoutSession.

Examples:

Request syntax with placeholder values


resp = client.create_subscription_checkout_session({
  app_id: "AppId", # required
  user_id: "UserId", # required
  plan_id: "PlanId",
  return_url: "Url", # required
  refresh_url: "Url", # required
  session_duration_seconds: 1,
  client_token: "ClientToken",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.outcome.payment_required.checkout_url #=> String
resp.outcome.payment_required.expires_at #=> Time
resp.outcome.payment_not_required.effective_at #=> Time
resp.outcome.plan_selection_required.pricing_url #=> String
resp.outcome.plan_selection_required.session_token #=> String
resp.outcome.plan_selection_required.expires_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the subscription is for.

  • :user_id (required, String) —

    The ID of the end user being subscribed. Do not include personally identifiable or otherwise sensitive data in this value.

  • :plan_id (String) —

    The plan to subscribe to or change to. Absent to open the hosted pricing page for the buyer to choose; the response then carries planSelectionRequired.pricingUrl.

  • :return_url (required, String) —

    The URL the buyer's browser is sent to after they complete payment at checkout. If the buyer is sent to a hosted checkout page, this is that page's success-redirect target. If you omit planId, the buyer chooses a plan on a hosted pricing page. After that checkout, the buyer returns to the hosted pages, not to this URL.

  • :refresh_url (required, String) —

    The URL the buyer's browser is sent to if they cancel or abandon the hosted checkout page without completing payment (the checkout page's cancel-redirect target). Point it at a page where the buyer can retry. If you omit planId, the buyer chooses a plan on a hosted pricing page. After that checkout, the buyer returns to the hosted pages, not to this URL.

  • :session_duration_seconds (Integer) —

    The lifetime of the hosted session, in seconds, counted from this call. Omit to use the service default. It does not set how long pricingUrl works; see expiresAt.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



1339
1340
1341
1342
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1339

def create_subscription_checkout_session(params = {}, options = {})
  req = build_request(:create_subscription_checkout_session, params)
  req.send_request(options)
end

#delete_app(params = {}) ⇒ Types::DeleteAppResponse

Deletes an app. If the app's published offering still has plans or metrics, the request fails with a ConflictException. Deleting an app that no longer exists returns a ResourceNotFoundException.

Examples:

Request syntax with placeholder values


resp = client.delete_app({
  app_id: "AppId", # required
  identifier: "ResourceArn",
  scope: "sandbox", # accepts sandbox, live
})

Response structure


resp.app_id #=> String
resp.status #=> String, one of "ACTIVE", "DELETED"
resp.arn #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app to delete. You can identify the app by either its ID or its Amazon Resource Name (ARN). If you provide both, they must refer to the same app.

  • :identifier (String) —

    The Amazon Resource Name (ARN) of the app. You can identify the app by either its ID or its ARN. If you provide both, they must refer to the same app. A sandbox ARN names the app's sandbox; if you also send scope, the two must name the same environment.

  • :scope (String) —

    The environment to act on: live or sandbox. Optional. You can name the environment with this member, with a sandbox resource ARN, or both; if you send both they must name the same environment, or the request is rejected.

Returns:

See Also:



1389
1390
1391
1392
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1389

def delete_app(params = {}, options = {})
  req = build_request(:delete_app, params)
  req.send_request(options)
end

#delete_one_time_price(params = {}) ⇒ Struct

Deletes a one-time price from an app. This operation is idempotent.

Examples:

Request syntax with placeholder values


resp = client.delete_one_time_price({
  app_id: "AppId", # required
  one_time_price_id: "OneTimePriceId", # required
  client_token: "ClientToken",
})

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the one-time price belongs to.

  • :one_time_price_id (required, String) —

    The ID of the one-time price to delete.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

Returns:

  • (Struct) —

    Returns an empty response.

See Also:



1421
1422
1423
1424
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1421

def delete_one_time_price(params = {}, options = {})
  req = build_request(:delete_one_time_price, params)
  req.send_request(options)
end

#delete_third_party_cost(params = {}) ⇒ Struct

Removes a third-party cost. This operation is idempotent: removing a cost that is already absent still succeeds. A missing or unauthorized parent app returns a ResourceNotFoundException.

Examples:

Request syntax with placeholder values


resp = client.delete_third_party_cost({
  app_id: "AppId", # required
  cost_id: "ThirdPartyCostId", # required
})

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :cost_id (required, String) —

    The ID of the cost to remove.

Returns:

  • (Struct) —

    Returns an empty response.

See Also:



1449
1450
1451
1452
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1449

def delete_third_party_cost(params = {}, options = {})
  req = build_request(:delete_third_party_cost, params)
  req.send_request(options)
end

#get_app(params = {}) ⇒ Types::GetAppResponse

Returns the details of an app.

Examples:

Request syntax with placeholder values


resp = client.get_app({
  app_id: "AppId", # required
  identifier: "ResourceArn",
  scope: "sandbox", # accepts sandbox, live
})

Response structure


resp.app.app_id #=> String
resp.app.name #=> String
resp.app.description #=> String
resp.app.status #=> String, one of "ACTIVE", "DELETED"
resp.app.created_at #=> Time
resp.app.arn #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app to read. You can identify the app by either its ID or its Amazon Resource Name (ARN). If you provide both, they must refer to the same app.

  • :identifier (String) —

    The Amazon Resource Name (ARN) of the app. You can identify the app by either its ID or its ARN. If you provide both, they must refer to the same app. A sandbox ARN names the app's sandbox; if you also send scope, the two must name the same environment.

  • :scope (String) —

    The environment to act on: live or sandbox. Optional. You can name the environment with this member, with a sandbox resource ARN, or both; if you send both they must name the same environment, or the request is rejected.

Returns:

See Also:



1498
1499
1500
1501
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1498

def get_app(params = {}, options = {})
  req = build_request(:get_app, params)
  req.send_request(options)
end

#get_app_infra_cost_summary(params = {}) ⇒ Types::GetAppInfraCostSummaryResponse

Returns infrastructure cost for an app, grouped by service (the default), user, or time. To use this operation, you must also have permission for ce:GetCostAndUsage on your primary billing view.

Examples:

Request syntax with placeholder values


resp = client.get_app_infra_cost_summary({
  app_id: "AppId", # required
  started_at: Time.now, # required
  ended_at: Time.now, # required
  cost_type: "ESTIMATE", # required, accepts ESTIMATE, ACTUAL
  group_by: "SERVICE", # accepts SERVICE, USER, TIME
  filter_by: {
    "SERVICE" => ["FilterValue"],
  },
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.app_id #=> String
resp.cost_type #=> String, one of "ESTIMATE", "ACTUAL"
resp.currency #=> String, one of "USD"
resp.data.group_by #=> String, one of "SERVICE", "USER", "TIME"
resp.total #=> String
resp.groups #=> Array
resp.groups[0].key #=> String
resp.groups[0].cost #=> String
resp.started_at #=> Time
resp.ended_at #=> Time
resp.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :started_at (required, Time, DateTime, Date, Integer, String) —

    Start of the reporting window.

  • :ended_at (required, Time, DateTime, Date, Integer, String) —

    End of the reporting window. Must be after startedAt, at most 720 hours after it, and not in the future.

  • :cost_type (required, String) —

    Specifies which cost data to return.

  • :group_by (String) —

    The breakdown dimension. Defaults to SERVICE when omitted.

  • :filter_by (Hash<String,Array>) —

    Filter constraints keyed by dimension. A filter dimension may differ from groupBy.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



1574
1575
1576
1577
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1574

def get_app_infra_cost_summary(params = {}, options = {})
  req = build_request(:get_app_infra_cost_summary, params)
  req.send_request(options)
end

#get_app_payment_registration(params = {}) ⇒ Types::GetAppPaymentRegistrationResponse

Returns the current payment registration status and seller profile for an app.

Examples:

Request syntax with placeholder values


resp = client.get_app_payment_registration({
  app_id: "AppId", # required
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.app_payment_registration.app_id #=> String
resp.app_payment_registration.status #=> String, one of "ACTIVE", "PENDING", "FAILED"
resp.app_payment_registration.payment_registration_id #=> String
resp.app_payment_registration.payment_registration_status #=> String, one of "ACTIVE", "PENDING", "FAILED"
resp.app_payment_registration.additional_app_eligibility #=> String, one of "ELIGIBLE", "ONBOARDING_INCOMPLETE", "IDENTITY_PENDING", "REGISTRATION_FAILED"
resp.app_payment_registration.legal_name #=> String
resp.app_payment_registration.developer_address.street1 #=> String
resp.app_payment_registration.developer_address.street2 #=> String
resp.app_payment_registration.developer_address.city #=> String
resp.app_payment_registration.developer_address.state #=> String
resp.app_payment_registration.developer_address.postal_code #=> String
resp.app_payment_registration.developer_address.country #=> String
resp.app_payment_registration.tax_registration_number #=> String
resp.app_payment_registration.business_type #=> String, one of "INDIVIDUAL", "REGISTERED_BUSINESS"
resp.app_payment_registration.email #=> String
resp.app_payment_registration.support_email #=> String
resp.app_payment_registration.display_name #=> String
resp.app_payment_registration.support_phone #=> String
resp.app_payment_registration.tax_registrations #=> Array
resp.app_payment_registration.tax_registrations[0].country_code #=> String
resp.app_payment_registration.tax_registrations[0].state #=> String
resp.app_payment_registration.tax_registrations[0].collection_type #=> String
resp.app_payment_registration.tax_registrations[0].registration_type #=> String, one of "SALES_USE", "RETAIL_DELIVERY_FEE", "VAT", "VAT_OSS", "VAT_IOSS", "GST", "FEDERAL_EIN", "CPF", "CNPJ", "SST", "TIN", "NIP", "NPWP", "NCID"
resp.app_payment_registration.tax_registrations[0].registration_id #=> String
resp.app_payment_registration.tax_registrations[0].locality #=> String
resp.app_payment_registration.created_at #=> Time
resp.app_payment_registration.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



1633
1634
1635
1636
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1633

def get_app_payment_registration(params = {}, options = {})
  req = build_request(:get_app_payment_registration, params)
  req.send_request(options)
end

#get_app_revenue_summary(params = {}) ⇒ Types::GetAppRevenueSummaryResponse

Returns billed revenue for an app for a billing period, grouped by plan.

Examples:

Request syntax with placeholder values


resp = client.get_app_revenue_summary({
  app_id: "AppId", # required
  period: "BillingPeriod",
  group_by: "PLAN", # accepts PLAN
  filter_by: {
    "PLAN" => ["FilterValue"],
  },
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.app_id #=> String
resp.period #=> String
resp.currency #=> String, one of "USD"
resp.data.group_by #=> String, one of "PLAN"
resp.total_revenue #=> String
resp.subscription_revenue #=> String
resp.usage_revenue #=> String
resp.groups #=> Array
resp.groups[0].key #=> String
resp.groups[0].users #=> Integer
resp.groups[0].subscription_revenue #=> String
resp.groups[0].usage_revenue #=> String
resp.groups[0].total_revenue #=> String
resp.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :period (String) —

    The billing period, in "YYYY-MM" form. Defaults to the current month when omitted.

  • :group_by (String) —

    The breakdown dimension. Defaults to PLAN when omitted.

  • :filter_by (Hash<String,Array>) —

    Filter constraints keyed by dimension. A filter dimension may differ from groupBy.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



1703
1704
1705
1706
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1703

def get_app_revenue_summary(params = {}, options = {})
  req = build_request(:get_app_revenue_summary, params)
  req.send_request(options)
end

#get_app_subscription_summary(params = {}) ⇒ Types::GetAppSubscriptionSummaryResponse

Returns subscription counts for an app, grouped by status (the default) or by plan. The summary contains no subscriber personally identifiable information.

Examples:

Request syntax with placeholder values


resp = client.get_app_subscription_summary({
  app_id: "AppId", # required
  group_by: "STATUS", # accepts STATUS, PLAN
  filter_by: {
    "STATUS" => ["FilterValue"],
  },
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.app_id #=> String
resp.data.group_by #=> String, one of "STATUS", "PLAN"
resp.total_subscribers #=> Integer
resp.groups #=> Array
resp.groups[0].key #=> String
resp.groups[0].count #=> Integer
resp.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :group_by (String) —

    The breakdown dimension. Defaults to STATUS when omitted.

  • :filter_by (Hash<String,Array>) —

    Filter constraints keyed by dimension. A filter dimension may differ from groupBy.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



1758
1759
1760
1761
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1758

def get_app_subscription_summary(params = {}, options = {})
  req = build_request(:get_app_subscription_summary, params)
  req.send_request(options)
end

#get_app_usage_summary(params = {}) ⇒ Types::GetAppUsageSummaryResponse

Returns usage for an app, grouped by metric (the default), user, or time.

Examples:

Request syntax with placeholder values


resp = client.get_app_usage_summary({
  app_id: "AppId", # required
  started_at: Time.now, # required
  ended_at: Time.now, # required
  group_by: "METRIC", # accepts METRIC, USER, TIME
  filter_by: {
    "METRIC" => ["FilterValue"],
  },
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.app_id #=> String
resp.data.group_by #=> String, one of "METRIC", "USER", "TIME"
resp.total_events #=> Integer
resp.groups #=> Array
resp.groups[0].key #=> String
resp.groups[0].metric_name #=> String
resp.groups[0].usage #=> Integer
resp.started_at #=> Time
resp.ended_at #=> Time
resp.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :started_at (required, Time, DateTime, Date, Integer, String) —

    Start of the reporting window.

  • :ended_at (required, Time, DateTime, Date, Integer, String) —

    End of the reporting window. Must be after startedAt, at most 720 hours after it, and not in the future.

  • :group_by (String) —

    The breakdown dimension. Defaults to METRIC when omitted.

  • :filter_by (Hash<String,Array>) —

    Filter constraints keyed by dimension. A filter dimension may differ from groupBy.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



1826
1827
1828
1829
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1826

def get_app_usage_summary(params = {}, options = {})
  req = build_request(:get_app_usage_summary, params)
  req.send_request(options)
end

#get_entitlement_decision(params = {}) ⇒ Types::GetEntitlementDecisionResponse

Returns an entitlement decision for a user action, indicating whether the action is allowed and why. It takes the pending event's quantity and properties so the check sizes the decision per metric the way PutEvent counts the event: it applies each metric's filter to the properties, counts 1 for a COUNT metric, and reads the summed or maxed field value for a SUM or MAX metric. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (a SUM or COUNT metric adds the increment to current usage, a MAX metric takes the larger of the two). Send the same eventType, quantity and properties you will send on the event: the check applies the rules PutEvent applies to that event. A SUM or MAX metric that reads a property rejects the check with a ValidationException when the property is missing or not a plain decimal, including when properties are omitted or sent as {}; a metric filter matches only properties that are present, so a filtered metric is skipped for an event with no properties, as PutEvent skips it. It is idempotent, and it may create the user's default-plan subscription on first use.

Examples:

Request syntax with placeholder values


resp = client.get_entitlement_decision({
  app_id: "AppId", # required
  user_id: "UserId", # required
  event_type: "SourceEventType", # required
  scope: "sandbox", # required, accepts sandbox, live
  quantity: "Quantity", # required
  properties: {
    "PropertyKey" => "PropertyValue",
  },
})

Response structure


resp.decision #=> String, one of "ALLOW", "DENY"
resp.reason.category #=> String, one of "CAPABILITY", "USAGE", "SYSTEM"
resp.reason.code #=> String, one of "ALLOWED", "WITHIN_QUOTA", "NO_QUOTA_RESTRICTION", "OVERAGE_ACCRUING", "SERVICE_DEGRADED", "PAYMENT_PAST_DUE", "COVERED_BY_PURCHASED_UNITS", "NO_SUBSCRIPTION", "SUBSCRIPTION_INACTIVE", "CAPABILITY_NOT_INCLUDED", "QUOTA_EXCEEDED", "SUBSCRIPTION_SUSPENDED", "OUT_OF_UNITS"
resp.plan_id #=> String
resp.metrics #=> Array
resp.metrics[0].metric_id #=> String
resp.metrics[0].used_quantity #=> Integer
resp.metrics[0].included_quantity #=> Integer
resp.metrics[0].remaining_quantity #=> Integer

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :user_id (required, String) —

    An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.

  • :event_type (required, String) —

    The type of action the user is attempting, used to determine the applicable plan capability and quota. Use the same event type you will send on the event.

  • :scope (required, String) —

    The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.

  • :quantity (required, String) —

    The number of units the pending action will consume, as a non-negative decimal string (the same Quantity shape PutEvent uses). Send the real amount if known, otherwise your best upper estimate (for example a request's max tokens). Used when a metric counts events or sums or maxes the event quantity itself. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (SUM and COUNT add the increment; MAX takes the larger of current usage and the increment).

  • :properties (Hash<String,String>) —

    The same event properties you will send on the event. Each metric's filter is applied to them, and a summed or maxed field value is read from them. Omit them or send {} when the event has none; a metric that sums or maxes a property then rejects the check, as PutEvent rejects the event. Do not include personally identifiable or otherwise sensitive data in these values.

Returns:

See Also:



1920
1921
1922
1923
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1920

def get_entitlement_decision(params = {}, options = {})
  req = build_request(:get_entitlement_decision, params)
  req.send_request(options)
end

#get_metric(params = {}) ⇒ Types::GetMetricResponse

Returns the details of a metric.

Examples:

Request syntax with placeholder values


resp = client.get_metric({
  app_id: "AppId", # required
  metric_id: "MetricId", # required
  stage: "DRAFT", # accepts DRAFT, PUBLISHED
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.metric.app_id #=> String
resp.metric.metric_id #=> String
resp.metric.name #=> String
resp.metric.description #=> String
resp.metric.event_type #=> String
resp.metric.unit_name #=> String
resp.metric.definition.filters #=> Array
resp.metric.definition.filters[0].field #=> String
resp.metric.definition.filters[0].operator #=> String, one of "EQUALS", "NOT_EQUALS", "IN", "NOT_IN"
resp.metric.definition.filters[0].values #=> Array
resp.metric.definition.filters[0].values[0] #=> String
resp.metric.definition.function #=> String, one of "SUM", "COUNT", "MAX"
resp.metric.definition.function_field #=> String
resp.metric.definition.group_by #=> Array
resp.metric.definition.group_by[0] #=> String
resp.metric.definition.period #=> String, one of "MONTHLY"
resp.metric.arn #=> String
resp.metric.stage #=> String, one of "DRAFT", "PUBLISHED"

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :metric_id (required, String) —

    The ID of the metric to retrieve.

  • :stage (String) —

    The offering stage to read the metric from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.

  • :scope (required, String) —

    Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft.

Returns:

See Also:



1980
1981
1982
1983
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 1980

def get_metric(params = {}, options = {})
  req = build_request(:get_metric, params)
  req.send_request(options)
end

#get_metric_usage(params = {}) ⇒ Types::GetMetricUsageResponse

Returns a user's raw per-metric usage over a caller-supplied window. Usage is aggregated by event time with each metric's aggregation function: summed or counted, or the largest value for a MAX metric, in the environment the scope selects (the live app or its sandbox). It returns usage only: it does not resolve the user's plan, apply quota, or attribute usage to a plan. Combine it with GetSubscriptionHistory to compute charges for each plan the user was on, or compare it against a plan's allowance to make an entitlement decision.

Usage is read at hour resolution: startedAt is floored to its hour and endedAt is rounded up to the next hour boundary, so the window read can be wider than the requested one.

Paginated over the app's metric set: one page of per-metric usage per call, continued with nextToken. The window is fixed across a pagination sequence.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.get_metric_usage({
  app_id: "AppId", # required
  user_id: "UserId", # required
  started_at: Time.now, # required
  ended_at: Time.now, # required
  scope: "sandbox", # required, accepts sandbox, live
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.usage #=> Array
resp.usage[0].metric_id #=> String
resp.usage[0].quantity #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :user_id (required, String) —

    The end user whose usage is read. Do not include personally identifiable or otherwise sensitive data in this value.

  • :started_at (required, Time, DateTime, Date, Integer, String) —

    Inclusive start of the reporting window (half-open [startedAt, endedAt)).

  • :ended_at (required, Time, DateTime, Date, Integer, String) —

    Exclusive end of the reporting window. Must be after startedAt; the window may span at most 744 hours (31 days, the longest monthly billing period). Must not be in the future beyond a small clock-skew allowance.

  • :scope (required, String) —

    Required. The environment: live or sandbox. sandbox reads the app's isolated test environment. Usage is kept separately per environment.

  • :max_results (Integer) —

    Maximum number of per-metric usage entries to return in this page (1-25, default 25).

  • :next_token (String) —

    Opaque continuation token from a prior response. The window (startedAt/endedAt) must be unchanged across a pagination sequence.

Returns:

See Also:



2061
2062
2063
2064
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2061

def get_metric_usage(params = {}, options = {})
  req = build_request(:get_metric_usage, params)
  req.send_request(options)
end

#get_one_time_price(params = {}) ⇒ Types::GetOneTimePriceResponse

Returns the details of a one-time price.

Examples:

Request syntax with placeholder values


resp = client.get_one_time_price({
  app_id: "AppId", # required
  one_time_price_id: "OneTimePriceId", # required
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.one_time_price.arn #=> String
resp.one_time_price.app_id #=> String
resp.one_time_price.one_time_price_id #=> String
resp.one_time_price.definition.name #=> String
resp.one_time_price.definition.price.currency_code #=> String
resp.one_time_price.definition.price.amount #=> String
resp.one_time_price.definition.metric_id #=> String
resp.one_time_price.definition.capacity #=> Integer
resp.one_time_price.stage #=> String, one of "DRAFT", "PUBLISHED"

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the one-time price belongs to.

  • :one_time_price_id (required, String) —

    The ID of the one-time price to return.

  • :scope (required, String) —

    Required. The environment: live or sandbox. live reads the published offering; sandbox reads the app's draft (what the sandbox runs).

Returns:

See Also:



2106
2107
2108
2109
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2106

def get_one_time_price(params = {}, options = {})
  req = build_request(:get_one_time_price, params)
  req.send_request(options)
end

#get_plan(params = {}) ⇒ Types::GetPlanResponse

Returns the details of a plan.

Examples:

Request syntax with placeholder values


resp = client.get_plan({
  app_id: "AppId", # required
  plan_id: "PlanId", # required
  stage: "DRAFT", # accepts DRAFT, PUBLISHED
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.plan.app_id #=> String
resp.plan.plan_id #=> String
resp.plan.definition.name #=> String
resp.plan.definition.description #=> String
resp.plan.definition.billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.plan.definition.subscription_price.currency_code #=> String
resp.plan.definition.subscription_price.amount #=> String
resp.plan.definition.included_quotas #=> Hash
resp.plan.definition.included_quotas["MetricId"].flat.included_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.overage_policy #=> String, one of "NO_OVERAGE_THROTTLE", "APPLY_FIXED_OVERAGE", "APPLY_TIERED_OVERAGE"
resp.plan.definition.included_quotas["MetricId"].flat.overage_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].flat.overage_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.semantics #=> String, one of "GRADUATED", "VOLUME"
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers #=> Array
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].first_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].last_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].unit_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].unit_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].flat.max_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.included_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.semantics #=> String, one of "GRADUATED", "VOLUME"
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers #=> Array
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].first_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].last_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].unit_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].unit_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].tiered.max_quantity #=> Integer
resp.plan.definition.tax_code #=> String
resp.plan.definition.payment_failure_policy.retry_attempts #=> Integer
resp.plan.definition.payment_failure_policy.retry_window_days #=> Integer
resp.plan.definition.payment_failure_policy.downgrade_to_plan_id #=> String
resp.plan.stage #=> String, one of "DRAFT", "PUBLISHED"
resp.plan.created_at #=> Time
resp.plan.updated_at #=> Time
resp.plan.arn #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :plan_id (required, String) —

    The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.

  • :stage (String) —

    The offering stage to read the plan from: DRAFT (the latest draft) or PUBLISHED (the offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.

  • :scope (required, String) —

    Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).

Returns:

See Also:



2186
2187
2188
2189
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2186

def get_plan(params = {}, options = {})
  req = build_request(:get_plan, params)
  req.send_request(options)
end

#get_plan_recommendation(params = {}) ⇒ Types::GetPlanRecommendationResponse

Returns a recommended pricing model and plan set for an app, calculated from the billable actions, costs, customer types, alternatives and preferences in the request. Built to be called by an agent working with the developer: most inputs are estimates the agent gathers from the app's code and from the developer (who the users are, what an action saves them, what it costs to serve), and each optional member's documentation says what its absence means, so send only the inputs you have a basis for. Stateless: nothing is stored, no app is required, and repeating a request returns the same recommendation unless the service has been updated in between. Every response carries the rendered texts summary and details. Smallest call (MEDIUM confidence): Aws::AppMonetization::Client."segment":"CONSUMER","appType":"DAILY_WORKFLOW","actions":[{"unitCost":0.02,"typicalMonthlyUsage":30,"valuePerUse":0"segment":"CONSUMER","appType":"DAILY_WORKFLOW","actions":[{"unitCost":0.02,"typicalMonthlyUsage":30,"valuePerUse":0.40]}.

Examples:

Request syntax with placeholder values


resp = client.get_plan_recommendation({
  app_name: "PlanRecommendationAppName",
  segment: "CONSUMER", # required, accepts CONSUMER, PROSUMER, ENTERPRISE
  app_type: "INFRASTRUCTURE", # required, accepts INFRASTRUCTURE, DAILY_WORKFLOW, PERIODIC_WORKFLOW, POINT_UTILITY, CREATIVE, API_WRAPPER
  value_kind: "PRODUCTIVITY", # accepts PRODUCTIVITY, EXPERIENTIAL
  actions: [ # required
    {
      name: "ActionName",
      unit: "BillableUnit",
      unit_cost: 1.0,
      typical_monthly_usage: 1.0, # required
      minutes_saved: 1.0,
      money_saved: 1.0,
      value_per_use: 1.0,
    },
  ],
  hourly_rate: 1.0,
  value_share: 1.0,
  features: {
    app_scores: { # required
      "FeatureName" => 1.0,
    },
    weights: {
      "FeatureName" => 1.0,
    },
  },
  costs: {
    source: "ACTUALS", # accepts ACTUALS, LIVE, ESTIMATE, NONE
    unknown: ["UnknownCostName"],
    fixed_monthly_cost: 1.0,
    margins: [1.0],
  },
  alternatives: {
    comparables_opt_in: "OPTED_IN", # accepts OPTED_IN, OPTED_OUT
    comparables: [
      {
        name: "ComparableName",
        url: "ComparableUrl", # required
        mechanism: "PAID_SUB", # required, accepts PAID_SUB, PER_REQUEST, FREE_CAPPED, FREEMIUM, ONE_TIME
        price: { # required
          currency_code: "CurrencyCode", # required
          amount: "PriceAmount", # required
        },
        cap: 1.0,
        included_units: 1.0,
        overage_rate: 1.0,
        quality: 1.0,
        features: {
          "FeatureName" => 1.0,
        },
      },
    ],
    outside_options: [
      {
        name: "ComparableName", # required
        monthly_cost: 1.0, # required
        quality: 1.0,
        features: {
          "FeatureName" => 1.0,
        },
      },
    ],
  },
  market: {
    expected_users: 1,
    measured_conversion: {
      paying_users: 1, # required
      users: 1, # required
    },
    customer_types: [
      {
        name: "CustomerTypeName", # required
        share: 1.0, # required
        usage_multiplier: 1.0, # required
        value_per_use_multiplier: 1.0, # required
        usage_spread: "SIMILAR", # accepts SIMILAR, NORMAL, VARIED, EXTREME
        feature_weights: {
          "FeatureName" => 1.0,
        },
      },
    ],
    checkout_drop_off: {
      free_plan: 1.0,
      flat: 1.0,
      per_use: 1.0,
      tiered: 1.0,
    },
  },
  plan_options: {
    pricing_model_preference: "FLAT", # accepts FLAT, TIERED, PER_USE, PER_USE_SPLIT
    free_tier_inclusion: "INCLUDE", # accepts INCLUDE, EXCLUDE
    max_tier_inclusion: "INCLUDE", # accepts INCLUDE, EXCLUDE
    annual_plan_inclusion: "INCLUDE", # accepts INCLUDE, EXCLUDE
    credit_pack_inclusion: "INCLUDE", # accepts INCLUDE, EXCLUDE
    plan_prices: [
      {
        plan_code: "RecommendedPlanCode", # required
        action_name: "ActionName",
        price: { # required
          currency_code: "CurrencyCode", # required
          amount: "PriceAmount", # required
        },
      },
    ],
    published_price: {
      currency_code: "CurrencyCode", # required
      amount: "PriceAmount", # required
    },
  },
  context: {
    non_aws_costs_note: "SensitiveAssumptionText",
    value_basis: "SensitiveAssumptionText",
    expected_users_basis: "SensitiveAssumptionText",
    usage_sources: {
      "BillableActionName" => "ESTIMATE", # accepts ESTIMATE, MEASURED
    },
    customer_type_descriptions: {
      "CustomerTypeName" => "SensitiveAssumptionText",
    },
  },
})

Response structure


resp.pricing_model #=> String, one of "FLAT", "TIERED", "PER_USE", "PER_USE_SPLIT"
resp.recommended_price.currency_code #=> String
resp.recommended_price.amount #=> String
resp.recommended_price_range.low.currency_code #=> String
resp.recommended_price_range.low.amount #=> String
resp.recommended_price_range.high.currency_code #=> String
resp.recommended_price_range.high.amount #=> String
resp.unit_prices #=> Array
resp.unit_prices[0].action_name #=> String
resp.unit_prices[0].price.currency_code #=> String
resp.unit_prices[0].price.amount #=> String
resp.plans #=> Array
resp.plans[0].plan_code #=> String
resp.plans[0].name #=> String
resp.plans[0].billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.plans[0].price.currency_code #=> String
resp.plans[0].price.amount #=> String
resp.plans[0].included_quotas #=> Array
resp.plans[0].included_quotas[0].action_name #=> String
resp.plans[0].included_quotas[0].included_quantity #=> Integer
resp.plans[0].included_quotas[0].overage_policy #=> String, one of "NO_OVERAGE_THROTTLE", "APPLY_FIXED_OVERAGE", "APPLY_TIERED_OVERAGE"
resp.plans[0].included_quotas[0].overage_price.currency_code #=> String
resp.plans[0].included_quotas[0].overage_price.amount #=> String
resp.plans[0].upgrade_plan_codes #=> Array
resp.plans[0].upgrade_plan_codes[0] #=> String
resp.plans[0].downgrade_plan_codes #=> Array
resp.plans[0].downgrade_plan_codes[0] #=> String
resp.credit_packs #=> Array
resp.credit_packs[0].name #=> String
resp.credit_packs[0].action_name #=> String
resp.credit_packs[0].quantity #=> Integer
resp.credit_packs[0].price.currency_code #=> String
resp.credit_packs[0].price.amount #=> String
resp.verdict #=> String, one of "HEALTHY", "THIN_MARGIN", "NOT_MONETIZABLE", "COST_ONLY", "COST_NOT_CHECKED"
resp.confidence #=> String, one of "HIGH", "MEDIUM", "LOW"
resp.confidence_reason #=> String
resp.basis #=> String
resp.costs.status #=> String, one of "COMPLETE", "INCOMPLETE", "NOT_CHECKED"
resp.costs.cover_status #=> String, one of "MODELED", "COVERED", "ARITHMETIC", "NOT_CHECKED"
resp.costs.cover_prices #=> Array
resp.costs.cover_prices[0].margin #=> Float
resp.costs.cover_prices[0].price.currency_code #=> String
resp.costs.cover_prices[0].price.amount #=> String
resp.costs.break_even.expected.cost_per_payer.currency_code #=> String
resp.costs.break_even.expected.cost_per_payer.amount #=> String
resp.costs.break_even.expected.payers #=> Float
resp.costs.break_even.low.cost_per_payer.currency_code #=> String
resp.costs.break_even.low.cost_per_payer.amount #=> String
resp.costs.break_even.low.payers #=> Float
resp.costs.break_even.high.cost_per_payer.currency_code #=> String
resp.costs.break_even.high.cost_per_payer.amount #=> String
resp.costs.break_even.high.payers #=> Float
resp.costs.implied_margin #=> Float
resp.alternatives.comparables_used #=> Array
resp.alternatives.comparables_used[0] #=> String
resp.alternatives.comparables_dropped #=> Array
resp.alternatives.comparables_dropped[0].name #=> String
resp.alternatives.comparables_dropped[0].price.currency_code #=> String
resp.alternatives.comparables_dropped[0].price.amount #=> String
resp.alternatives.comparables_dropped[0].reason #=> String
resp.plan_options.preference_outcome #=> String, one of "HONORED", "NOT_HONORED", "NOT_REQUESTED"
resp.plan_options.free_tier.status #=> String, one of "INCLUDED", "TRIAL_SUGGESTED", "NOT_INCLUDED"
resp.plan_options.free_tier.status_source #=> String, one of "REQUESTED", "SEGMENT_DEFAULT"
resp.plan_options.free_tier.trial_days #=> Integer
resp.plan_options.free_tier.free_users #=> Float
resp.plan_options.free_tier.conversion #=> Float
resp.plan_options.free_tier.monthly_cost.currency_code #=> String
resp.plan_options.free_tier.monthly_cost.amount #=> String
resp.plan_options.max_tier.status #=> String, one of "INCLUDED", "INCLUDED_AS_REQUESTED", "NOT_INCLUDED"
resp.plan_options.max_tier.price.currency_code #=> String
resp.plan_options.max_tier.price.amount #=> String
resp.plan_options.evaluated_plan_prices #=> Array
resp.plan_options.evaluated_plan_prices[0].plan_code #=> String
resp.plan_options.evaluated_plan_prices[0].price.currency_code #=> String
resp.plan_options.evaluated_plan_prices[0].price.amount #=> String
resp.plan_options.evaluated_plan_prices[0].monthly_profit #=> String
resp.plan_options.evaluated_plan_prices[0].paid_share #=> Float
resp.plan_options.evaluated_plan_prices[0].verdict #=> String, one of "HEALTHY", "THIN_MARGIN", "NOT_MONETIZABLE", "COST_ONLY", "COST_NOT_CHECKED"
resp.plan_options.evaluated_plan_prices[0].plans #=> Array
resp.plan_options.evaluated_plan_prices[0].plans[0].plan_code #=> String
resp.plan_options.evaluated_plan_prices[0].plans[0].name #=> String
resp.plan_options.evaluated_plan_prices[0].plans[0].billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.plan_options.evaluated_plan_prices[0].plans[0].price.currency_code #=> String
resp.plan_options.evaluated_plan_prices[0].plans[0].price.amount #=> String
resp.plan_options.evaluated_plan_prices[0].plans[0].included_quotas #=> Array
resp.plan_options.evaluated_plan_prices[0].plans[0].included_quotas[0].action_name #=> String
resp.plan_options.evaluated_plan_prices[0].plans[0].included_quotas[0].included_quantity #=> Integer
resp.plan_options.evaluated_plan_prices[0].plans[0].included_quotas[0].overage_policy #=> String, one of "NO_OVERAGE_THROTTLE", "APPLY_FIXED_OVERAGE", "APPLY_TIERED_OVERAGE"
resp.plan_options.evaluated_plan_prices[0].plans[0].included_quotas[0].overage_price.currency_code #=> String
resp.plan_options.evaluated_plan_prices[0].plans[0].included_quotas[0].overage_price.amount #=> String
resp.plan_options.evaluated_plan_prices[0].plans[0].upgrade_plan_codes #=> Array
resp.plan_options.evaluated_plan_prices[0].plans[0].upgrade_plan_codes[0] #=> String
resp.plan_options.evaluated_plan_prices[0].plans[0].downgrade_plan_codes #=> Array
resp.plan_options.evaluated_plan_prices[0].plans[0].downgrade_plan_codes[0] #=> String
resp.plan_options.evaluated_plan_prices[0].credit_packs #=> Array
resp.plan_options.evaluated_plan_prices[0].credit_packs[0].name #=> String
resp.plan_options.evaluated_plan_prices[0].credit_packs[0].action_name #=> String
resp.plan_options.evaluated_plan_prices[0].credit_packs[0].quantity #=> Integer
resp.plan_options.evaluated_plan_prices[0].credit_packs[0].price.currency_code #=> String
resp.plan_options.evaluated_plan_prices[0].credit_packs[0].price.amount #=> String
resp.analysis.model_comparison #=> Array
resp.analysis.model_comparison[0].pricing_model #=> String, one of "FLAT", "TIERED", "PER_USE", "PER_USE_SPLIT"
resp.analysis.model_comparison[0].monthly_profit #=> String
resp.analysis.model_comparison[0].monthly_revenue.currency_code #=> String
resp.analysis.model_comparison[0].monthly_revenue.amount #=> String
resp.analysis.model_comparison[0].margin #=> Float
resp.analysis.model_comparison[0].paid_share #=> Float
resp.analysis.pricing_model_caveats #=> Array
resp.analysis.pricing_model_caveats[0] #=> String, one of "CLOSE_CALL", "CHECKOUT_DROP_OFF"
resp.analysis.friction_alternative #=> String, one of "FLAT", "TIERED", "PER_USE", "PER_USE_SPLIT"
resp.recommendation_version #=> String
resp.summary #=> String
resp.details #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_name (String) —

    Display name of the app, used in the rendered text. Absent: your app.

  • :segment (required, String) —

    Who buys the app.

  • :app_type (required, String) —

    Kind of app. It sets the service's usage and value benchmarks for this kind of app.

  • :value_kind (String) —

    What kind of value the app gives its users. Absent: PRODUCTIVITY. An experiential app has no time or money value, so with EXPERIENTIAL each of actions[].minutesSaved, actions[].moneySaved, actions[].valuePerUse, hourlyRate and valueShare that is sent is rejected. With EXPERIENTIAL, no planOptions.publishedPrice and no comparables used, a CONSUMER app is valued at the typical monthly price of public apps of its appType (there is none for API_WRAPPER), shown as an estimate. That estimate is not used when it is too close to a typical user's usage cost, so the estimate alone never makes the verdict NOT_MONETIZABLE. The estimate exists only for CONSUMER: a PROSUMER or ENTERPRISE experiential app with no planOptions.publishedPrice and no usable comparables is priced from cost (verdict COST_ONLY, or COST_NOT_CHECKED when costs are not checked: no unitCost, or costs.source NONE; confidence LOW).

  • :actions (required, Array<Types::BillableAction>) —

    The things that your app charges for, each with its cost to serve, typical usage, and value to a customer. Names must be unique. Give a value basis (minutesSaved, moneySaved or valuePerUse, one per action) on every action or on none: when no action has a value basis and there is no experiential estimate (see valueKind), the price is based on cost (and comparables, if opted in, or planOptions.publishedPrice) and the confidence is LOW. Give unitCost on every action or on none.

  • :hourly_rate (Float) —

    What one hour of a customer's time is worth, in USD: the hourly rate of the person whose time the app saves. Required when any action has minutesSaved. There is no default. It is used only with actions[].minutesSaved: sent when no action has minutesSaved, or with valueKind EXPERIENTIAL, it is rejected.

  • :value_share (Float) —

    The most a typical customer would pay for the app, as a share of the time value it saves them (minutesSaved / 60 times hourlyRate). Above 1 when the minutes understate the value. The value of one use of an action with minutesSaved is minutesSaved / 60 times hourlyRate times the share; the share does not apply to moneySaved or valuePerUse. When an action's value is above 0, each outside option's monthlyCost is also weighed at this share (see OutsideOption). Absent: the service's benchmark share. For PROSUMER this value scales the service's benchmark share instead of replacing it. With usable comparables the recommended price uses the service's benchmark share for comparables instead, but this value still sets the price from the app's value alone, which the confidence and the texts compare with. Rejected unless an action's minutesSaved, moneySaved or valuePerUse is above 0 and, besides, an action has minutesSaved (0 counts) or an outside option's monthlyCost is above 0: otherwise it changes nothing (with no value above 0 there is no value estimate, and an outside option counts in full). Rejected with valueKind EXPERIENTIAL.

  • :features (Types::FeatureScores) —

    How this app scores on the characteristics customers decide on, and how much each one matters. Required when a comparable or an outside option in alternatives is scored by features, and used only then: sent when no comparable and no outside option is scored by features, it is rejected. A comparable with alternatives.comparablesOptIn OPTED_OUT is validated but not used, so features scored only against such comparables is validated with them and changes nothing. Absent: every comparable and outside option is scored by its quality.

  • :costs (Types::CostInputs) —

    Cost inputs beyond each action's unitCost: where the costs came from, any costs that could not be priced, fixed monthly cost and target margins. Absent: costs.source is inferred from actions[].unitCost, and the costs count as complete but unconfirmed (see costs.unknown).

  • :alternatives (Types::AlternativeInputs) —

    What customers could use instead of the app: comparable apps and what they do without any product. Absent: no comparables (comparablesOptIn OPTED_OUT) and no outside options.

  • :market (Types::MarketInputs) —

    Who the customers are, how many there are and, for a deployed app, how many pay today; and any checkout drop-off rates to use instead of the benchmarks. Absent: each member's default (see MarketInputs).

  • :plan_options (Types::PlanOptions) —

    The pricing model and optional plans to consider, prices to evaluate, and the developer's own price (publishedPrice). Absent: each member's default (see PlanOptions); the service chooses the pricing model and plans.

  • :context (Types::RequestContext) —

    Where the inputs came from, and notes on them. Changes no price, plan, verdict or confidence label: only how summary and details label and word the inputs. Absent: the rendered text uses default labels.

Returns:

See Also:



2572
2573
2574
2575
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2572

def get_plan_recommendation(params = {}, options = {})
  req = build_request(:get_plan_recommendation, params)
  req.send_request(options)
end

#get_subscription(params = {}) ⇒ Types::GetSubscriptionResponse

Returns a user's current subscription and any pending change.

Examples:

Request syntax with placeholder values


resp = client.get_subscription({
  app_id: "AppId", # required
  user_id: "UserId", # required
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.subscription.app_id #=> String
resp.subscription.user_id #=> String
resp.subscription.plan_id #=> String
resp.subscription.effective_at #=> Time
resp.subscription.billing_anchor_date #=> Time
resp.subscription.billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.pending_change.plan_id #=> String
resp.pending_change.plan_name #=> String
resp.pending_change.effective_at #=> Time
resp.current_period_ends_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :user_id (required, String) —

    An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



2620
2621
2622
2623
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2620

def get_subscription(params = {}, options = {})
  req = build_request(:get_subscription, params)
  req.send_request(options)
end

#get_subscription_history(params = {}) ⇒ Types::GetSubscriptionHistoryResponse

Returns the historical subscription records for a user. We recommend using pagination to ensure that the operation returns quickly and successfully.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.get_subscription_history({
  app_id: "AppId", # required
  user_id: "UserId", # required
  effective_after: Time.now,
  effective_before: Time.now,
  max_results: 1,
  next_token: "NextToken",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.items #=> Array
resp.items[0].app_id #=> String
resp.items[0].user_id #=> String
resp.items[0].plan_id #=> String
resp.items[0].effective_at #=> Time
resp.items[0].billing_anchor_date #=> Time
resp.items[0].billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :user_id (required, String) —

    An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.

  • :effective_after (Time, DateTime, Date, Integer, String) —

    Returns records whose effectiveDate is at or after this instant (inclusive).

  • :effective_before (Time, DateTime, Date, Integer, String) —

    Returns records whose effectiveDate is before this instant (exclusive).

  • :max_results (Integer) —

    The maximum number of items to return in a single page.

  • :next_token (String) —

    An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



2689
2690
2691
2692
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2689

def get_subscription_history(params = {}, options = {})
  req = build_request(:get_subscription_history, params)
  req.send_request(options)
end

#get_third_party_cost(params = {}) ⇒ Types::GetThirdPartyCostResponse

Returns a single third-party cost by its identifier. An unknown cost identifier returns a ResourceNotFoundException.

Examples:

Request syntax with placeholder values


resp = client.get_third_party_cost({
  app_id: "AppId", # required
  cost_id: "ThirdPartyCostId", # required
})

Response structure


resp.item.app_id #=> String
resp.item.cost_id #=> String
resp.item.label #=> String
resp.item.amount #=> String
resp.item.frequency #=> String, one of "MONTHLY"
resp.item.currency #=> String, one of "USD"
resp.item.description #=> String
resp.item.effective_from #=> String
resp.item.effective_to #=> String
resp.item.created_at #=> Time
resp.item.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :cost_id (required, String) —

    The ID of the cost to return.

Returns:

See Also:



2732
2733
2734
2735
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2732

def get_third_party_cost(params = {}, options = {})
  req = build_request(:get_third_party_cost, params)
  req.send_request(options)
end

#list_apps(params = {}) ⇒ Types::ListAppsResponse

Returns the apps owned by the caller. We recommend using pagination to ensure that the operation returns quickly and successfully.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_apps({
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.apps #=> Array
resp.apps[0].app_id #=> String
resp.apps[0].name #=> String
resp.apps[0].description #=> String
resp.apps[0].status #=> String, one of "ACTIVE", "DELETED"
resp.apps[0].created_at #=> Time
resp.apps[0].arn #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :max_results (Integer) —

    The maximum number of items to return in a single page. Valid range: 1 to 100.

  • :next_token (String) —

    An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.

Returns:

See Also:



2778
2779
2780
2781
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2778

def list_apps(params = {}, options = {})
  req = build_request(:list_apps, params)
  req.send_request(options)
end

#list_metrics(params = {}) ⇒ Types::ListMetricsResponse

Returns the metrics for an app. Returns a paginated list; we recommend using pagination to ensure that the operation returns quickly and successfully.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_metrics({
  app_id: "AppId", # required
  stage: "DRAFT", # accepts DRAFT, PUBLISHED
  max_results: 1,
  next_token: "NextToken",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.metrics #=> Array
resp.metrics[0].app_id #=> String
resp.metrics[0].metric_id #=> String
resp.metrics[0].name #=> String
resp.metrics[0].description #=> String
resp.metrics[0].event_type #=> String
resp.metrics[0].unit_name #=> String
resp.metrics[0].definition.filters #=> Array
resp.metrics[0].definition.filters[0].field #=> String
resp.metrics[0].definition.filters[0].operator #=> String, one of "EQUALS", "NOT_EQUALS", "IN", "NOT_IN"
resp.metrics[0].definition.filters[0].values #=> Array
resp.metrics[0].definition.filters[0].values[0] #=> String
resp.metrics[0].definition.function #=> String, one of "SUM", "COUNT", "MAX"
resp.metrics[0].definition.function_field #=> String
resp.metrics[0].definition.group_by #=> Array
resp.metrics[0].definition.group_by[0] #=> String
resp.metrics[0].definition.period #=> String, one of "MONTHLY"
resp.metrics[0].arn #=> String
resp.metrics[0].stage #=> String, one of "DRAFT", "PUBLISHED"
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :stage (String) —

    The offering stage to list metrics from: DRAFT (the latest authored draft) or PUBLISHED (the published offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox. A stage with nothing published lists as empty.

  • :max_results (Integer) —

    The maximum number of items to return in a single page. Valid range is 1 to 100.

  • :next_token (String) —

    An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.

  • :scope (required, String) —

    Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).

Returns:

See Also:



2854
2855
2856
2857
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2854

def list_metrics(params = {}, options = {})
  req = build_request(:list_metrics, params)
  req.send_request(options)
end

#list_one_time_prices(params = {}) ⇒ Types::ListOneTimePricesResponse

Lists the one-time prices for an app. Returns a paginated list; use the nextToken value to retrieve additional pages.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_one_time_prices({
  app_id: "AppId", # required
  stage: "DRAFT", # accepts DRAFT, PUBLISHED
  max_results: 1,
  next_token: "String",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.one_time_prices #=> Array
resp.one_time_prices[0].arn #=> String
resp.one_time_prices[0].app_id #=> String
resp.one_time_prices[0].one_time_price_id #=> String
resp.one_time_prices[0].definition.name #=> String
resp.one_time_prices[0].definition.price.currency_code #=> String
resp.one_time_prices[0].definition.price.amount #=> String
resp.one_time_prices[0].definition.metric_id #=> String
resp.one_time_prices[0].definition.capacity #=> Integer
resp.one_time_prices[0].stage #=> String, one of "DRAFT", "PUBLISHED"
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app whose one-time prices are listed.

  • :stage (String) —

    The offering stage to list one-time prices from: DRAFT (the latest authored draft) or PUBLISHED (the published offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox.

  • :max_results (Integer) —

    The maximum number of one-time prices to return in a single call. To retrieve the remaining results, make another call with the nextToken value that is returned in the response.

  • :next_token (String) —

    The pagination token that is returned by a previous call. Use it to retrieve the next page of results. Omit this parameter on the first call.

  • :scope (required, String) —

    Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).

Returns:

See Also:



2920
2921
2922
2923
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 2920

def list_one_time_prices(params = {}, options = {})
  req = build_request(:list_one_time_prices, params)
  req.send_request(options)
end

#list_plans(params = {}) ⇒ Types::ListPlansResponse

Returns the plans for an app. We recommend using pagination to ensure that the operation returns quickly and successfully.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_plans({
  app_id: "AppId", # required
  stage: "DRAFT", # accepts DRAFT, PUBLISHED
  max_results: 1,
  next_token: "NextToken",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.plans #=> Array
resp.plans[0].app_id #=> String
resp.plans[0].plan_id #=> String
resp.plans[0].definition.name #=> String
resp.plans[0].definition.description #=> String
resp.plans[0].definition.billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.plans[0].definition.subscription_price.currency_code #=> String
resp.plans[0].definition.subscription_price.amount #=> String
resp.plans[0].definition.included_quotas #=> Hash
resp.plans[0].definition.included_quotas["MetricId"].flat.included_quantity #=> Integer
resp.plans[0].definition.included_quotas["MetricId"].flat.overage_policy #=> String, one of "NO_OVERAGE_THROTTLE", "APPLY_FIXED_OVERAGE", "APPLY_TIERED_OVERAGE"
resp.plans[0].definition.included_quotas["MetricId"].flat.overage_price.currency_code #=> String
resp.plans[0].definition.included_quotas["MetricId"].flat.overage_price.amount #=> String
resp.plans[0].definition.included_quotas["MetricId"].flat.tiered_overage.semantics #=> String, one of "GRADUATED", "VOLUME"
resp.plans[0].definition.included_quotas["MetricId"].flat.tiered_overage.tiers #=> Array
resp.plans[0].definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].first_unit #=> Integer
resp.plans[0].definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].last_unit #=> Integer
resp.plans[0].definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].unit_price.currency_code #=> String
resp.plans[0].definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].unit_price.amount #=> String
resp.plans[0].definition.included_quotas["MetricId"].flat.max_quantity #=> Integer
resp.plans[0].definition.included_quotas["MetricId"].tiered.included_quantity #=> Integer
resp.plans[0].definition.included_quotas["MetricId"].tiered.tiered_price.semantics #=> String, one of "GRADUATED", "VOLUME"
resp.plans[0].definition.included_quotas["MetricId"].tiered.tiered_price.tiers #=> Array
resp.plans[0].definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].first_unit #=> Integer
resp.plans[0].definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].last_unit #=> Integer
resp.plans[0].definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].unit_price.currency_code #=> String
resp.plans[0].definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].unit_price.amount #=> String
resp.plans[0].definition.included_quotas["MetricId"].tiered.max_quantity #=> Integer
resp.plans[0].definition.tax_code #=> String
resp.plans[0].definition.payment_failure_policy.retry_attempts #=> Integer
resp.plans[0].definition.payment_failure_policy.retry_window_days #=> Integer
resp.plans[0].definition.payment_failure_policy.downgrade_to_plan_id #=> String
resp.plans[0].stage #=> String, one of "DRAFT", "PUBLISHED"
resp.plans[0].created_at #=> Time
resp.plans[0].updated_at #=> Time
resp.plans[0].arn #=> String
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :stage (String) —

    Which offering stage to list plans from: DRAFT (the latest authored draft) or PUBLISHED (the published offering customers see). Absent: PUBLISHED when scope=live, DRAFT when scope=sandbox. A stage with nothing published yet lists as empty.

  • :max_results (Integer) —

    The maximum number of items to return in a single page. Valid range is 1 to 100.

  • :next_token (String) —

    An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.

  • :scope (required, String) —

    Required. The environment: live or sandbox. live reads the published offering by default; sandbox reads the app's draft (what the sandbox runs).

Returns:

See Also:



3012
3013
3014
3015
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3012

def list_plans(params = {}, options = {})
  req = build_request(:list_plans, params)
  req.send_request(options)
end

#list_subscriptions(params = {}) ⇒ Types::ListSubscriptionsResponse

Returns the subscriptions for an app. We recommend using pagination to ensure that the operation returns quickly and successfully.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_subscriptions({
  app_id: "AppId", # required
  max_results: 1,
  next_token: "NextToken",
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.items #=> Array
resp.items[0].app_id #=> String
resp.items[0].user_id #=> String
resp.items[0].plan_id #=> String
resp.items[0].effective_at #=> Time
resp.items[0].billing_anchor_date #=> Time
resp.items[0].billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :max_results (Integer) —

    The maximum number of items to return in a single page.

  • :next_token (String) —

    An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



3065
3066
3067
3068
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3065

def list_subscriptions(params = {}, options = {})
  req = build_request(:list_subscriptions, params)
  req.send_request(options)
end

#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse

Lists the tags on an app, pricing plan, billing metric or one-time price.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "TaggableResourceArn", # required
})

Response structure


resp.tags #=> Hash
resp.tags["TagKey"] #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :resource_arn (required, String) —

    ARN of the app, pricing plan, billing metric or one-time price whose tags to list.

Returns:

See Also:



3096
3097
3098
3099
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3096

def list_tags_for_resource(params = {}, options = {})
  req = build_request(:list_tags_for_resource, params)
  req.send_request(options)
end

#list_third_party_costs(params = {}) ⇒ Types::ListThirdPartyCostsResponse

Returns the third-party costs for an app. To calculate a total, sum the amount of the returned items; the costs are not prorated. Returns a paginated list; we recommend using pagination to ensure that the operation returns quickly and successfully.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_third_party_costs({
  app_id: "AppId", # required
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.items #=> Array
resp.items[0].app_id #=> String
resp.items[0].cost_id #=> String
resp.items[0].label #=> String
resp.items[0].amount #=> String
resp.items[0].frequency #=> String, one of "MONTHLY"
resp.items[0].currency #=> String, one of "USD"
resp.items[0].description #=> String
resp.items[0].effective_from #=> String
resp.items[0].effective_to #=> String
resp.items[0].created_at #=> Time
resp.items[0].updated_at #=> Time
resp.next_token #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :max_results (Integer) —

    The maximum number of items to return in a single page. Valid range: 1-100.

  • :next_token (String) —

    An opaque pagination token. Pass the value returned in a response back on the next request to retrieve the following page; absent when there are no more results.

Returns:

See Also:



3153
3154
3155
3156
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3153

def list_third_party_costs(params = {}, options = {})
  req = build_request(:list_third_party_costs, params)
  req.send_request(options)
end

#publish_draft(params = {}) ⇒ Types::PublishDraftResponse

Publishes the app's current draft configuration to live in a single atomic operation. The published configuration includes all plans, metrics, capabilities, usage packs, add-ons, and free trials. A draft with more plans than the Published plans per app quota allows is refused with ServiceQuotaExceededException.

Examples:

Request syntax with placeholder values


resp = client.publish_draft({
  app_id: "AppId", # required
})

Response structure


resp.app.app_id #=> String
resp.app.name #=> String
resp.app.description #=> String
resp.app.status #=> String, one of "ACTIVE", "DELETED"
resp.app.created_at #=> Time
resp.app.arn #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

Returns:

See Also:



3190
3191
3192
3193
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3190

def publish_draft(params = {}, options = {})
  req = build_request(:publish_draft, params)
  req.send_request(options)
end

#put_aws_service_event(params = {}) ⇒ Types::PutAwsServiceEventResponse

Records an AWS service usage event for cost attribution. The event is accepted and processed asynchronously.

Examples:

Request syntax with placeholder values


resp = client.put_aws_service_event({
  app_id: "AppId", # required
  client_token: "ClientToken",
  user_id: "UserId", # required
  service: "ServiceName", # required
  operation: "OperationName", # required
  quantity: "Quantity",
  timestamp: Time.now, # required
  aws_region: "Region",
  properties: {
    "PropertyKey" => "PropertyValue",
  },
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.event_id #=> String
resp.status #=> String, one of "ACCEPTED"

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :user_id (required, String) —

    An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.

  • :service (required, String) —

    The AWS service name that emitted the usage event.

  • :operation (required, String) —

    The AWS operation (API action) that produced the usage event.

  • :quantity (String) —

    A non-negative decimal quantity represented as a string (for example, "1500" or "12.5").

  • :timestamp (required, Time, DateTime, Date, Integer, String) —

    The time the event occurred, as an ISO-8601 date-time in UTC (for example, "2026-07-26T15:04:05Z").

  • :aws_region (String) —

    The AWS Region in which the event occurred.

  • :properties (Hash<String,String>) —

    The key/value properties carried on a usage event. Property values can be referenced by metric filters and grouping.

  • :scope (required, String) —

    The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.

Returns:

See Also:



3271
3272
3273
3274
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3271

def put_aws_service_event(params = {}, options = {})
  req = build_request(:put_aws_service_event, params)
  req.send_request(options)
end

#put_custom_charges(params = {}) ⇒ Types::PutCustomChargesResponse

Adds charges that you compute to the end user's next subscription invoice. The charges go to the billing period of the user's current subscription that contains the current time. You don't specify a period.

Each charge has a chargeId that you choose. If you submit a chargeId again in the same billing period, the existing charge is replaced instead of added again. A chargeId belongs to the first billing period that accepts it, so use a value that is unique for this user across all billing periods, such as a UUID or your own invoice line ID.

The request succeeds or fails as a whole: either every charge is accepted or none is. A successful response means that every charge was accepted.

If you submit a chargeId after its billing period has ended, the request fails with a ConflictException. The charge is already recorded. Don't submit it again under a new chargeId, because that bills it twice.

A billing period holds at most 100 chargeId values for each user. If a request would exceed 100, it fails with a ServiceQuotaExceededException. Submitting a chargeId that is already in the period doesn't count toward the limit.

Examples:

Request syntax with placeholder values


resp = client.put_custom_charges({
  app_id: "AppId", # required
  user_id: "UserId", # required
  charges: [ # required
    {
      charge_id: "ChargeId", # required
      description: "CustomChargeDescription", # required
      amount: "PriceAmount", # required
      currency: "CurrencyCode", # required
      metric_id: "MetricId",
      tax_code: "ProductTaxCode",
    },
  ],
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.billing_period_start_at #=> Time
resp.billing_period_end_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :user_id (required, String) —

    The end user these charges bill.

  • :charges (required, Array<Types::CustomCharge>) —

    The custom charges to add to this user's next invoice. Stored at the submitted grain; the service never splits a charge. Accepted all-or-nothing.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



3348
3349
3350
3351
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3348

def put_custom_charges(params = {}, options = {})
  req = build_request(:put_custom_charges, params)
  req.send_request(options)
end

#put_event(params = {}) ⇒ Types::PutEventResponse

Records a usage event for a user of an app. Usage events are the raw input that metrics aggregate.

Examples:

Request syntax with placeholder values


resp = client.put_event({
  app_id: "AppId", # required
  client_token: "ClientToken",
  user_id: "UserId", # required
  event_type: "SourceEventType", # required
  quantity: "Quantity", # required
  timestamp: Time.now, # required
  properties: {
    "PropertyKey" => "PropertyValue",
  },
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.event_id #=> String
resp.status #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the event belongs to.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

  • :user_id (required, String) —

    The ID of the end user the event is attributed to. Do not include personally identifiable or otherwise sensitive data in this value.

  • :event_type (required, String) —

    The event type. Correlates with the event type of the metrics that aggregate it.

  • :quantity (required, String) —

    The amount of usage the event represents, as a non-negative decimal string (for example, "1" or "12.5").

  • :timestamp (required, Time, DateTime, Date, Integer, String) —

    The time the event occurred.

  • :properties (Hash<String,String>) —

    The key/value properties carried on the event, usable in metric filters and grouping. When a metric sums or takes the max of a property, that property's value must be a plain non-negative decimal (up to 15 digits before the point and 6 after; no sign, exponent, spaces, or commas, for example "1200" or "12.5"), and events that break this are rejected.

  • :scope (required, String) —

    The environment of the app that this operation applies to: the live app or the app's isolated sandbox test environment.

Returns:

See Also:



3423
3424
3425
3426
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3423

def put_event(params = {}, options = {})
  req = build_request(:put_event, params)
  req.send_request(options)
end

#put_third_party_cost(params = {}) ⇒ Types::PutThirdPartyCostResponse

Adds or updates a seller-declared third-party (non-AWS) monthly cost for an app. Omit the cost identifier to create a new cost, or supply an existing cost identifier to update it in place. The amount is a flat monthly value, and currency defaults to USD when omitted.

Examples:

Request syntax with placeholder values


resp = client.put_third_party_cost({
  app_id: "AppId", # required
  cost_id: "ThirdPartyCostId",
  label: "ThirdPartyCostLabel", # required
  amount: "CostValue", # required
  frequency: "MONTHLY", # accepts MONTHLY
  currency: "USD", # accepts USD
  description: "ThirdPartyCostDescription",
  effective_from: "ThirdPartyCostMonth",
  effective_to: "ThirdPartyCostMonth",
  client_token: "ClientToken",
})

Response structure


resp.item.app_id #=> String
resp.item.cost_id #=> String
resp.item.label #=> String
resp.item.amount #=> String
resp.item.frequency #=> String, one of "MONTHLY"
resp.item.currency #=> String, one of "USD"
resp.item.description #=> String
resp.item.effective_from #=> String
resp.item.effective_to #=> String
resp.item.created_at #=> Time
resp.item.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the cost belongs to.

  • :cost_id (String) —

    The ID of the cost. Omit it to create a new cost, or supply an existing cost ID to update that cost in place.

  • :label (required, String) —

    A human-readable label for the cost (for example, "Anthropic API").

  • :amount (required, String) —

    A flat monthly amount as a decimal string (for example, "12.50").

  • :frequency (String) —

    How often the cost recurs. MONTHLY is the only value today.

  • :currency (String) —

    The currency of the amount. Defaults to USD when omitted (USD is the only supported currency).

  • :description (String) —

    A free-form description of the cost.

  • :effective_from (String) —

    First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.

  • :effective_to (String) —

    Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month. When both are present, effectiveFrom must not be after effectiveTo.

  • :client_token (String) —

    AWS App Monetization does not use this value for this operation. To retry without creating a duplicate cost, pass the costId returned by the first call.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



3510
3511
3512
3513
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3510

def put_third_party_cost(params = {}, options = {})
  req = build_request(:put_third_party_cost, params)
  req.send_request(options)
end

#tag_resource(params = {}) ⇒ Struct

Adds or overwrites tags on an app, pricing plan, billing metric or one-time price.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "TaggableResourceArn", # required
  tags: { # required
    "TagKey" => "TagValue",
  },
})

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :resource_arn (required, String) —

    ARN of the app, pricing plan, billing metric or one-time price to tag.

  • :tags (required, Hash<String,String>) —

    Tags to add. A tag whose key already exists on the resource has its value overwritten.

Returns:

  • (Struct) —

    Returns an empty response.

See Also:



3540
3541
3542
3543
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3540

def tag_resource(params = {}, options = {})
  req = build_request(:tag_resource, params)
  req.send_request(options)
end

#untag_resource(params = {}) ⇒ Struct

Removes tags from an app, pricing plan, billing metric or one-time price.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "TaggableResourceArn", # required
  tag_keys: ["TagKey"], # required
})

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :resource_arn (required, String) —

    ARN of the app, pricing plan, billing metric or one-time price to remove tags from.

  • :tag_keys (required, Array<String>) —

    Keys of the tags to remove. A key that is not on the resource is ignored.

Returns:

  • (Struct) —

    Returns an empty response.

See Also:



3569
3570
3571
3572
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3569

def untag_resource(params = {}, options = {})
  req = build_request(:untag_resource, params)
  req.send_request(options)
end

#update_app(params = {}) ⇒ Types::UpdateAppResponse

Updates an existing app. This operation is idempotent.

Examples:

Request syntax with placeholder values


resp = client.update_app({
  app_id: "AppId", # required
  name: "AppName",
  description: "AppDescription",
  identifier: "ResourceArn",
  scope: "sandbox", # accepts sandbox, live
  cost_tracking: {
    role_arn: "CostTrackingRoleArn", # required
  },
})

Response structure


resp.app.app_id #=> String
resp.app.name #=> String
resp.app.description #=> String
resp.app.status #=> String, one of "ACTIVE", "DELETED"
resp.app.created_at #=> Time
resp.app.arn #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app to update. You can identify the app by either its ID or its Amazon Resource Name (ARN). If you provide both, they must refer to the same app.

  • :name (String) —

    A human-readable display name for the app.

  • :description (String) —

    The new description. An empty string clears it; omitting the member keeps the current one.

  • :identifier (String) —

    The Amazon Resource Name (ARN) of the app. You can identify the app by either its ID or its ARN. If you provide both, they must refer to the same app. A sandbox ARN names the app's sandbox; if you also send scope, the two must name the same environment.

  • :scope (String) —

    The environment to act on: live or sandbox. Optional. You can name the environment with this member, with a sandbox resource ARN, or both; if you send both they must name the same environment, or the request is rejected.

  • :cost_tracking (Types::CostTrackingConfiguration) —

    Optional cost-tracking configuration: the IAM role AWS App Monetization uses to track this app's AWS costs. Passing a role also requires permission for iam:PassRole on it. You can send it with or without a new name or description.

Returns:

See Also:



3636
3637
3638
3639
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3636

def update_app(params = {}, options = {})
  req = build_request(:update_app, params)
  req.send_request(options)
end

#update_app_payment_registration(params = {}) ⇒ Types::UpdateAppPaymentRegistrationResponse

Updates the payment and tax details on an app's payment registration.

Examples:

Request syntax with placeholder values


resp = client.update_app_payment_registration({
  app_id: "AppId", # required
  payment_registration_id: "PaymentRegistrationId",
  legal_name: "LegalName",
  developer_address: {
    street1: "AddressLine", # required
    street2: "AddressLine",
    city: "AddressCity", # required
    state: "AddressState", # required
    postal_code: "PostalCode", # required
    country: "CountryCode", # required
  },
  tax_registration_number: "TaxRegistrationNumber",
  email: "Email",
  support_email: "Email",
  display_name: "SellerDisplayName",
  support_phone: "SupportPhone",
  invoice_logo: "data",
  tax_registrations: [
    {
      country_code: "CountryCode", # required
      state: "AddressState",
      collection_type: "TaxCollectionType", # required
      registration_type: "SALES_USE", # accepts SALES_USE, RETAIL_DELIVERY_FEE, VAT, VAT_OSS, VAT_IOSS, GST, FEDERAL_EIN, CPF, CNPJ, SST, TIN, NIP, NPWP, NCID
      registration_id: "TaxRegistrationId",
      locality: "TaxLocalityCode",
    },
  ],
  scope: "sandbox", # required, accepts sandbox, live
})

Response structure


resp.app_payment_registration.app_id #=> String
resp.app_payment_registration.status #=> String, one of "ACTIVE", "PENDING", "FAILED"
resp.app_payment_registration.payment_registration_id #=> String
resp.app_payment_registration.payment_registration_status #=> String, one of "ACTIVE", "PENDING", "FAILED"
resp.app_payment_registration.additional_app_eligibility #=> String, one of "ELIGIBLE", "ONBOARDING_INCOMPLETE", "IDENTITY_PENDING", "REGISTRATION_FAILED"
resp.app_payment_registration.legal_name #=> String
resp.app_payment_registration.developer_address.street1 #=> String
resp.app_payment_registration.developer_address.street2 #=> String
resp.app_payment_registration.developer_address.city #=> String
resp.app_payment_registration.developer_address.state #=> String
resp.app_payment_registration.developer_address.postal_code #=> String
resp.app_payment_registration.developer_address.country #=> String
resp.app_payment_registration.tax_registration_number #=> String
resp.app_payment_registration.business_type #=> String, one of "INDIVIDUAL", "REGISTERED_BUSINESS"
resp.app_payment_registration.email #=> String
resp.app_payment_registration.support_email #=> String
resp.app_payment_registration.display_name #=> String
resp.app_payment_registration.support_phone #=> String
resp.app_payment_registration.tax_registrations #=> Array
resp.app_payment_registration.tax_registrations[0].country_code #=> String
resp.app_payment_registration.tax_registrations[0].state #=> String
resp.app_payment_registration.tax_registrations[0].collection_type #=> String
resp.app_payment_registration.tax_registrations[0].registration_type #=> String, one of "SALES_USE", "RETAIL_DELIVERY_FEE", "VAT", "VAT_OSS", "VAT_IOSS", "GST", "FEDERAL_EIN", "CPF", "CNPJ", "SST", "TIN", "NIP", "NPWP", "NCID"
resp.app_payment_registration.tax_registrations[0].registration_id #=> String
resp.app_payment_registration.tax_registrations[0].locality #=> String
resp.app_payment_registration.created_at #=> Time
resp.app_payment_registration.updated_at #=> Time

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app whose payment registration is updated.

  • :payment_registration_id (String) —

    Binds the app to this payment registration, owned by the caller, or rebinds it from another one. Cannot be combined with legal-detail or contact members. Naming the registration the app already holds succeeds without a write.

  • :legal_name (String) —

    Your registered legal name.

  • :developer_address (Types::DeveloperAddress) —

    Your business address.

  • :tax_registration_number (String) —

    Your tax registration number (for example, VAT, GST, or EIN).

  • :email (String) —

    Your primary contact email for this registration, distinct from supportEmail (the address shown to customers).

  • :support_email (String) —

    Your support email address, displayed in the invoice footer.

  • :display_name (String) —

    Customer-facing name (doing-business-as) shown to buyers on invoices, distinct from legalName.

  • :support_phone (String) —

    Customer-facing support phone number shown to buyers on invoices.

  • :invoice_logo (String, StringIO, File) —

    Logo printed on the seller's invoices: raw PNG or JPEG bytes, up to 100 KiB. The image type is detected from the bytes. Write-only: the logo is not returned by GetAppPaymentRegistration.

  • :tax_registrations (Array<Types::TaxRegistration>) —

    The jurisdictions where the seller is registered to collect tax.

  • :scope (required, String) —

    Required. The environment: live or sandbox.

Returns:

See Also:



3757
3758
3759
3760
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3757

def update_app_payment_registration(params = {}, options = {})
  req = build_request(:update_app_payment_registration, params)
  req.send_request(options)
end

#update_metric(params = {}) ⇒ Types::UpdateMetricResponse

Updates an existing metric. Only a draft metric, one that has never been published, can be modified. After a metric is published, every field is frozen and any update is rejected with a ConflictException. To change a published metric, archive it and create a new metric.

Examples:

Request syntax with placeholder values


resp = client.update_metric({
  app_id: "AppId", # required
  metric_id: "MetricId", # required
  name: "MetricDisplayName",
  description: "MetricDescription",
  event_type: "SourceEventType",
  unit_name: "UnitName",
  definition: {
    filters: [ # required
      {
        field: "IdentifierField", # required
        operator: "EQUALS", # required, accepts EQUALS, NOT_EQUALS, IN, NOT_IN
        values: ["FilterValueListMemberString"], # required
      },
    ],
    function: "SUM", # required, accepts SUM, COUNT, MAX
    function_field: "IdentifierField",
    group_by: ["IdentifierField"], # required
    period: "MONTHLY", # required, accepts MONTHLY
  },
})

Response structure


resp.metric.app_id #=> String
resp.metric.metric_id #=> String
resp.metric.name #=> String
resp.metric.description #=> String
resp.metric.event_type #=> String
resp.metric.unit_name #=> String
resp.metric.definition.filters #=> Array
resp.metric.definition.filters[0].field #=> String
resp.metric.definition.filters[0].operator #=> String, one of "EQUALS", "NOT_EQUALS", "IN", "NOT_IN"
resp.metric.definition.filters[0].values #=> Array
resp.metric.definition.filters[0].values[0] #=> String
resp.metric.definition.function #=> String, one of "SUM", "COUNT", "MAX"
resp.metric.definition.function_field #=> String
resp.metric.definition.group_by #=> Array
resp.metric.definition.group_by[0] #=> String
resp.metric.definition.period #=> String, one of "MONTHLY"
resp.metric.arn #=> String
resp.metric.stage #=> String, one of "DRAFT", "PUBLISHED"

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :metric_id (required, String) —

    The ID of the metric to update.

  • :name (String) —

    A human-readable display name for the metric.

  • :description (String) —

    A description of what the metric measures.

  • :event_type (String) —

    The event type this metric aggregates.

  • :unit_name (String) —

    The unit of measure for the metric (for example, "requests"), in lowercase snake_case.

  • :definition (Types::MetricDefinition) —

    The aggregation definition: filters, aggregation function, grouping, and period.

Returns:

See Also:



3843
3844
3845
3846
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3843

def update_metric(params = {}, options = {})
  req = build_request(:update_metric, params)
  req.send_request(options)
end

#update_one_time_price(params = {}) ⇒ Types::UpdateOneTimePriceResponse

Updates the definition of a one-time price. This operation is idempotent.

Examples:

Request syntax with placeholder values


resp = client.update_one_time_price({
  app_id: "AppId", # required
  one_time_price_id: "OneTimePriceId", # required
  definition: { # required
    name: "DisplayName", # required
    price: { # required
      currency_code: "CurrencyCode", # required
      amount: "PriceAmount", # required
    },
    metric_id: "MetricId", # required
    capacity: 1, # required
  },
  client_token: "ClientToken",
})

Response structure


resp.one_time_price.arn #=> String
resp.one_time_price.app_id #=> String
resp.one_time_price.one_time_price_id #=> String
resp.one_time_price.definition.name #=> String
resp.one_time_price.definition.price.currency_code #=> String
resp.one_time_price.definition.price.amount #=> String
resp.one_time_price.definition.metric_id #=> String
resp.one_time_price.definition.capacity #=> Integer
resp.one_time_price.stage #=> String, one of "DRAFT", "PUBLISHED"

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app the one-time price belongs to.

  • :one_time_price_id (required, String) —

    The ID of the one-time price to update.

  • :definition (required, Types::OneTimePriceDefinition) —

    The new definition to apply to the one-time price, including its display name, price, metric, and credited capacity.

  • :client_token (String) —

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.

    A suitable default value is auto-generated. You should normally not need to pass this option.**

Returns:

See Also:



3906
3907
3908
3909
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 3906

def update_one_time_price(params = {}, options = {})
  req = build_request(:update_one_time_price, params)
  req.send_request(options)
end

#update_plan(params = {}) ⇒ Types::UpdatePlanResponse

Updates an existing plan. Only a draft plan, one that has never been published, can be modified. After a plan is published, all of its fields are frozen and any update is rejected with a ConflictException. To change the terms of a published plan, archive it and create a new plan.

Examples:

Request syntax with placeholder values


resp = client.update_plan({
  app_id: "AppId", # required
  plan_id: "PlanId", # required
  definition: { # required
    name: "DisplayName", # required
    description: "Description",
    billing_cycle: "MONTHLY", # required, accepts MONTHLY, ANNUAL, ONE_TIME
    subscription_price: { # required
      currency_code: "CurrencyCode", # required
      amount: "PriceAmount", # required
    },
    included_quotas: {
      "MetricId" => {
        flat: {
          included_quantity: 1, # required
          overage_policy: "NO_OVERAGE_THROTTLE", # accepts NO_OVERAGE_THROTTLE, APPLY_FIXED_OVERAGE, APPLY_TIERED_OVERAGE
          overage_price: {
            currency_code: "CurrencyCode", # required
            amount: "PriceAmount", # required
          },
          tiered_overage: {
            semantics: "GRADUATED", # required, accepts GRADUATED, VOLUME
            tiers: [ # required
              {
                first_unit: 1, # required
                last_unit: 1,
                unit_price: { # required
                  currency_code: "CurrencyCode", # required
                  amount: "PriceAmount", # required
                },
              },
            ],
          },
          max_quantity: 1,
        },
        tiered: {
          included_quantity: 1, # required
          tiered_price: { # required
            semantics: "GRADUATED", # required, accepts GRADUATED, VOLUME
            tiers: [ # required
              {
                first_unit: 1, # required
                last_unit: 1,
                unit_price: { # required
                  currency_code: "CurrencyCode", # required
                  amount: "PriceAmount", # required
                },
              },
            ],
          },
          max_quantity: 1,
        },
      },
    },
    tax_code: "ProductTaxCode",
    payment_failure_policy: {
      retry_attempts: 1,
      retry_window_days: 1,
      downgrade_to_plan_id: "PlanId",
    },
  },
})

Response structure


resp.plan.app_id #=> String
resp.plan.plan_id #=> String
resp.plan.definition.name #=> String
resp.plan.definition.description #=> String
resp.plan.definition.billing_cycle #=> String, one of "MONTHLY", "ANNUAL", "ONE_TIME"
resp.plan.definition.subscription_price.currency_code #=> String
resp.plan.definition.subscription_price.amount #=> String
resp.plan.definition.included_quotas #=> Hash
resp.plan.definition.included_quotas["MetricId"].flat.included_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.overage_policy #=> String, one of "NO_OVERAGE_THROTTLE", "APPLY_FIXED_OVERAGE", "APPLY_TIERED_OVERAGE"
resp.plan.definition.included_quotas["MetricId"].flat.overage_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].flat.overage_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.semantics #=> String, one of "GRADUATED", "VOLUME"
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers #=> Array
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].first_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].last_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].unit_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].flat.tiered_overage.tiers[0].unit_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].flat.max_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.included_quantity #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.semantics #=> String, one of "GRADUATED", "VOLUME"
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers #=> Array
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].first_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].last_unit #=> Integer
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].unit_price.currency_code #=> String
resp.plan.definition.included_quotas["MetricId"].tiered.tiered_price.tiers[0].unit_price.amount #=> String
resp.plan.definition.included_quotas["MetricId"].tiered.max_quantity #=> Integer
resp.plan.definition.tax_code #=> String
resp.plan.definition.payment_failure_policy.retry_attempts #=> Integer
resp.plan.definition.payment_failure_policy.retry_window_days #=> Integer
resp.plan.definition.payment_failure_policy.downgrade_to_plan_id #=> String
resp.plan.stage #=> String, one of "DRAFT", "PUBLISHED"
resp.plan.created_at #=> Time
resp.plan.updated_at #=> Time
resp.plan.arn #=> String

Parameters:

  • params (Hash) (defaults to: {}) —

    ({})

Options Hash (params):

  • :app_id (required, String) —

    The ID of the app.

  • :plan_id (required, String) —

    The identifier of the plan. AWS App Monetization generates this value when you create the plan. It is unique within the app and is never reused. Treat it as opaque.

  • :definition (required, Types::PlanDefinition) —

    The plan's updated pricing and packaging definition.

Returns:

See Also:



4039
4040
4041
4042
# File 'gems/aws-sdk-appmonetization/lib/aws-sdk-appmonetization/client.rb', line 4039

def update_plan(params = {}, options = {})
  req = build_request(:update_plan, params)
  req.send_request(options)
end