Class: Orb::Resources::LicenseTypes

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

Overview

The LicenseType resource represents a type of license that can be assigned to users. License types are used during billing by grouping metrics on the configured grouping key.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ LicenseTypes

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 LicenseTypes.

Parameters:



99
100
101
# File 'lib/orb/resources/license_types.rb', line 99

def initialize(client:)
  @client = client
end

Instance Method Details

#create(grouping_key:, name:, request_options: {}) ⇒ Orb::Models::LicenseTypeCreateResponse

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

This endpoint is used to create a new license type.

License types are used to group licenses and define billing behavior. Each license type has a name and a grouping key that determines how metrics are aggregated for billing purposes.

Parameters:

  • grouping_key (String)

    The key used for grouping licenses of this type. This is typically a user identi

  • name (String)

    The name of the license type.

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

Returns:

See Also:



29
30
31
32
33
34
35
36
37
38
# File 'lib/orb/resources/license_types.rb', line 29

def create(params)
  parsed, options = Orb::LicenseTypeCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "license_types",
    body: parsed,
    model: Orb::Models::LicenseTypeCreateResponse,
    options: options
  )
end

#list(cursor: nil, limit: nil, request_options: {}) ⇒ Orb::Internal::Page<Orb::Models::LicenseTypeListResponse>

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

This endpoint returns a list of all license types configured for the account, ordered in ascending order by creation time.

License types are used to group licenses and define billing behavior. Each license type has a name and a grouping key that determines how metrics are aggregated for billing purposes.

Parameters:

  • cursor (String, nil)

    Cursor for pagination. This can be populated by the next_cursor value returned

  • limit (Integer)

    The number of items to fetch. Defaults to 20.

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

Returns:

See Also:



83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/orb/resources/license_types.rb', line 83

def list(params = {})
  parsed, options = Orb::LicenseTypeListParams.dump_request(params)
  query = Orb::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "license_types",
    query: query,
    page: Orb::Internal::Page,
    model: Orb::Models::LicenseTypeListResponse,
    options: options
  )
end

#retrieve(license_type_id, request_options: {}) ⇒ Orb::Models::LicenseTypeRetrieveResponse

This endpoint returns a license type identified by its license_type_id.

Use this endpoint to retrieve details about a specific license type, including its name and grouping key.

Parameters:

Returns:

See Also:



53
54
55
56
57
58
59
60
# File 'lib/orb/resources/license_types.rb', line 53

def retrieve(license_type_id, params = {})
  @client.request(
    method: :get,
    path: ["license_types/%1$s", license_type_id],
    model: Orb::Models::LicenseTypeRetrieveResponse,
    options: params[:request_options]
  )
end