Environment constructor

Environment({
  1. String? runtimeAPI,
  2. String? handler,
  3. String? functionName,
  4. String? functionMemorySize,
  5. String? functionVersion,
  6. String? logGroupName,
  7. String? logStreamName,
  8. String? region,
  9. String? executionEnv,
  10. String? accessKey,
  11. String? secretAccessKey,
  12. String? sessionToken,
})

Implementation

factory Environment({
  String? runtimeAPI,
  String? handler,
  String? functionName,
  String? functionMemorySize,
  String? functionVersion,
  String? logGroupName,
  String? logStreamName,
  String? region,
  String? executionEnv,
  String? accessKey,
  String? secretAccessKey,
  String? sessionToken,
}) {
  handler ??= Platform.environment[_kAWSLambdaHandler]!;
  functionName ??= Platform.environment[_kAWSLambdaFunctionName]!;
  functionMemorySize ??= Platform.environment[_kAWSLambdaFunctionMemorySize]!;
  functionVersion ??= Platform.environment[_kAWSLambdaFunctionVersion]!;
  logGroupName ??= Platform.environment[_kAWSLambdaLogGroupName]!;
  logStreamName ??= Platform.environment[_kAWSLambdaLogStreamName]!;
  region ??= Platform.environment[_kAWSLambdaRegion]!;
  executionEnv ??= Platform.environment[_kAWSLambdaExecutionEnv]!;
  accessKey ??= Platform.environment[_kAWSLambdaAccessKey]!;
  secretAccessKey ??= Platform.environment[_kAWSLambdaSecretAccesKey]!;
  sessionToken ??= Platform.environment[_kAWSLambdaSessionToken]!;
  runtimeAPI ??= Platform.environment[_kAWSLambdaRuntimeAPI]!;

  return Environment.raw(
      handler: handler,
      functionVersion: functionVersion,
      functionName: functionName,
      functionMemorySize: functionMemorySize,
      logGroupName: logGroupName,
      logStreamName: logStreamName,
      region: region,
      executionEnv: executionEnv,
      accessKey: accessKey,
      secretAccessKey: secretAccessKey,
      sessionToken: sessionToken,
      runtimeAPI: runtimeAPI);
}