license static method

Future<LicenseRecord> license(
  1. String ptr,
  2. List<LicenseUse> uses,
  3. String terms, {
  4. List<TitleTag>? tags = const [],
  5. String? titleDescription,
  6. String? licenseDescription,
  7. DateTime? expiry,
  8. String? origin,
})

Creates a new LicenseRecord object.

The method searches for a TitleRecord object that matches the provided ptr parameter. If such a record exists, the tags and titleDescription parameters are ignored. Otherwise, a new TitleRecord is created using the provided tags and titleDescription parameters.

If the origin parameter is not provided, the default origin specified in initialization is used. The expiry parameter sets the expiration date of the LicenseRecord. If the license never expires, leave this parameter as null.

  • Parameters:

    • ptr: The pointer record identifies data stored in your system, similar to a foreign key. Learn more about selecting good pointer records at https://docs.mytiki.com/docs/selecting-a-pointer-record.
    • uses: A list defining how and where an asset may be used, in the format of LicenseUse objects. Learn more about specifying uses at https://docs.mytiki.com/docs/specifying-terms-and-usage.
    • terms: The legal terms of the contract. This is a long text document that explains the terms of the license.
    • tags: A list of metadata tags included in the TitleRecord describing the asset, for your use in record search and filtering. This parameter is used only if a TitleRecord does not already exist for the provided ptr.
    • titleDescription: A short, human-readable description of the TitleRecord as a future reminder. This parameter is used only if a TitleRecord does not already exist for the provided ptr.
    • licenseDescription: A short, human-readable description of the LicenseRecord as a future reminder.
    • expiry: The expiration date of the LicenseRecord. If the license never expires, leave this parameter as null.
    • origin: An optional override of the default origin specified in init(). Use a reverse-DNS syntax, e.g. com.myco.myapp.
  • Returns: The created LicenseRecord object.

  • Throws: TikiSdkError if the SDK is not initialized or if there is an error creating or saving the record.

Implementation

static Future<LicenseRecord> license(
    String ptr, List<LicenseUse> uses, String terms,
    {List<TitleTag>? tags = const [],
    String? titleDescription,
    String? licenseDescription,
    DateTime? expiry,
    String? origin}) {
  _throwIfNotInitialized();
  return instance._core!.license(
    ptr,
    uses,
    terms,
    titleDescription: titleDescription,
    licenseDescription: licenseDescription,
    expiry: expiry,
    origin: origin,
  );
}