Functions class

The Functions Service allows you view, create and manage your Cloud Functions.

Constructors

Functions.new(Client client)

Properties

client Client
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

create({required String functionId, required String name, required Runtime runtime, List<String>? execute, List<String>? events, String? schedule, int? timeout, bool? enabled, bool? logging, String? entrypoint, String? commands, List<String>? scopes, String? installationId, String? providerRepositoryId, String? providerBranch, bool? providerSilentMode, String? providerRootDirectory, String? specification}) Future<Func>
Create a new function. You can pass a list of permissions to allow different project users or team with access to execute the function using the client API.
createDeployment({required String functionId, required InputFile code, required bool activate, String? entrypoint, String? commands, dynamic onProgress(UploadProgress)?}) Future<Deployment>
Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID.
createDuplicateDeployment({required String functionId, required String deploymentId, String? buildId}) Future<Deployment>
Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
createExecution({required String functionId, String? body, bool? xasync, String? path, ExecutionMethod? method, Map? headers, String? scheduledAt}) Future<Execution>
Trigger a function execution. The returned object will return you the current execution status. You can ping the Get Execution endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
createTemplateDeployment({required String functionId, required String repository, required String owner, required String rootDirectory, required String version, bool? activate}) Future<Deployment>
Create a deployment based on a template.
createVariable({required String functionId, required String key, required String value, bool? secret}) Future<Variable>
Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
createVcsDeployment({required String functionId, required VCSDeploymentType type, required String reference, bool? activate}) Future<Deployment>
Create a deployment when a function is connected to VCS.
delete({required String functionId}) Future
Delete a function by its unique ID.
deleteDeployment({required String functionId, required String deploymentId}) Future
Delete a code deployment by its unique ID.
deleteExecution({required String functionId, required String executionId}) Future
Delete a function execution by its unique ID.
deleteVariable({required String functionId, required String variableId}) Future
Delete a variable by its unique ID.
get({required String functionId}) Future<Func>
Get a function by its unique ID.
getDeployment({required String functionId, required String deploymentId}) Future<Deployment>
Get a function deployment by its unique ID.
getDeploymentDownload({required String functionId, required String deploymentId, DeploymentDownloadType? type}) Future<Uint8List>
Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
getExecution({required String functionId, required String executionId}) Future<Execution>
Get a function execution log by its unique ID.
getVariable({required String functionId, required String variableId}) Future<Variable>
Get a variable by its unique ID.
list({List<String>? queries, String? search}) Future<FunctionList>
Get a list of all the project's functions. You can use the query params to filter your results.
listDeployments({required String functionId, List<String>? queries, String? search}) Future<DeploymentList>
Get a list of all the function's code deployments. You can use the query params to filter your results.
listExecutions({required String functionId, List<String>? queries}) Future<ExecutionList>
Get a list of all the current user function execution logs. You can use the query params to filter your results.
listRuntimes() Future<RuntimeList>
Get a list of all runtimes that are currently active on your instance.
listSpecifications() Future<SpecificationList>
List allowed function specifications for this instance.
listVariables({required String functionId}) Future<VariableList>
Get a list of all variables of a specific function.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update({required String functionId, required String name, Runtime? runtime, List<String>? execute, List<String>? events, String? schedule, int? timeout, bool? enabled, bool? logging, String? entrypoint, String? commands, List<String>? scopes, String? installationId, String? providerRepositoryId, String? providerBranch, bool? providerSilentMode, String? providerRootDirectory, String? specification}) Future<Func>
Update function by its unique ID.
updateDeploymentStatus({required String functionId, required String deploymentId}) Future<Deployment>
Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
updateFunctionDeployment({required String functionId, required String deploymentId}) Future<Func>
Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
updateVariable({required String functionId, required String variableId, required String key, String? value, bool? secret}) Future<Variable>
Update variable by its unique ID.

Operators

operator ==(Object other) bool
The equality operator.
inherited