postCommerceCatalogModelsRefresh method

Future<void> postCommerceCatalogModelsRefresh()

Refresh the model catalog by reading the upstream provider

Pulls the upstream model list and lands it through the same upsert the push endpoint uses, so the rule that a sync owns cost and an administrator owns price holds no matter which endpoint a row came through. It takes no body — the upstream is READ rather than told. If that upstream cannot be read the call answers 502 and writes NOTHING: a sync that cannot see its source must never conclude the source is empty, because that conclusion would withdraw every model on sale. The gate is a PLATFORM principal so the scheduled job's service token qualifies.

Implementation

Future<void> postCommerceCatalogModelsRefresh() async {
  final response = await postCommerceCatalogModelsRefreshWithHttpInfo();
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
}