public sealed class Gs1DigitalLinkResult
Result of Gs1DigitalLink.Parse.
Properties
| Property | Type | Description |
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; } | string | Fragment after '#' (not sent to a server; ignored for the GS1 data), or null. |
Gtin { get; } | string | The GTIN (AI 01) in the path or query, or null. |
Host { get; } | string | Host name with optional port, e.g. "id.gs1.org" or "brand.example.com:8443". |
IsCompressed { get; } | bool | The URI uses the legacy compression (decoded by Gs1DigitalLink.Decompress). |
IsDigitalLink { get; } | bool | The input has the structure of a GS1 Digital Link URI: an http(s) URI whose path ends in a primary key and its value (possibly with errors in the details), or a legacy compressed URI that could be decoded. |
IsValid { get; } | bool | Gs1DigitalLinkResult.IsDigitalLink and no errors. |
PathElements { get; } | IReadOnlyList<Gs1Element> | Primary key and key qualifiers in path order (values percent-decoded). |
PrimaryKey { get; } | string | AI 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; } | string | Everything 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; } | string | The input. |
Warnings { get; } | IReadOnlyList<Gs1DigitalLinkIssue> | Recommendations and tolerated legacy forms (http instead of https, compressed form …). |
Methods
| Method Signature | Returns | Description |
# ToCanonicalUri() | string | The 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) | string | The 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) | string | Value of the first element with this AI (path or query), or null. |