Skip to content

Latest commit

 

History

History
179 lines (129 loc) · 7.25 KB

File metadata and controls

179 lines (129 loc) · 7.25 KB

cloudflare_dart.api.EnvironmentVariablesApi

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
deleteEnvironmentVariable DELETE /accounts/{account_id}/builds/triggers/{trigger_uuid}/environment_variables/{environment_variable_key} Delete environment variable
listEnvironmentVariables GET /accounts/{account_id}/builds/triggers/{trigger_uuid}/environment_variables List environment variables
upsertEnvironmentVariables PATCH /accounts/{account_id}/builds/triggers/{trigger_uuid}/environment_variables Upsert environment variables

deleteEnvironmentVariable

BuildsAPIResponse deleteEnvironmentVariable(accountId, triggerUuid, environmentVariableKey)

Delete environment variable

Remove a specific environment variable from a trigger

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().getEnvironmentVariablesApi();
final String accountId = account-123; // String | Account identifier
final String triggerUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Trigger UUID
final String environmentVariableKey = NODE_ENV; // String | Environment variable key

try {
    final response = api.deleteEnvironmentVariable(accountId, triggerUuid, environmentVariableKey);
    print(response);
} catch on DioException (e) {
    print('Exception when calling EnvironmentVariablesApi->deleteEnvironmentVariable: $e\n');
}

Parameters

Name Type Description Notes
accountId String Account identifier
triggerUuid String Trigger UUID
environmentVariableKey String Environment variable key

Return type

BuildsAPIResponse

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]

listEnvironmentVariables

ListEnvironmentVariables200Response listEnvironmentVariables(accountId, triggerUuid)

List environment variables

Get all environment variables for a trigger

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().getEnvironmentVariablesApi();
final String accountId = account-123; // String | Account identifier
final String triggerUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Trigger UUID

try {
    final response = api.listEnvironmentVariables(accountId, triggerUuid);
    print(response);
} catch on DioException (e) {
    print('Exception when calling EnvironmentVariablesApi->listEnvironmentVariables: $e\n');
}

Parameters

Name Type Description Notes
accountId String Account identifier
triggerUuid String Trigger UUID

Return type

ListEnvironmentVariables200Response

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]

upsertEnvironmentVariables

ListEnvironmentVariables200Response upsertEnvironmentVariables(accountId, triggerUuid, requestBody)

Upsert environment variables

Create or update environment variables for a trigger

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().getEnvironmentVariablesApi();
final String accountId = account-123; // String | Account identifier
final String triggerUuid = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | Trigger UUID
final BuiltMap<String, BuildsEnvironmentVariablesRequestValue> requestBody = ; // BuiltMap<String, BuildsEnvironmentVariablesRequestValue> | 

try {
    final response = api.upsertEnvironmentVariables(accountId, triggerUuid, requestBody);
    print(response);
} catch on DioException (e) {
    print('Exception when calling EnvironmentVariablesApi->upsertEnvironmentVariables: $e\n');
}

Parameters

Name Type Description Notes
accountId String Account identifier
triggerUuid String Trigger UUID
requestBody BuiltMap<String, BuildsEnvironmentVariablesRequestValue>

Return type

ListEnvironmentVariables200Response

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]