updateTrustStore method

Future<UpdateTrustStoreResult> updateTrustStore({
  1. required String id,
  2. required String ifMatch,
  3. CaCertificatesBundleSource? caCertificatesBundleSource,
  4. bool? useClientCertificateOCSPEndpoint,
})

Updates a trust store.

May throw AccessDenied. May throw EntityNotFound. May throw InvalidArgument. May throw InvalidIfMatchVersion. May throw PreconditionFailed.

Parameter id : The trust store ID.

Parameter ifMatch : The current version (ETag value) of the trust store you are updating.

Parameter caCertificatesBundleSource : The CA certificates bundle source.

Parameter useClientCertificateOCSPEndpoint : A Boolean that determines whether to use the CA certificate's OCSP endpoint to check certificate revocation status.

Implementation

Future<UpdateTrustStoreResult> updateTrustStore({
  required String id,
  required String ifMatch,
  CaCertificatesBundleSource? caCertificatesBundleSource,
  bool? useClientCertificateOCSPEndpoint,
}) async {
  final headers = <String, String>{
    'If-Match': ifMatch.toString(),
    if (useClientCertificateOCSPEndpoint != null)
      'UseClientCertificateOCSPEndpoint':
          useClientCertificateOCSPEndpoint.toString(),
  };
  final $result = await _protocol.sendRaw(
    method: 'PUT',
    requestUri: '/2020-05-31/trust-store/${Uri.encodeComponent(id)}',
    headers: headers,
    payload: caCertificatesBundleSource?.toXml('CaCertificatesBundleSource'),
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return UpdateTrustStoreResult(
    trustStore: TrustStore.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
  );
}