Difference between revisions of "Quarantine class"
m (Reverted edits by Administrator (talk) to last revision by Tranvuthaibinh) (Tag: Rollback) |
|||
Line 1: | Line 1: | ||
{{CGscriptClass_Template | {{CGscriptClass_Template | ||
− | |Name= | + | |Name=Quarantine |
− | |Description= | + | |Description=A quarantine prohibiting bulkmails and bulksms from being sent to user. |
− | + | |Constructors= | |
{{CGscriptConstructors_Template|Parameters= | {{CGscriptConstructors_Template|Parameters= | ||
− | {{CGscriptParameters_Template|Type=string|Name= | + | {{CGscriptParameters_Template|Type=number|Name=ResourceId|Description=Resource Id of the Quarantine}} |
− | |Description= | + | |Description=Instanciate an existing instance using the resource id of a Quarantine}} |
+ | {{CGscriptConstructors_Template|Parameters= | ||
+ | {{CGscriptParameters_Template|Type=string|Name=name|Description=Resource name|Comma=,}}{{CGscriptParameters_Template|Type=number|Name=parentResourceId|Description=Parent resource.}} | ||
+ | |Description=Instanciate a new instance}} | ||
|Methods= | |Methods= | ||
− | {{CGscriptMethods_Template|ReturnType=Empty|Name= | + | {{CGscriptMethods_Template|ReturnType=Empty|Name=Save|Description=Save the ResourceTemplate resource}} |
− | + | {{CGscriptMethods_Template|ReturnType=string|Name=ToString|Description=The string representation of the object.}} | |
− | |||
− | |||
− | |||
− | {{CGscriptMethods_Template|ReturnType=string|Name= | ||
|Properties= | |Properties= | ||
− | {{CGscriptProperties_Template|ReturnType= | + | {{CGscriptProperties_Template|ReturnType=number|Name=Duration|HasGetter=1|HasSetter=1|Description=Number of seconds the quarantine is enforced in seconds}} |
− | + | {{CGscriptProperties_Template|ReturnType=string|Name=Name|HasGetter=1|HasSetter=1|Description=Name of the Quarantine resource}} | |
− | {{CGscriptProperties_Template|ReturnType=string|Name= | + | {{CGscriptProperties_Template|ReturnType=string|Name=ObjectTypeName|HasGetter=1|Description=The name of the type of object.}} |
− | + | {{CGscriptProperties_Template|ReturnType=number|Name=ResourceId|HasGetter=1|Description=The Id of the Quarantine}} | |
− | {{CGscriptProperties_Template|ReturnType=string|Name= | + | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}} |
− | |||
− | {{CGscriptProperties_Template|ReturnType= | ||
− | |||
− | |||
− | |||
− | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name= | ||
}} | }} | ||
Revision as of 06:13, 2 July 2020
Quarantine
A quarantine prohibiting bulkmails and bulksms from being sent to user.
Constructors
- (number ResourceId "Resource Id of the Quarantine") - Instanciate an existing instance using the resource id of a Quarantine
- (string name "Resource name", number parentResourceId "Parent resource.") - Instanciate a new instance
Methods
- Empty Save() - Save the ResourceTemplate resource
- string ToString() - The string representation of the object.
Properties
- number Duration { get; set; } - Number of seconds the quarantine is enforced in seconds
- string Name { get; set; } - Name of the Quarantine resource
- string ObjectTypeName { get; } - The name of the type of object.
- number ResourceId { get; } - The Id of the Quarantine
- TypeInformation TypeInformation { get; } - Get information about this class.
Examples
//Get data from a quarantine exist in quarantine resource list
Quarantine Q = new Quarantine(15525566);
print(Q.Duration); //2400
print(Q.Name); //NewQuarantine3
print(Q.ObjectTypeName); //Quarantine
print(Q.ResourceId); //15525566
//Edit data from a quarantine exist in quarantine resource list
Quarantine Q = new Quarantine(15525401);
Q.Duration=1000;
Q.Name="NewName";
Q.Save();
//Create a new quarantine
//Ex 1:
Quarantine Q = new Quarantine("LastName1",15502953);
Q.Duration=200;
Q.Save();
//Ex 2:
Quarantine Q = new Quarantine("",15502953);
Q.Duration=300;
Q.Name = "LastName2";
Q.Save();
//Ex 3:
Quarantine Q = new Quarantine("FirstName3",15502953);
Q.Duration=500;
Q.Name = "LastName3";
Q.Save();