import 'package:cloudflare_dart/api.dart';All URIs are relative to https://api.cloudflare.com/client/v4
| Method | HTTP request | Description |
|---|---|---|
| workerAssetsUpload | POST /accounts/{account_id}/workers/assets/upload | Upload Assets |
| workerDeleteScriptSecret | DELETE /accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name} | Delete script secret |
| workerGetScriptSecret | GET /accounts/{account_id}/workers/scripts/{script_name}/secrets/{secret_name} | Get secret binding |
| workerListScriptSecrets | GET /accounts/{account_id}/workers/scripts/{script_name}/secrets | List script secrets |
| workerPutScriptSecret | PUT /accounts/{account_id}/workers/scripts/{script_name}/secrets | Add script secret |
| workerScriptDeleteSubdomain | DELETE /accounts/{account_id}/workers/scripts/{script_name}/subdomain | Delete Worker subdomain |
| workerScriptDeleteWorker | DELETE /accounts/{account_id}/workers/scripts/{script_name} | Delete Worker |
| workerScriptDownloadWorker | GET /accounts/{account_id}/workers/scripts/{script_name} | Download Worker |
| workerScriptFetchUsageModel | GET /accounts/{account_id}/workers/scripts/{script_name}/usage-model | Fetch Usage Model |
| workerScriptGetContent | GET /accounts/{account_id}/workers/scripts/{script_name}/content/v2 | Get script content |
| workerScriptGetSettings | GET /accounts/{account_id}/workers/scripts/{script_name}/settings | Get Settings |
| workerScriptGetSubdomain | GET /accounts/{account_id}/workers/scripts/{script_name}/subdomain | Get Worker subdomain |
| workerScriptListWorkers | GET /accounts/{account_id}/workers/scripts | List Workers |
| workerScriptPatchSettings | PATCH /accounts/{account_id}/workers/scripts/{script_name}/settings | Patch Settings |
| workerScriptPostSubdomain | POST /accounts/{account_id}/workers/scripts/{script_name}/subdomain | Post Worker subdomain |
| workerScriptPutContent | PUT /accounts/{account_id}/workers/scripts/{script_name}/content | Put script content |
| workerScriptSearchWorkers | GET /accounts/{account_id}/workers/scripts-search | Search Workers |
| workerScriptSettingsGetSettings | GET /accounts/{account_id}/workers/scripts/{script_name}/script-settings | Get Script Settings |
| workerScriptSettingsPatchSettings | PATCH /accounts/{account_id}/workers/scripts/{script_name}/script-settings | Patch Script Settings |
| workerScriptUpdateCreateAssetsUploadSession | POST /accounts/{account_id}/workers/scripts/{script_name}/assets-upload-session | Create Assets Upload Session |
| workerScriptUpdateUsageModel | PUT /accounts/{account_id}/workers/scripts/{script_name}/usage-model | Update Usage Model |
| workerScriptUploadWorkerModule | PUT /accounts/{account_id}/workers/scripts/{script_name} | Upload Worker Module |
WorkersCompletedUploadAssetsResponse workerAssetsUpload(accountId, base64)
Upload Assets
Upload assets ahead of creating a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.
import 'package:cloudflare_dart/api.dart';
// TODO Configure API key authorization: user_service_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('user_service_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('user_service_key').apiKeyPrefix = 'Bearer';
// 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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final bool base64 = true; // bool |
try {
final response = api.workerAssetsUpload(accountId, base64);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerAssetsUpload: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| base64 | bool |
WorkersCompletedUploadAssetsResponse
user_service_key, api_key, api_token, api_email
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersApiResponseNullResult workerDeleteScriptSecret(accountId, scriptName, secretName, urlEncoded)
Delete script secret
Remove a secret from a script.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final String secretName = secretName_example; // String |
final bool urlEncoded = true; // bool |
try {
final response = api.workerDeleteScriptSecret(accountId, scriptName, secretName, urlEncoded);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerDeleteScriptSecret: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| secretName | String | ||
| urlEncoded | bool | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkerPutScriptSecret200Response workerGetScriptSecret(accountId, scriptName, secretName, urlEncoded)
Get secret binding
Get a given secret binding (value omitted) on a script.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final String secretName = secretName_example; // String |
final bool urlEncoded = true; // bool |
try {
final response = api.workerGetScriptSecret(accountId, scriptName, secretName, urlEncoded);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerGetScriptSecret: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| secretName | String | ||
| urlEncoded | bool | [optional] |
WorkerPutScriptSecret200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkerListScriptSecrets200Response workerListScriptSecrets(accountId, scriptName)
List script secrets
List secrets bound to a script.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
try {
final response = api.workerListScriptSecrets(accountId, scriptName);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerListScriptSecrets: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String |
WorkerListScriptSecrets200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkerPutScriptSecret200Response workerPutScriptSecret(accountId, scriptName, workersSecret)
Add script secret
Add a secret to a script.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final WorkersSecret workersSecret = ; // WorkersSecret |
try {
final response = api.workerPutScriptSecret(accountId, scriptName, workersSecret);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerPutScriptSecret: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| workersSecret | WorkersSecret |
WorkerPutScriptSecret200Response
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkerScriptGetSubdomain200Response workerScriptDeleteSubdomain(accountId, scriptName)
Delete Worker subdomain
Disable all workers.dev subdomains for a Worker.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
try {
final response = api.workerScriptDeleteSubdomain(accountId, scriptName);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptDeleteSubdomain: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String |
WorkerScriptGetSubdomain200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersApiResponseNullResult workerScriptDeleteWorker(accountId, scriptName, force)
Delete Worker
Delete your worker. This call has no response body on a successful delete.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final bool force = true; // bool | If set to true, delete will not be stopped by associated service binding, durable object, or other binding. Any of these associated bindings/durable objects will be deleted along with the script.
try {
final response = api.workerScriptDeleteWorker(accountId, scriptName, force);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptDeleteWorker: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| force | bool | If set to true, delete will not be stopped by associated service binding, durable object, or other binding. Any of these associated bindings/durable objects will be deleted along with the script. | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
String workerScriptDownloadWorker(accountId, scriptName)
Download Worker
Fetch raw script content for your worker. Note this is the original script content, not JSON encoded.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
try {
final response = api.workerScriptDownloadWorker(accountId, scriptName);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptDownloadWorker: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String |
String
- Content-Type: Not defined
- Accept: application/javascript, multipart/form-data, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersUsageModelResponse workerScriptFetchUsageModel(accountId, scriptName)
Fetch Usage Model
Fetches the Usage Model for a given Worker.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
try {
final response = api.workerScriptFetchUsageModel(accountId, scriptName);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptFetchUsageModel: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
String workerScriptGetContent(accountId, scriptName)
Get script content
Fetch script content only.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
try {
final response = api.workerScriptGetContent(accountId, scriptName);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptGetContent: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String |
String
- Content-Type: Not defined
- Accept: string, application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersScriptAndVersionSettingsResponse workerScriptGetSettings(accountId, scriptName)
Get Settings
Get metadata and config, such as bindings or usage model.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
try {
final response = api.workerScriptGetSettings(accountId, scriptName);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptGetSettings: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String |
WorkersScriptAndVersionSettingsResponse
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkerScriptGetSubdomain200Response workerScriptGetSubdomain(accountId, scriptName)
Get Worker subdomain
Get if the Worker is available on the workers.dev subdomain.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
try {
final response = api.workerScriptGetSubdomain(accountId, scriptName);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptGetSubdomain: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String |
WorkerScriptGetSubdomain200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersScriptResponseCollection workerScriptListWorkers(accountId, tags)
List Workers
Fetch a list of uploaded workers.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String tags = production:yes,staging:no; // String | Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'.
try {
final response = api.workerScriptListWorkers(accountId, tags);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptListWorkers: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| tags | String | Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'. | [optional] |
WorkersScriptResponseCollection
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersScriptAndVersionSettingsResponse workerScriptPatchSettings(accountId, scriptName, settings)
Patch Settings
Patch metadata or config, such as bindings or usage model.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final WorkersScriptAndVersionSettingsItem settings = ; // WorkersScriptAndVersionSettingsItem |
try {
final response = api.workerScriptPatchSettings(accountId, scriptName, settings);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptPatchSettings: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| settings | WorkersScriptAndVersionSettingsItem | [optional] |
WorkersScriptAndVersionSettingsResponse
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkerScriptGetSubdomain200Response workerScriptPostSubdomain(accountId, scriptName, workerScriptPostSubdomainRequest)
Post Worker subdomain
Enable or disable the Worker on the workers.dev subdomain.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final WorkerScriptPostSubdomainRequest workerScriptPostSubdomainRequest = ; // WorkerScriptPostSubdomainRequest |
try {
final response = api.workerScriptPostSubdomain(accountId, scriptName, workerScriptPostSubdomainRequest);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptPostSubdomain: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| workerScriptPostSubdomainRequest | WorkerScriptPostSubdomainRequest |
WorkerScriptGetSubdomain200Response
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersScriptResponseSingle workerScriptPutContent(accountId, scriptName, metadata, CF_WORKER_BODY_PART, CF_WORKER_MAIN_MODULE_PART, files)
Put script content
Put script content without touching config or metadata.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final WorkerScriptPutContentRequestMetadata metadata = ; // WorkerScriptPutContentRequestMetadata |
final String CF_WORKER_BODY_PART = CF_WORKER_BODY_PART_example; // String | The multipart name of a script upload part containing script content in service worker format. Alternative to including in a metadata part.
final String CF_WORKER_MAIN_MODULE_PART = CF_WORKER_MAIN_MODULE_PART_example; // String | The multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part.
final BuiltList<MultipartFile> files = /path/to/file.txt; // BuiltList<MultipartFile> | An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/>Possible Content-Type(s) are: `application/javascript+module`, `text/javascript+module`, `application/javascript`, `text/javascript`, `text/x-python`, `text/x-python-requirement`, `application/wasm`, `text/plain`, `application/octet-stream`, `application/source-map`.
try {
final response = api.workerScriptPutContent(accountId, scriptName, metadata, CF_WORKER_BODY_PART, CF_WORKER_MAIN_MODULE_PART, files);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptPutContent: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| metadata | WorkerScriptPutContentRequestMetadata | ||
| CF_WORKER_BODY_PART | String | The multipart name of a script upload part containing script content in service worker format. Alternative to including in a metadata part. | [optional] |
| CF_WORKER_MAIN_MODULE_PART | String | The multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part. | [optional] |
| files | BuiltList<MultipartFile> | An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as main_module or body_part by filename.Possible Content-Type(s) are: application/javascript+module, text/javascript+module, application/javascript, text/javascript, text/x-python, text/x-python-requirement, application/wasm, text/plain, application/octet-stream, application/source-map. |
[optional] |
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkerScriptSearchWorkers200Response workerScriptSearchWorkers(accountId, name, id, orderBy, page, perPage)
Search Workers
Search for Workers in an account.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String name = my-worker; // String |
final String id = bdf3567828824b74aadd550004cf4913; // String |
final String orderBy = created_on; // String |
final int page = 56; // int | Current page.
final int perPage = 56; // int | Items per page.
try {
final response = api.workerScriptSearchWorkers(accountId, name, id, orderBy, page, perPage);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptSearchWorkers: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| name | String | [optional] | |
| id | String | [optional] | |
| orderBy | String | [optional] [default to 'name'] | |
| page | int | Current page. | [optional] [default to 1] |
| perPage | int | Items per page. | [optional] [default to 10] |
WorkerScriptSearchWorkers200Response
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersScriptSettingsResponse workerScriptSettingsGetSettings(accountId, scriptName)
Get Script Settings
Get script-level settings when using Worker Versions. Includes Logpush and Tail Consumers.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
try {
final response = api.workerScriptSettingsGetSettings(accountId, scriptName);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptSettingsGetSettings: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersScriptSettingsResponse workerScriptSettingsPatchSettings(accountId, scriptName, workersScriptSettingsItem)
Patch Script Settings
Patch script-level settings when using Worker Versions. Including but not limited to Logpush and Tail Consumers.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final WorkersScriptSettingsItem workersScriptSettingsItem = ; // WorkersScriptSettingsItem |
try {
final response = api.workerScriptSettingsPatchSettings(accountId, scriptName, workersScriptSettingsItem);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptSettingsPatchSettings: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| workersScriptSettingsItem | WorkersScriptSettingsItem |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersCreateAssetsUploadSessionResponse workerScriptUpdateCreateAssetsUploadSession(accountId, scriptName, workersCreateAssetsUploadSessionObject)
Create Assets Upload Session
Start uploading a collection of assets for use in a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final WorkersCreateAssetsUploadSessionObject workersCreateAssetsUploadSessionObject = ; // WorkersCreateAssetsUploadSessionObject |
try {
final response = api.workerScriptUpdateCreateAssetsUploadSession(accountId, scriptName, workersCreateAssetsUploadSessionObject);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptUpdateCreateAssetsUploadSession: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| workersCreateAssetsUploadSessionObject | WorkersCreateAssetsUploadSessionObject |
WorkersCreateAssetsUploadSessionResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkersUsageModelResponse workerScriptUpdateUsageModel(accountId, scriptName, workerScriptUpdateUsageModelRequest)
Update Usage Model
Updates the Usage Model for a given Worker. Requires a Workers Paid subscription.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final WorkerScriptUpdateUsageModelRequest workerScriptUpdateUsageModelRequest = ; // WorkerScriptUpdateUsageModelRequest |
try {
final response = api.workerScriptUpdateUsageModel(accountId, scriptName, workerScriptUpdateUsageModelRequest);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptUpdateUsageModel: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| workerScriptUpdateUsageModelRequest | WorkerScriptUpdateUsageModelRequest |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
NamespaceWorkerScriptUploadWorkerModule200Response workerScriptUploadWorkerModule(accountId, scriptName, body)
Upload Worker Module
Upload a worker module. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.
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().getWorkerScriptApi();
final String accountId = accountId_example; // String |
final String scriptName = scriptName_example; // String |
final String body = body_example; // String |
try {
final response = api.workerScriptUploadWorkerModule(accountId, scriptName, body);
print(response);
} catch on DioException (e) {
print('Exception when calling WorkerScriptApi->workerScriptUploadWorkerModule: $e\n');
}| Name | Type | Description | Notes |
|---|---|---|---|
| accountId | String | ||
| scriptName | String | ||
| body | String |
NamespaceWorkerScriptUploadWorkerModule200Response
- Content-Type: application/javascript, multipart/form-data, text/javascript
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]