Difference between revisions of "Quarantine class"

From Catglobe Wiki
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{CGscriptClass_Template
 
{{CGscriptClass_Template
|Name=<nowiki>QuestionnaireResourceTemplate</nowiki>
+
|Name=<nowiki>Quarantine</nowiki>
|Description=<nowiki>A Questionnaire resource template.</nowiki>
+
|Description=<nowiki>A quarantine prohibiting bulkmails and bulksms from being sent to user.</nowiki>
|InheritsFrom=ResourceTemplate|Constructors=
+
|InheritsFrom=object|Constructors=
 
{{CGscriptConstructors_Template|Parameters=
 
{{CGscriptConstructors_Template|Parameters=
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Resource name</nowiki>}}
+
{{CGscriptParameters_Template|Type=int|Name=<nowiki>ResourceId</nowiki>|Description=<nowiki>Resource Id of the Quarantine</nowiki>}}
|Description=<nowiki>Create a new Questionnaire resource template</nowiki>}}
+
|Description=<nowiki>Instanciate an existing instance using the resource id of a Quarantine</nowiki>}}
 +
{{CGscriptConstructors_Template|Parameters=
 +
{{CGscriptParameters_Template|Type=string|Name=<nowiki>name</nowiki>|Description=<nowiki>Resource name</nowiki>|Comma=,}}{{CGscriptParameters_Template|Type=int|Name=<nowiki>parentResourceId</nowiki>|Description=<nowiki>Parent resource.</nowiki>}}
 +
|Description=<nowiki>Instanciate a new instance</nowiki>}}
 
|Methods=
 
|Methods=
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>DefaultLanguage</nowiki>|Inherited=ResourceTemplate|Parameters=
+
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Description=<nowiki>Save the ResourceTemplate resource</nowiki>}}
{{CGscriptParameters_Template|Type=string|Name=<nowiki>isocode</nowiki>|Description=<nowiki>Iso code to set as default</nowiki>}}
 
|Description=<nowiki>Which Localized Name is the default</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>Save</nowiki>|Inherited=ResourceTemplate|Description=<nowiki>Save the ResourceTemplate resource</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=Empty|Name=<nowiki>SaveProperties</nowiki>|Inherited=ResourceTemplate|Description=<nowiki>Save the properties of the ResourceTemplate resource. Ignores changes to all constant options in use</nowiki>}}
 
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
{{CGscriptMethods_Template|ReturnType=string|Name=<nowiki>ToString</nowiki>|Inherited=object|Description=<nowiki>The string representation of the object.</nowiki>}}
 
|Properties=
 
|Properties=
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ErrorScriptResourceId</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Set the OnError script</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>Duration</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Number of seconds the quarantine is enforced in seconds</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>GatewayScriptResourceId</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Set the gateway script</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>Name</nowiki>|HasGetter=1|HasSetter=1|Description=<nowiki>Name of the Quarantine resource</nowiki>}}
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>LocalizedName</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>Localized Name for current user of the ResourceTemplate resource</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=Dictionary|Name=<nowiki>LocalizedNames</nowiki>|HasGetter=1|HasSetter=1|Inherited=ResourceTemplate|Description=<nowiki>Localized Name of the ResourceTemplate resource</nowiki>}}
 
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ObjectTypeName</nowiki>|HasGetter=1|Description=<nowiki>The name of the type of object.</nowiki>}}
{{CGscriptProperties_Template|ReturnType=array|Name=<nowiki>Properties</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>Get the list of current properties. Use AddProperty/RemoveProperty to edit order</nowiki>}}
+
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceId</nowiki>|HasGetter=1|Description=<nowiki>The Id of the Quarantine</nowiki>}}
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceId</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>The Id of the ResourceTemplate</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=string|Name=<nowiki>ResourceName</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>Name of the ResourceTemplate resource</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=int|Name=<nowiki>ResourceTemplateType</nowiki>|HasGetter=1|Inherited=ResourceTemplate|Description=<nowiki>The type of resource that this ResourceTemplate covers</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=bool|Name=<nowiki>ResourceTimeregEnabled</nowiki>|HasGetter=1|HasSetter=1|Inherited=ResourceTemplate|Description=<nowiki>Get/set ResourceTimeregEnabled</nowiki>}}
 
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=<nowiki>TypeInformation</nowiki>|HasGetter=1|Inherited=object|Description=<nowiki>Get information about this class.</nowiki>}}
 
}}
 
}}

Latest revision as of 06:14, 2 July 2020

Quarantine



A quarantine prohibiting bulkmails and bulksms from being sent to user.

Parent class

Inherits from object

Constructors

  • (int ResourceId "Resource Id of the Quarantine") - Instanciate an existing instance using the resource id of a Quarantine
  • (string name "Resource name", int parentResourceId "Parent resource.") - Instanciate a new instance

Methods

  • Empty Save() - Save the ResourceTemplate resource
  • (From object) string ToString() - The string representation of the object.

Properties

  • int 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.
  • int ResourceId { get; } - The Id of the Quarantine
  • (From object) 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();