startImageBuilder method

Future<StartImageBuilderResult> startImageBuilder({
  1. required String name,
  2. String? appstreamAgentVersion,
})

Starts the specified image builder.

May throw ResourceNotAvailableException. May throw ResourceNotFoundException. May throw ConcurrentModificationException. May throw InvalidAccountStatusException. May throw IncompatibleImageException.

Parameter name : The name of the image builder.

Parameter appstreamAgentVersion : The version of the AppStream 2.0 agent to use for this image builder. To use the latest version of the AppStream 2.0 agent, specify LATEST.

Implementation

Future<StartImageBuilderResult> startImageBuilder({
  required String name,
  String? appstreamAgentVersion,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    1152921504606846976,
    isRequired: true,
  );
  _s.validateStringLength(
    'appstreamAgentVersion',
    appstreamAgentVersion,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.StartImageBuilder'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (appstreamAgentVersion != null)
        'AppstreamAgentVersion': appstreamAgentVersion,
    },
  );

  return StartImageBuilderResult.fromJson(jsonResponse.body);
}