Class: Orb::Resources::Licenses::ExternalLicenses

Inherits:
Object
  • Object
show all
Defined in:
lib/orb/resources/licenses/external_licenses.rb,
sig/orb/resources/licenses/external_licenses.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ExternalLicenses

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ExternalLicenses.

Parameters:



60
61
62
# File 'lib/orb/resources/licenses/external_licenses.rb', line 60

def initialize(client:)
  @client = client
end

Instance Method Details

#get_usage(external_license_id, license_type_id:, subscription_id:, cursor: nil, end_date: nil, group_by: nil, limit: nil, start_date: nil, request_options: {}) ⇒ Orb::Models::Licenses::ExternalLicenseGetUsageResponse

Some parameter documentations has been truncated, see Models::Licenses::ExternalLicenseGetUsageParams for more details.

Returns usage and remaining credits for a license identified by its external license ID.

Resolves the currently active license with this external ID, i.e. the license whose active window contains the current time. An external license ID can map to multiple licenses over time, so if none is currently active (deactivated, window ended, or not yet started) this returns a 404. To fetch usage for a license regardless of active state, use the endpoint that takes Orb's internal license ID.

Date range defaults to the current billing period if not specified.

Parameters:

  • external_license_id (String)
  • license_type_id (String)

    The license type ID to filter licenses by.

  • subscription_id (String)

    The subscription ID to get license usage for.

  • cursor (String, nil)

    Pagination cursor from a previous request.

  • end_date (Date, nil)

    End date for the usage period (YYYY-MM-DD). Defaults to end of current billing p

  • group_by (String, nil)

    How to group the results. Valid values: 'license', 'day'. Can be combined (e.g.,

  • limit (Integer)

    Maximum number of rows in the response data (default 20, max 100).

  • start_date (Date, nil)

    Start date for the usage period (YYYY-MM-DD). Defaults to start of current billi

  • request_options (Orb::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/orb/resources/licenses/external_licenses.rb', line 45

def get_usage(external_license_id, params)
  parsed, options = Orb::Licenses::ExternalLicenseGetUsageParams.dump_request(params)
  query = Orb::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["licenses/external_licenses/%1$s/usage", external_license_id],
    query: query,
    model: Orb::Models::Licenses::ExternalLicenseGetUsageResponse,
    options: options
  )
end