1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//! `EntitlementResource` and the licence-scoped [`LicenseEntitlement`].
//!
//! Fields: `name`, `code`, `metadata`, `created`, `updated`.
//!
//! `code` is the stable, developer-facing identifier — `name` is just a
//! display label. [`crate::Client::has_entitlement`] matches on
//! `code`, never `name`. Despite the URL nesting under
//! `/licenses/{id}/entitlements`, these are full `Entitlement` resources,
//! not lightweight junction/relationship records.
//!
//! The licence-scoped **list** route carries one attribute the others do
//! not: `inherited`, true when the licence holds the entitlement through
//! its policy rather than by a direct attachment. That flag decides what a
//! caller can do with the row — an inherited entitlement cannot be detached
//! (`403 POLICY_ENTITLEMENT`), re-attaching it fails
//! (`422 ENTITLEMENT_ALREADY_INHERITED`), and, because the item route
//! resolves direct attachments only, `GET .../entitlements/{id}` on it
//! **404s**. Read it via [`crate::Client::list_license_entitlements`], which
//! returns [`LicenseEntitlement`]; [`EntitlementResource`] itself is shared
//! with the account-, policy- and release-scoped routes, where the server
//! emits no such attribute.
/// The `entitlements` JSON:API resource: `{ id, type, attributes }`. Field
/// set matches the Tamga API's actual full `EntitlementResource` serializer —
/// confirmed the license-scoped list/get endpoints return this, not the
/// lightweight `LicenseEntitlementResource` junction resource (which only
/// carries `created`/`updated` timestamps).
/// Attributes of an [`EntitlementResource`].
/// One row of `GET /licenses/{id}/entitlements` — an
/// [`EntitlementResource`] plus the licence-scoped `inherited` flag the
/// shared resource type has no field for.
///
/// Returned by [`crate::Client::list_license_entitlements`]. The plain
/// [`crate::Client::list_entitlements`] parses the same response into bare
/// [`EntitlementResource`]s and drops the flag; use this variant whenever
/// the caller intends to act on a row (detach it, re-attach it, or fetch it
/// by id), because all three of those behave differently for an inherited
/// entitlement.
/// Attributes of a [`LicenseEntitlement`] — [`EntitlementAttributes`] plus
/// `inherited`.