Class Data
Methods that perform operations on a data object. A complete list can be found here: https://app.cryptolens.io/docs/api/v3/Data
Inherited Members
Namespace: SKMV3Methods
Assembly: Cryptolens.Licensing.CrossPlatform.dll
Syntax
public class Data
Examples
var token = "{acesstoken to GetKey, IncrementIntValue, ListDataObjects, AddDataObjects, and Key Lock = -1 (or zero)}".
var license = new LicenseKey { ProductId = 3349, Key = "GEBNC-WZZJD-VJIHG-GCMVD" };
license.Refresh(token);
if(license.DataObjects.Contains("usagecount"))
{
// attempt to increment. true means we succeed.
var dataObj = license.DataObjects.Get("usagecount");
if (dataObj.IncrementIntValue(token: token,
incrementValue: 1,
enableBound: true,
upperBound: 2))
{
// success, we can keep using this feature
}
else
{
// fail, the the user has already used it 10 times.
}
}
else
{
// if it does not exist, add a new one.
license.AddDataObject(tokenDObj, new DataObject { Name = "usagecount", IntValue = 0 });
}
Methods
| Improve this Doc View SourceAddDataObject(string, AddDataObjectModel)
Creates a new DataObject.
Declaration
public static DataObjectIdResult AddDataObject(string token, AddDataObjectModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
AddDataObjectModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
DataObjectIdResult | Returns DataObjectIdResult or null. |
Remarks
Note: for more details, please see https://app.cryptolens.io/docs/api/v3/AddDataObject
AddDataObject(string, AddDataObjectToKeyModel)
Creates a new DataObject for a key.
Declaration
public static DataObjectIdResult AddDataObject(string token, AddDataObjectToKeyModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
AddDataObjectToKeyModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
DataObjectIdResult | Returns DataObjectIdResult or null. |
Remarks
Note: for more details, please see https://app.cryptolens.io/docs/api/v3/AddDataObject
AddDataObject(string, AddDataObjectToMachineCodeModel)
Creates a new DataObject for a machine code.
Declaration
public static DataObjectIdResult AddDataObject(string token, AddDataObjectToMachineCodeModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
AddDataObjectToMachineCodeModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
DataObjectIdResult | Returns DataObjectIdResult or null. |
Remarks
Note: for more details, please see https://app.cryptolens.io/docs/api/v3/AddDataObject
DecrementIntValue(string, ChangeIntValueModel)
This method will decrement the current int value by the one specified as an input parameter, i.e. IntValue.
Declaration
public static BasicResult DecrementIntValue(string token, ChangeIntValueModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/DecrementIntValue
DecrementIntValue(string, ChangeIntValueToKeyModel)
This method will decrement the current int value by the one specified as an input parameter, i.e. IntValue.
Declaration
public static BasicResult DecrementIntValue(string token, ChangeIntValueToKeyModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueToKeyModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/DecrementIntValue
DecrementIntValue(string, ChangeIntValueToMachineCodeModel)
This method will decrement the current int value by the one specified as an input parameter, i.e. IntValue.
Declaration
public static BasicResult DecrementIntValue(string token, ChangeIntValueToMachineCodeModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueToMachineCodeModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/DecrementIntValue
IncrementIntValue(string, ChangeIntValueModel)
This method will increment the current int value by the one specified as an input parameter, i.e. IntValue.
Declaration
public static BasicResult IncrementIntValue(string token, ChangeIntValueModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/IncrementIntValue
IncrementIntValue(string, ChangeIntValueToKeyModel)
This method will increment the current int value by the one specified as an input parameter, i.e. IntValue.
Declaration
public static BasicResult IncrementIntValue(string token, ChangeIntValueToKeyModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueToKeyModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/IncrementIntValue
IncrementIntValue(string, ChangeIntValueToMachineCodeModel)
This method will increment the current int value by the one specified as an input parameter, i.e. IntValue.
Declaration
public static BasicResult IncrementIntValue(string token, ChangeIntValueToMachineCodeModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueToMachineCodeModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/IncrementIntValue
ListDataObjects(string, ListDataObjectsModel)
This method lists either all Data Object associated with a license key, a product or your entire account, or all of them at once.
Declaration
public static ListOfDataObjectsResult ListDataObjects(string token, ListDataObjectsModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ListDataObjectsModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
ListOfDataObjectsResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see https://app.cryptolens.io/docs/api/v3/ListDataObjects
ListDataObjects(string, ListDataObjectsToKeyModel)
This method lists all data objects associated with a license key only.
Declaration
public static ListOfDataObjectsResult ListDataObjects(string token, ListDataObjectsToKeyModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ListDataObjectsToKeyModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
ListOfDataObjectsResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see https://app.cryptolens.io/docs/api/v3/ListDataObjects
ListDataObjects(string, ListDataObjectsToMachineCodeModel)
This method lists all data objects associated with a machine code only.
Declaration
public static ListOfDataObjectsResult ListDataObjects(string token, ListDataObjectsToMachineCodeModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ListDataObjectsToMachineCodeModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
ListOfDataObjectsResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see https://app.cryptolens.io/docs/api/v3/ListDataObjects
RemoveDataObject(string, RemoveDataObjectModel)
This method will remove an existing data object.
Declaration
public static BasicResult RemoveDataObject(string token, RemoveDataObjectModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
RemoveDataObjectModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/RemoveDataObject
RemoveDataObject(string, RemoveDataObjectToKeyModel)
This method will remove an existing data object.
Declaration
public static BasicResult RemoveDataObject(string token, RemoveDataObjectToKeyModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
RemoveDataObjectToKeyModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/RemoveDataObject
RemoveDataObject(string, RemoveDataObjectToMachineCodeModel)
This method will remove an existing data object.
Declaration
public static BasicResult RemoveDataObject(string token, RemoveDataObjectToMachineCodeModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
RemoveDataObjectToMachineCodeModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/RemoveDataObject
SetIntValue(string, ChangeIntValueModel)
This method will set the int value to a new one.
Declaration
public static BasicResult SetIntValue(string token, ChangeIntValueModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/SetIntValue
Note also: Integer overflows are not allowed. If you attempt to assign an int value that is beyond the limits of an int32, zero will be assigned to the data object's IntValue.
SetIntValue(string, ChangeIntValueToKeyModel)
This method will set the int value to a new one.
Declaration
public static BasicResult SetIntValue(string token, ChangeIntValueToKeyModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueToKeyModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/SetIntValue
Note also: Integer overflows are not allowed. If you attempt to assign an int value that is beyond the limits of an int32, zero will be assigned to the data object's IntValue.
SetIntValue(string, ChangeIntValueToMachineCodeModel)
This method will set the int value to a new one.
Declaration
public static BasicResult SetIntValue(string token, ChangeIntValueToMachineCodeModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeIntValueToMachineCodeModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/SetIntValue
Note also: Integer overflows are not allowed. If you attempt to assign an int value that is beyond the limits of an int32, zero will be assigned to the data object's IntValue.
SetStringValue(string, ChangeStringValueModel)
This method will set the string value to a new one.
Declaration
public static BasicResult SetStringValue(string token, ChangeStringValueModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeStringValueModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/SetStringValue
SetStringValue(string, ChangeStringValueToKeyModel)
This method will set the string value to a new one.
Declaration
public static BasicResult SetStringValue(string token, ChangeStringValueToKeyModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeStringValueToKeyModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/SetStringValue
SetStringValue(string, ChangeStringValueToMachineCodeModel)
This method will set the string value to a new one.
Declaration
public static BasicResult SetStringValue(string token, ChangeStringValueToMachineCodeModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
ChangeStringValueToMachineCodeModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/SetStringValue
UploadValues(string, UploadValuesToKeyModel)
This method will extract content from a Cryptolens log (used in offline licensing) and update existing data objects (either by incrementing or decrementing them). To call this method, you either need an "Increment Int Value" and/or "Decrement Int Value" permission, depending on if the log that you submit increases or decreases an int value of a data object. Note: for the time being, the limit of the number of entries in the log is 1000. i.e. IntValue.
Declaration
public static BasicResult UploadValues(string token, UploadValuesToKeyModel parameters)
Parameters
Type | Name | Description |
---|---|---|
string | token | The access token. Read more at https://app.cryptolens.io/docs/api/v3/Auth |
UploadValuesToKeyModel | parameters | The parameters that the method needs |
Returns
Type | Description |
---|---|
BasicResult | Returns ListOfDataObjectsResult or null. |
Remarks
Note: for more details, please see
https://app.cryptolens.io/docs/api/v3/UploadValues