zplCore.comzplCore.com

Gs1DigitalLinkResult

public sealed class Gs1DigitalLinkResult

Result of Gs1DigitalLink.Parse.

Properties

PropertyTypeDescription
DataAttributes { get; }IReadOnlyList<Gs1Element>Data attributes from the query string in URI order (values percent-decoded).
Elements { get; }IReadOnlyList<Gs1Element>Gs1DigitalLinkResult.PathElements followed by Gs1DigitalLinkResult.DataAttributes.
Errors { get; }IReadOnlyList<Gs1DigitalLinkIssue>Violations of the URI syntax or of the AI rules; empty for a conformant URI.
ExtensionParameters { get; }IReadOnlyList<KeyValuePair<string, string>>Query parameters that are not GS1 AIs (extension parameters such as linkType=gs1:pip), percent-decoded.
Fragment { get; }stringFragment after '#' (not sent to a server; ignored for the GS1 data), or null.
Gtin { get; }stringThe GTIN (AI 01) in the path or query, or null.
Host { get; }stringHost name with optional port, e.g. "id.gs1.org" or "brand.example.com:8443".
IsCompressed { get; }boolThe URI uses the legacy compression (decoded by Gs1DigitalLink.Decompress).
IsValid { get; }boolGs1DigitalLinkResult.IsDigitalLink and no errors.
PathElements { get; }IReadOnlyList<Gs1Element>Primary key and key qualifiers in path order (values percent-decoded).
PrimaryKey { get; }stringAI of the primary key in the path (e.g. "01"), or null.
Scheme { get; }string"http", "https", "HTTP" or "HTTPS" (empty when the scheme is missing or not allowed).
Stem { get; }stringEverything before the GS1 path: scheme, host and any custom path segments, e.g. "https://brand.example.com/p". Pass it to Gs1DigitalLink.Build to rebuild a URI on the same stem.
Uri { get; }stringThe input.
Warnings { get; }IReadOnlyList<Gs1DigitalLinkIssue>Recommendations and tolerated legacy forms (http instead of https, compressed form …).

Methods

Method SignatureReturnsDescription
# ToCanonicalUri()stringThe canonical GS1 Digital Link URI (URI Syntax 1.7.0 §4.12): https://id.gs1.org, the same path, only AI data attributes in lexical order of the AI, no extension parameters, no trailing slash. Throws InvalidOperationException: The URI is not a valid GS1 Digital Link URI.
# ToElementString(bool bracketed = true)stringThe GS1 element string with the same data: primary key first, then the other AIs of predefined length, then the variable-length AIs (path before query), bracketed "(01)…(17)…(10)…" or raw with GS (U+001D) separators.
# ToString()string
# Value(string ai)stringValue of the first element with this AI (path or query), or null.