33import * as Core from '../../../core' ;
44import { APIResource } from '../../../resource' ;
55import * as SchemaValidationAPI from './schema-validation' ;
6+ import * as SettingsAPI from './settings' ;
67
78export class SchemaValidation extends APIResource {
89 /**
910 * Updates zone level schema validation settings on the zone
1011 */
11- update ( params : SchemaValidationUpdateParams , options ?: Core . RequestOptions ) : Core . APIPromise < Settings > {
12+ update (
13+ params : SchemaValidationUpdateParams ,
14+ options ?: Core . RequestOptions ,
15+ ) : Core . APIPromise < SettingsAPI . Settings > {
1216 const { zone_id, ...body } = params ;
1317 return this . _client . put ( `/zones/${ zone_id } /api_gateway/settings/schema_validation` , { body, ...options } ) ;
1418 }
1519
20+ /**
21+ * Updates zone level schema validation settings on the zone
22+ */
23+ edit (
24+ params : SchemaValidationEditParams ,
25+ options ?: Core . RequestOptions ,
26+ ) : Core . APIPromise < SettingsAPI . Settings > {
27+ const { zone_id, ...body } = params ;
28+ return this . _client . patch ( `/zones/${ zone_id } /api_gateway/settings/schema_validation` , {
29+ body,
30+ ...options ,
31+ } ) ;
32+ }
33+
1634 /**
1735 * Retrieves zone level schema validation settings currently set on the zone
1836 */
19- get ( params : SchemaValidationGetParams , options ?: Core . RequestOptions ) : Core . APIPromise < Settings > {
37+ get (
38+ params : SchemaValidationGetParams ,
39+ options ?: Core . RequestOptions ,
40+ ) : Core . APIPromise < SettingsAPI . Settings > {
2041 const { zone_id } = params ;
2142 return this . _client . get ( `/zones/${ zone_id } /api_gateway/settings/schema_validation` , options ) ;
2243 }
2344}
2445
25- export interface Settings {
46+ export interface SchemaValidationUpdateParams {
2647 /**
27- * The default mitigation action used when there is no mitigation action defined on
28- * the operation
48+ * Path param: Identifier
49+ */
50+ zone_id : string ;
51+
52+ /**
53+ * Body param: The default mitigation action used when there is no mitigation
54+ * action defined on the operation
2955 *
3056 * Mitigation actions are as follows:
3157 *
@@ -35,45 +61,49 @@ export interface Settings {
3561 * A special value of of `none` will skip running schema validation entirely for
3662 * the request when there is no mitigation action defined on the operation
3763 */
38- validation_default_mitigation_action ? : 'none' | 'log' | 'block' ;
64+ validation_default_mitigation_action : 'none' | 'log' | 'block' ;
3965
4066 /**
41- * When set, this overrides both zone level and operation level mitigation actions.
67+ * Body param: When set, this overrides both zone level and operation level
68+ * mitigation actions.
4269 *
4370 * - `none` will skip running schema validation entirely for the request
4471 * - `null` indicates that no override is in place
72+ *
73+ * To clear any override, use the special value `disable_override` or `null`
4574 */
46- validation_override_mitigation_action ?: 'none' | null ;
75+ validation_override_mitigation_action ?: 'none' | 'disable_override' | null ;
4776}
4877
49- export interface SchemaValidationUpdateParams {
78+ export interface SchemaValidationEditParams {
5079 /**
5180 * Path param: Identifier
5281 */
5382 zone_id : string ;
5483
5584 /**
5685 * Body param: The default mitigation action used when there is no mitigation
57- * action defined on the operation
58- *
59- * Mitigation actions are as follows:
86+ * action defined on the operation Mitigation actions are as follows:
6087 *
6188 * - `log` - log request when request does not conform to schema
6289 * - `block` - deny access to the site when request does not conform to schema
6390 *
6491 * A special value of of `none` will skip running schema validation entirely for
6592 * the request when there is no mitigation action defined on the operation
93+ *
94+ * `null` will have no effect.
6695 */
67- validation_default_mitigation_action : 'none' | 'log' | 'block' ;
96+ validation_default_mitigation_action ? : 'none' | 'log' | 'block' | null ;
6897
6998 /**
7099 * Body param: When set, this overrides both zone level and operation level
71100 * mitigation actions.
72101 *
73102 * - `none` will skip running schema validation entirely for the request
74- * - `null` indicates that no override is in place
75103 *
76- * To clear any override, use the special value `disable_override` or `null`
104+ * To clear any override, use the special value `disable_override`
105+ *
106+ * `null` will have no effect.
77107 */
78108 validation_override_mitigation_action ?: 'none' | 'disable_override' | null ;
79109}
@@ -86,7 +116,7 @@ export interface SchemaValidationGetParams {
86116}
87117
88118export namespace SchemaValidation {
89- export import Settings = SchemaValidationAPI . Settings ;
90119 export import SchemaValidationUpdateParams = SchemaValidationAPI . SchemaValidationUpdateParams ;
120+ export import SchemaValidationEditParams = SchemaValidationAPI . SchemaValidationEditParams ;
91121 export import SchemaValidationGetParams = SchemaValidationAPI . SchemaValidationGetParams ;
92122}
0 commit comments