updateSecurityConfig method

Future<UpdateSecurityConfigResponse> updateSecurityConfig({
  1. required String configVersion,
  2. required String id,
  3. String? clientToken,
  4. String? description,
  5. IamFederationConfigOptions? iamFederationOptions,
  6. UpdateIamIdentityCenterConfigOptions? iamIdentityCenterOptionsUpdates,
  7. SamlConfigOptions? samlOptions,
})

Updates a security configuration for OpenSearch Serverless. For more information, see SAML authentication for Amazon OpenSearch Serverless.

May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter configVersion : The version of the security configuration to be updated. You can find the most recent version of a security configuration using the GetSecurityPolicy command.

Parameter id : The security configuration identifier. For SAML the ID will be saml/<accountId>/<idpProviderName>. For example, saml/123456789123/OKTADev.

Parameter clientToken : Unique, case-sensitive identifier to ensure idempotency of the request.

Parameter description : A description of the security configuration.

Parameter iamFederationOptions : Describes IAM federation options in the form of a key-value map for updating an existing security configuration. Use this field to modify IAM federation settings for the security configuration.

Parameter iamIdentityCenterOptionsUpdates : Describes IAM Identity Center options in the form of a key-value map.

Parameter samlOptions : SAML options in in the form of a key-value map.

Implementation

Future<UpdateSecurityConfigResponse> updateSecurityConfig({
  required String configVersion,
  required String id,
  String? clientToken,
  String? description,
  IamFederationConfigOptions? iamFederationOptions,
  UpdateIamIdentityCenterConfigOptions? iamIdentityCenterOptionsUpdates,
  SamlConfigOptions? samlOptions,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'OpenSearchServerless.UpdateSecurityConfig'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'configVersion': configVersion,
      'id': id,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (description != null) 'description': description,
      if (iamFederationOptions != null)
        'iamFederationOptions': iamFederationOptions,
      if (iamIdentityCenterOptionsUpdates != null)
        'iamIdentityCenterOptionsUpdates': iamIdentityCenterOptionsUpdates,
      if (samlOptions != null) 'samlOptions': samlOptions,
    },
  );

  return UpdateSecurityConfigResponse.fromJson(jsonResponse.body);
}