createStudioLifecycleConfig method

Future<CreateStudioLifecycleConfigResponse> createStudioLifecycleConfig({
  1. required StudioLifecycleConfigAppType studioLifecycleConfigAppType,
  2. required String studioLifecycleConfigContent,
  3. required String studioLifecycleConfigName,
  4. List<Tag>? tags,
})

Creates a new Amazon SageMaker AI Studio Lifecycle Configuration.

May throw ResourceInUse.

Parameter studioLifecycleConfigAppType : The App type that the Lifecycle Configuration is attached to.

Parameter studioLifecycleConfigContent : The content of your Amazon SageMaker AI Studio Lifecycle Configuration script. This content must be base64 encoded.

Parameter studioLifecycleConfigName : The name of the Amazon SageMaker AI Studio Lifecycle Configuration to create.

Parameter tags : Tags to be associated with the Lifecycle Configuration. Each tag consists of a key and an optional value. Tag keys must be unique per resource. Tags are searchable using the Search API.

Implementation

Future<CreateStudioLifecycleConfigResponse> createStudioLifecycleConfig({
  required StudioLifecycleConfigAppType studioLifecycleConfigAppType,
  required String studioLifecycleConfigContent,
  required String studioLifecycleConfigName,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateStudioLifecycleConfig'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'StudioLifecycleConfigAppType': studioLifecycleConfigAppType.value,
      'StudioLifecycleConfigContent': studioLifecycleConfigContent,
      'StudioLifecycleConfigName': studioLifecycleConfigName,
      if (tags != null) 'Tags': tags,
    },
  );

  return CreateStudioLifecycleConfigResponse.fromJson(jsonResponse.body);
}