// This file is auto-generated, don't edit it import * as $dara from '@darabonba/typescript'; export class CreateAScriptsRequestAScriptsExtAttributes extends $dara.Model { /** * @remarks * The attribute key. * * The only valid value is **EsDebug**. If a request contains the _es_dbg parameter and its value matches the secret key specified in AttributeValue, the system adds a debug header to the response, which contains rule execution logs. * * @example * EsDebug */ attributeKey?: string; /** * @remarks * The attribute value, which is used as the secret key for the EsDebug attribute. The value must be 1 to 128 characters long and can contain uppercase letters, lowercase letters, and digits. * * @example * test123 */ attributeValue?: string; static names(): { [key: string]: string } { return { attributeKey: 'AttributeKey', attributeValue: 'AttributeValue', }; } static types(): { [key: string]: any } { return { attributeKey: 'string', attributeValue: 'string', }; } validate() { super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateAScriptsRequestAScripts extends $dara.Model { /** * @remarks * The name of the AScript. * * The name must be 2 to 128 characters long, and must start with a letter, a digit, or a Chinese character. It can contain digits, periods (.), underscores (_), hyphens (-), and spaces. * * This parameter is required. * * @example * test */ AScriptName?: string; /** * @remarks * Specifies whether the AScript is enabled. Valid values: * * - **true**: Enabled. * * - **false** (default): Disabled. * * @example * false */ enabled?: boolean; /** * @remarks * Specifies whether to enable extended attributes for the AScript. Valid values: * * - **true**: Enabled. * * - **false** (default): Disabled. * * @example * true */ extAttributeEnabled?: boolean; /** * @remarks * The extended attributes. */ extAttributes?: CreateAScriptsRequestAScriptsExtAttributes[]; /** * @remarks * Specifies when the AScript is executed. Valid values: * * - **RequestHead** (default): Executes before request rules. * * - **RequestFoot**: Executes after request rules. * * - **ResponseHead**: Executes before response rules. * * @example * RequestFoot */ position?: string; /** * @remarks * The content of the AScript. * * This parameter is required. * * @example * if and(match_re($uri, \\"^/1.txt$\\"), $arg_type) { rewrite(concat(\\"/1.\\", $arg_type), \\"break\\") } */ scriptContent?: string; static names(): { [key: string]: string } { return { AScriptName: 'AScriptName', enabled: 'Enabled', extAttributeEnabled: 'ExtAttributeEnabled', extAttributes: 'ExtAttributes', position: 'Position', scriptContent: 'ScriptContent', }; } static types(): { [key: string]: any } { return { AScriptName: 'string', enabled: 'boolean', extAttributeEnabled: 'boolean', extAttributes: { 'type': 'array', 'itemType': CreateAScriptsRequestAScriptsExtAttributes }, position: 'string', scriptContent: 'string', }; } validate() { if(Array.isArray(this.extAttributes)) { $dara.Model.validateArray(this.extAttributes); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } } export class CreateAScriptsRequest extends $dara.Model { /** * @remarks * The AScripts to create. */ AScripts?: CreateAScriptsRequestAScripts[]; /** * @remarks * A client token used to ensure request idempotency. * * You can generate this value on your client. The value must be unique across requests and contain only ASCII characters. * * @example * 5A2CFF0E-5718-45B5-9D4D-70B****** */ clientToken?: string; /** * @remarks * Specifies whether to perform a dry run. Valid values: * * - **true**: performs a dry run without creating the AScript. The system checks the request for required parameters, format validity, and service limits. If the request fails the check, an error message is returned. If the request passes the check, the `DryRunOperation` error code is returned. * * - **false** (default): sends a normal request. After the request passes the check, the system returns an HTTP 2xx status code and performs the operation. * * @example * false */ dryRun?: boolean; /** * @remarks * The listener ID. * * This parameter is required. * * @example * lsn-6hfq3zs0x04ibn**** */ listenerId?: string; static names(): { [key: string]: string } { return { AScripts: 'AScripts', clientToken: 'ClientToken', dryRun: 'DryRun', listenerId: 'ListenerId', }; } static types(): { [key: string]: any } { return { AScripts: { 'type': 'array', 'itemType': CreateAScriptsRequestAScripts }, clientToken: 'string', dryRun: 'boolean', listenerId: 'string', }; } validate() { if(Array.isArray(this.AScripts)) { $dara.Model.validateArray(this.AScripts); } super.validate(); } constructor(map?: { [key: string]: any }) { super(map); } }