updateStack method

Future<UpdateStackResult> updateStack({
  1. required String name,
  2. List<AccessEndpoint>? accessEndpoints,
  3. ApplicationSettings? applicationSettings,
  4. List<StackAttribute>? attributesToDelete,
  5. bool? deleteStorageConnectors,
  6. String? description,
  7. String? displayName,
  8. List<String>? embedHostDomains,
  9. String? feedbackURL,
  10. String? redirectURL,
  11. List<StorageConnector>? storageConnectors,
  12. List<UserSetting>? userSettings,
})

Updates the specified fields for the specified stack.

May throw ResourceNotFoundException. May throw ResourceInUseException. May throw InvalidRoleException. May throw InvalidParameterCombinationException. May throw LimitExceededException. May throw InvalidAccountStatusException. May throw IncompatibleImageException. May throw OperationNotPermittedException. May throw ConcurrentModificationException.

Parameter name : The name of the stack.

Parameter accessEndpoints : The list of interface VPC endpoint (interface endpoint) objects. Users of the stack can connect to AppStream 2.0 only through the specified endpoints.

Parameter applicationSettings : The persistent application settings for users of a stack. When these settings are enabled, changes that users make to applications and Windows settings are automatically saved after each session and applied to the next session.

Parameter attributesToDelete : The stack attributes to delete.

Parameter deleteStorageConnectors : Deletes the storage connectors currently enabled for the stack.

Parameter description : The description to display.

Parameter displayName : The stack name to display.

Parameter embedHostDomains : The domains where AppStream 2.0 streaming sessions can be embedded in an iframe. You must approve the domains that you want to host embedded AppStream 2.0 streaming sessions.

Parameter feedbackURL : The URL that users are redirected to after they choose the Send Feedback link. If no URL is specified, no Send Feedback link is displayed.

Parameter redirectURL : The URL that users are redirected to after their streaming session ends.

Parameter storageConnectors : The storage connectors to enable.

Parameter userSettings : The actions that are enabled or disabled for users during their streaming sessions. By default, these actions are enabled.

Implementation

Future<UpdateStackResult> updateStack({
  required String name,
  List<AccessEndpoint>? accessEndpoints,
  ApplicationSettings? applicationSettings,
  List<StackAttribute>? attributesToDelete,
  bool? deleteStorageConnectors,
  String? description,
  String? displayName,
  List<String>? embedHostDomains,
  String? feedbackURL,
  String? redirectURL,
  List<StorageConnector>? storageConnectors,
  List<UserSetting>? userSettings,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    1152921504606846976,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    0,
    256,
  );
  _s.validateStringLength(
    'displayName',
    displayName,
    0,
    100,
  );
  _s.validateStringLength(
    'feedbackURL',
    feedbackURL,
    0,
    1000,
  );
  _s.validateStringLength(
    'redirectURL',
    redirectURL,
    0,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'PhotonAdminProxyService.UpdateStack'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Name': name,
      if (accessEndpoints != null) 'AccessEndpoints': accessEndpoints,
      if (applicationSettings != null)
        'ApplicationSettings': applicationSettings,
      if (attributesToDelete != null)
        'AttributesToDelete':
            attributesToDelete.map((e) => e.toValue()).toList(),
      if (deleteStorageConnectors != null)
        'DeleteStorageConnectors': deleteStorageConnectors,
      if (description != null) 'Description': description,
      if (displayName != null) 'DisplayName': displayName,
      if (embedHostDomains != null) 'EmbedHostDomains': embedHostDomains,
      if (feedbackURL != null) 'FeedbackURL': feedbackURL,
      if (redirectURL != null) 'RedirectURL': redirectURL,
      if (storageConnectors != null) 'StorageConnectors': storageConnectors,
      if (userSettings != null) 'UserSettings': userSettings,
    },
  );

  return UpdateStackResult.fromJson(jsonResponse.body);
}