-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathlicense_status.go
46 lines (39 loc) · 1.58 KB
/
license_status.go
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
// Copyright 2020 Readium Foundation. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
package licensestatuses
import (
"time"
"github.com/readium/readium-lcp-server/transactions"
)
// Updated represents license and status document timestamps
type Updated struct {
License *time.Time `json:"license,omitempty"`
Status *time.Time `json:"status,omitempty"`
}
// Link represents a link object
type Link struct {
Rel string `json:"rel"`
Href string `json:"href"`
Type string `json:"type,omitempty"`
Title string `json:"title,omitempty"`
Profile string `json:"profile,omitempty"`
Templated bool `json:"templated,omitempty"`
}
// PotentialRights represents the maximal extension time of a loan
type PotentialRights struct {
End *time.Time `json:"end,omitempty"`
}
// LicenseStatus represents a license status
type LicenseStatus struct {
ID int `json:"-"`
LicenseRef string `json:"id"`
Status string `json:"status"`
Updated *Updated `json:"updated,omitempty"`
Message string `json:"message"`
Links []Link `json:"links,omitempty"`
DeviceCount *int `json:"device_count,omitempty"`
PotentialRights *PotentialRights `json:"potential_rights,omitempty"`
Events []transactions.Event `json:"events,omitempty"`
CurrentEndLicense *time.Time `json:"-"`
}