create method
Future<Func>
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,
- String? installationId,
- String? providerRepositoryId,
- String? providerBranch,
- bool? providerSilentMode,
- String? providerRootDirectory,
- String? templateRepository,
- String? templateOwner,
- String? templateRootDirectory,
- String? templateBranch,
Create function
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.
Implementation
Future<models.Func> create(
{required String functionId,
required String name,
required enums.Runtime runtime,
List<String>? execute,
List<String>? events,
String? schedule,
int? timeout,
bool? enabled,
bool? logging,
String? entrypoint,
String? commands,
String? installationId,
String? providerRepositoryId,
String? providerBranch,
bool? providerSilentMode,
String? providerRootDirectory,
String? templateRepository,
String? templateOwner,
String? templateRootDirectory,
String? templateBranch}) async {
final String apiPath = '/functions';
final Map<String, dynamic> apiParams = {
'functionId': functionId,
'name': name,
'runtime': runtime.value,
'execute': execute,
'events': events,
'schedule': schedule,
'timeout': timeout,
'enabled': enabled,
'logging': logging,
'entrypoint': entrypoint,
'commands': commands,
'installationId': installationId,
'providerRepositoryId': providerRepositoryId,
'providerBranch': providerBranch,
'providerSilentMode': providerSilentMode,
'providerRootDirectory': providerRootDirectory,
'templateRepository': templateRepository,
'templateOwner': templateOwner,
'templateRootDirectory': templateRootDirectory,
'templateBranch': templateBranch,
};
final Map<String, String> apiHeaders = {
'content-type': 'application/json',
};
final res = await client.call(HttpMethod.post,
path: apiPath, params: apiParams, headers: apiHeaders);
return models.Func.fromMap(res.data);
}