Cryptolens Client API for C++
LicenseKeyInformation.hpp
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include "imports/std/optional"
7 
8 #include "api.hpp"
9 #include "ActivationData.hpp"
10 #include "basic_Error.hpp"
11 #include "Customer.hpp"
12 #include "DataObject.hpp"
13 #include "RawLicenseKey.hpp"
14 
15 namespace cryptolens_io {
16 
17 namespace v20190401 {
18 
19 class LicenseKeyChecker;
20 
35 private:
37 
38  int product_id_;
39  std::uint64_t created_;
40  std::uint64_t expires_;
41  int period_;
42  bool block_;
43  bool trial_activation_;
44  std::uint64_t sign_date_;
45  bool f1_;
46  bool f2_;
47  bool f3_;
48  bool f4_;
49  bool f5_;
50  bool f6_;
51  bool f7_;
52  bool f8_;
53 
54  optional<int> id_;
55  optional<std::string> key_;
56  optional<std::string> notes_;
57  optional<int> global_id_;
58  optional<Customer> customer_;
59  optional<std::vector<ActivationData>> activated_machines_;
60  optional<int> maxnoofmachines_;
61  optional<std::string> allowed_machines_;
62  optional<std::vector<DataObject>> data_objects_;
63 public:
66  int product_id,
67  std::uint64_t created,
68  std::uint64_t expires,
69  int period,
70  bool block,
71  bool trial_activation,
72  std::uint64_t sign_date,
73  bool f1,
74  bool f2,
75  bool f3,
76  bool f4,
77  bool f5,
78  bool f6,
79  bool f7,
80  bool f8,
81 
82  optional<int> id,
83  optional<std::string> key,
84  optional<std::string> notes,
85  optional<int> global_id,
86  optional<Customer> customer,
87  optional<std::vector<ActivationData>> activated_machines,
88  optional<int> maxnoofmachines,
89  optional<std::string> allowed_machines,
90  optional<std::vector<DataObject>> data_objects
91  );
92 
93 #if 1
94  static optional<LicenseKeyInformation> make(basic_Error & e, RawLicenseKey const& raw_license_key);
95  static optional<LicenseKeyInformation> make(basic_Error & e, optional<RawLicenseKey> const& raw_license_key);
96  static optional<LicenseKeyInformation> make_unsafe(basic_Error & e, std::string const& license_key);
97 #endif
98 
99  LicenseKeyChecker check() const;
100 
101  int get_product_id() const;
102  std::uint64_t get_created() const;
103  std::uint64_t get_expires() const;
104  int get_period() const;
105  bool get_block() const;
106  bool get_trial_activation() const;
107  std::uint64_t get_sign_date() const;
108  bool get_f1() const;
109  bool get_f2() const;
110  bool get_f3() const;
111  bool get_f4() const;
112  bool get_f5() const;
113  bool get_f6() const;
114  bool get_f7() const;
115  bool get_f8() const;
116 
117  optional<int> const& get_id() const;
118  optional<std::string> const& get_key() const;
119  optional<std::string> const& get_notes() const;
120  optional<int> const& get_global_id() const;
121  optional<Customer> const& get_customer() const;
122  optional<std::vector<ActivationData>> const& get_activated_machines() const;
123  optional<int> const& get_maxnoofmachines() const;
124  optional<std::string> const& get_allowed_machines() const;
125  optional<std::vector<DataObject>> const& get_data_objects() const;
126 };
127 
128 } // namespace v20190401
129 
130 namespace v20180502 {
131 
133 
134 } // namespace v20180502
135 
136 namespace latest {
137 
139 
140 } // namespace latest
141 
142 } // namespace cryptolens_io
optional< int > const & get_maxnoofmachines() const
Definition: LicenseKeyInformation.cpp:314
optional< std::vector< ActivationData > > const & get_activated_machines() const
Definition: LicenseKeyInformation.cpp:304
optional< Customer > const & get_customer() const
Definition: LicenseKeyInformation.cpp:295
bool get_f1() const
Definition: LicenseKeyInformation.cpp:187
bool get_f3() const
Definition: LicenseKeyInformation.cpp:205
static optional< LicenseKeyInformation > make_unsafe(basic_Error &e, std::string const &license_key)
Definition: LicenseKeyInformation.cpp:103
bool get_block() const
Definition: LicenseKeyInformation.cpp:160
static optional< LicenseKeyInformation > make(basic_Error &e, RawLicenseKey const &raw_license_key)
Definition: LicenseKeyInformation.cpp:73
bool get_f8() const
Definition: LicenseKeyInformation.cpp:250
LicenseKeyChecker check() const
Definition: LicenseKeyInformation.cpp:117
optional< std::string > const & get_allowed_machines() const
Definition: LicenseKeyInformation.cpp:325
optional< int > const & get_id() const
Definition: LicenseKeyInformation.cpp:259
optional< std::string > const & get_key() const
Definition: LicenseKeyInformation.cpp:268
std::uint64_t get_created() const
Definition: LicenseKeyInformation.cpp:133
Definition: ActivateError.hpp:5
bool get_trial_activation() const
Definition: LicenseKeyInformation.cpp:169
bool get_f4() const
Definition: LicenseKeyInformation.cpp:214
Definition: LicenseKeyChecker.hpp:11
optional< int > const & get_global_id() const
Definition: LicenseKeyInformation.cpp:286
int get_period() const
Definition: LicenseKeyInformation.cpp:151
bool get_f6() const
Definition: LicenseKeyInformation.cpp:232
Definition: RawLicenseKey.hpp:24
Definition: basic_Error.hpp:90
bool get_f7() const
Definition: LicenseKeyInformation.cpp:241
bool get_f2() const
Definition: LicenseKeyInformation.cpp:196
int get_product_id() const
Definition: LicenseKeyInformation.cpp:124
optional< std::string > const & get_notes() const
Definition: LicenseKeyInformation.cpp:277
std::uint64_t get_expires() const
Definition: LicenseKeyInformation.cpp:142
bool get_f5() const
Definition: LicenseKeyInformation.cpp:223
std::uint64_t get_sign_date() const
Definition: LicenseKeyInformation.cpp:178
optional< std::vector< DataObject > > const & get_data_objects() const
Definition: LicenseKeyInformation.cpp:334
Definition: LicenseKeyInformation.hpp:34