startDevEnvironment method

Future<StartDevEnvironmentResponse> startDevEnvironment({
  1. required String id,
  2. required String projectName,
  3. required String spaceName,
  4. List<IdeConfiguration>? ides,
  5. int? inactivityTimeoutMinutes,
  6. InstanceType? instanceType,
})

Starts a specified Dev Environment and puts it into an active state.

Parameter id : The system-generated unique ID of the Dev Environment.

Parameter projectName : The name of the project in the space.

Parameter spaceName : The name of the space.

Parameter ides : Information about the integrated development environment (IDE) configured for a Dev Environment.

Parameter inactivityTimeoutMinutes : The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.

Parameter instanceType : The Amazon EC2 instace type to use for the Dev Environment.

Implementation

Future<StartDevEnvironmentResponse> startDevEnvironment({
  required String id,
  required String projectName,
  required String spaceName,
  List<IdeConfiguration>? ides,
  int? inactivityTimeoutMinutes,
  InstanceType? instanceType,
}) async {
  _s.validateNumRange(
    'inactivityTimeoutMinutes',
    inactivityTimeoutMinutes,
    0,
    1200,
  );
  final $payload = <String, dynamic>{
    if (ides != null) 'ides': ides,
    if (inactivityTimeoutMinutes != null)
      'inactivityTimeoutMinutes': inactivityTimeoutMinutes,
    if (instanceType != null) 'instanceType': instanceType.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/v1/spaces/${Uri.encodeComponent(spaceName)}/projects/${Uri.encodeComponent(projectName)}/devEnvironments/${Uri.encodeComponent(id)}/start',
    exceptionFnMap: _exceptionFns,
  );
  return StartDevEnvironmentResponse.fromJson(response);
}