public async Task <IActionResult> SetGeneralAssetsSettings([FromBody] UpdateAssetAvailabilityRequest request) { try { string lykkeAssetId = await _lykkeAssetsResolver.GetLykkeId(request.AssetId); Asset asset = await _assetsLocalCache.GetAssetByIdAsync(lykkeAssetId); if (asset == null) { return(NotFound(ErrorResponse.Create($"Asset {request.AssetId} not found"))); } await _assetsAvailabilityService.SetGeneralAsync(request.AssetId, request.AvailabilityType, request.Value); return(NoContent()); } catch (AssetUnknownException assetEx) { await _log.WriteErrorAsync(nameof(AssetsController), nameof(SetGeneralAssetsSettings), new { assetEx.Asset }.ToJson(), assetEx); return(NotFound(ErrorResponse.Create($"Asset {assetEx.Asset} can't be resolved"))); } catch (Exception ex) { await _log.WriteErrorAsync(nameof(AssetsController), nameof(SetGeneralAssetsSettings), ex); throw; } }
public async Task SetGeneralAvailableAssetsAsync(UpdateAssetAvailabilityRequest request) { await _runner.RunWithDefaultErrorHandlingAsync(() => _assetsApi.SetGeneralAvailableAssetsAsync(request)); }