Skip to content

Latest commit

 

History

History
517 lines (377 loc) · 21 KB

File metadata and controls

517 lines (377 loc) · 21 KB

cloudflare_dart.api.FirewallRulesApi

Load the API package

import 'package:cloudflare_dart/api.dart';

All URIs are relative to https://api.cloudflare.com/client/v4

Method HTTP request Description
firewallRulesCreateFirewallRules POST /zones/{zone_id}/firewall/rules Create firewall rules
firewallRulesDeleteAFirewallRule DELETE /zones/{zone_id}/firewall/rules/{rule_id} Delete a firewall rule
firewallRulesDeleteFirewallRules DELETE /zones/{zone_id}/firewall/rules Delete firewall rules
firewallRulesGetAFirewallRule GET /zones/{zone_id}/firewall/rules/{rule_id} Get a firewall rule
firewallRulesListFirewallRules GET /zones/{zone_id}/firewall/rules List firewall rules
firewallRulesUpdateAFirewallRule PUT /zones/{zone_id}/firewall/rules/{rule_id} Update a firewall rule
firewallRulesUpdateFirewallRules PUT /zones/{zone_id}/firewall/rules Update firewall rules
firewallRulesUpdatePriorityOfAFirewallRule PATCH /zones/{zone_id}/firewall/rules/{rule_id} Update priority of a firewall rule
firewallRulesUpdatePriorityOfFirewallRules PATCH /zones/{zone_id}/firewall/rules Update priority of firewall rules

firewallRulesCreateFirewallRules

FirewallFilterRulesResponseCollection firewallRulesCreateFirewallRules(zoneId, firewallRulesCreateFirewallRulesRequest)

Create firewall rules

Create one or more firewall rules.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String zoneId = zoneId_example; // String | 
final FirewallRulesCreateFirewallRulesRequest firewallRulesCreateFirewallRulesRequest = ; // FirewallRulesCreateFirewallRulesRequest | 

try {
    final response = api.firewallRulesCreateFirewallRules(zoneId, firewallRulesCreateFirewallRulesRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesCreateFirewallRules: $e\n');
}

Parameters

Name Type Description Notes
zoneId String
firewallRulesCreateFirewallRulesRequest FirewallRulesCreateFirewallRulesRequest

Return type

FirewallFilterRulesResponseCollection

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firewallRulesDeleteAFirewallRule

FirewallFilterRulesSingleResponseDelete firewallRulesDeleteAFirewallRule(ruleId, zoneId, firewallRulesDeleteAFirewallRuleRequest)

Delete a firewall rule

Deletes an existing firewall rule.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String ruleId = ruleId_example; // String | 
final String zoneId = zoneId_example; // String | 
final FirewallRulesDeleteAFirewallRuleRequest firewallRulesDeleteAFirewallRuleRequest = ; // FirewallRulesDeleteAFirewallRuleRequest | 

try {
    final response = api.firewallRulesDeleteAFirewallRule(ruleId, zoneId, firewallRulesDeleteAFirewallRuleRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesDeleteAFirewallRule: $e\n');
}

Parameters

Name Type Description Notes
ruleId String
zoneId String
firewallRulesDeleteAFirewallRuleRequest FirewallRulesDeleteAFirewallRuleRequest

Return type

FirewallFilterRulesSingleResponseDelete

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firewallRulesDeleteFirewallRules

FirewallFilterRulesResponseCollectionDelete firewallRulesDeleteFirewallRules(zoneId, firewallRulesDeleteFirewallRulesRequest)

Delete firewall rules

Deletes existing firewall rules.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String zoneId = zoneId_example; // String | 
final FirewallRulesDeleteFirewallRulesRequest firewallRulesDeleteFirewallRulesRequest = ; // FirewallRulesDeleteFirewallRulesRequest | 

try {
    final response = api.firewallRulesDeleteFirewallRules(zoneId, firewallRulesDeleteFirewallRulesRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesDeleteFirewallRules: $e\n');
}

Parameters

Name Type Description Notes
zoneId String
firewallRulesDeleteFirewallRulesRequest FirewallRulesDeleteFirewallRulesRequest

Return type

FirewallFilterRulesResponseCollectionDelete

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firewallRulesGetAFirewallRule

FirewallFilterRulesSingleResponse firewallRulesGetAFirewallRule(ruleId, zoneId, id)

Get a firewall rule

Fetches the details of a firewall rule.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String ruleId = ruleId_example; // String | 
final String zoneId = zoneId_example; // String | 
final String id = ; // String | 

try {
    final response = api.firewallRulesGetAFirewallRule(ruleId, zoneId, id);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesGetAFirewallRule: $e\n');
}

Parameters

Name Type Description Notes
ruleId String
zoneId String
id String [optional]

Return type

FirewallFilterRulesSingleResponse

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firewallRulesListFirewallRules

FirewallFilterRulesResponseCollection firewallRulesListFirewallRules(zoneId, description, action, page, perPage, id, paused)

List firewall rules

Fetches firewall rules in a zone. You can filter the results using several optional parameters.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String zoneId = zoneId_example; // String | 
final String description = mir; // String | 
final String action = block; // String | 
final num page = 8.14; // num | 
final num perPage = 8.14; // num | 
final String id = 372e67954025e0ba6aaa6d586b9e0b60; // String | 
final bool paused = false; // bool | 

try {
    final response = api.firewallRulesListFirewallRules(zoneId, description, action, page, perPage, id, paused);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesListFirewallRules: $e\n');
}

Parameters

Name Type Description Notes
zoneId String
description String [optional]
action String [optional]
page num [optional] [default to 1]
perPage num [optional] [default to 25]
id String [optional]
paused bool [optional]

Return type

FirewallFilterRulesResponseCollection

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firewallRulesUpdateAFirewallRule

FirewallFilterRulesSingleResponse firewallRulesUpdateAFirewallRule(ruleId, zoneId, firewallRulesUpdateAFirewallRuleRequest)

Update a firewall rule

Updates an existing firewall rule.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String ruleId = ruleId_example; // String | 
final String zoneId = zoneId_example; // String | 
final FirewallRulesUpdateAFirewallRuleRequest firewallRulesUpdateAFirewallRuleRequest = ; // FirewallRulesUpdateAFirewallRuleRequest | 

try {
    final response = api.firewallRulesUpdateAFirewallRule(ruleId, zoneId, firewallRulesUpdateAFirewallRuleRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesUpdateAFirewallRule: $e\n');
}

Parameters

Name Type Description Notes
ruleId String
zoneId String
firewallRulesUpdateAFirewallRuleRequest FirewallRulesUpdateAFirewallRuleRequest

Return type

FirewallFilterRulesSingleResponse

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firewallRulesUpdateFirewallRules

FirewallFilterRulesResponseCollection firewallRulesUpdateFirewallRules(zoneId, body)

Update firewall rules

Updates one or more existing firewall rules.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String zoneId = zoneId_example; // String | 
final JsonObject body = ; // JsonObject | 

try {
    final response = api.firewallRulesUpdateFirewallRules(zoneId, body);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesUpdateFirewallRules: $e\n');
}

Parameters

Name Type Description Notes
zoneId String
body JsonObject

Return type

FirewallFilterRulesResponseCollection

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firewallRulesUpdatePriorityOfAFirewallRule

FirewallFilterRulesResponseCollection firewallRulesUpdatePriorityOfAFirewallRule(ruleId, zoneId, firewallRulesUpdatePriorityOfAFirewallRuleRequest)

Update priority of a firewall rule

Updates the priority of an existing firewall rule.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String ruleId = ruleId_example; // String | 
final String zoneId = zoneId_example; // String | 
final FirewallRulesUpdatePriorityOfAFirewallRuleRequest firewallRulesUpdatePriorityOfAFirewallRuleRequest = ; // FirewallRulesUpdatePriorityOfAFirewallRuleRequest | 

try {
    final response = api.firewallRulesUpdatePriorityOfAFirewallRule(ruleId, zoneId, firewallRulesUpdatePriorityOfAFirewallRuleRequest);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesUpdatePriorityOfAFirewallRule: $e\n');
}

Parameters

Name Type Description Notes
ruleId String
zoneId String
firewallRulesUpdatePriorityOfAFirewallRuleRequest FirewallRulesUpdatePriorityOfAFirewallRuleRequest

Return type

FirewallFilterRulesResponseCollection

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

firewallRulesUpdatePriorityOfFirewallRules

FirewallFilterRulesResponseCollection firewallRulesUpdatePriorityOfFirewallRules(zoneId, body)

Update priority of firewall rules

Updates the priority of existing firewall rules.

Example

import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_email
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_email').apiKeyPrefix = 'Bearer';

final api = CloudflareDart().getFirewallRulesApi();
final String zoneId = zoneId_example; // String | 
final JsonObject body = ; // JsonObject | 

try {
    final response = api.firewallRulesUpdatePriorityOfFirewallRules(zoneId, body);
    print(response);
} catch on DioException (e) {
    print('Exception when calling FirewallRulesApi->firewallRulesUpdatePriorityOfFirewallRules: $e\n');
}

Parameters

Name Type Description Notes
zoneId String
body JsonObject

Return type

FirewallFilterRulesResponseCollection

Authorization

api_key, api_token, api_email

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]