This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements (command line) | |
# https://github.com/tghw/trello-py | |
#pip install trello --version 0.9.6 | |
# Parameters | |
#api_key = <API-KEY> | |
#api_token = <API-TOKEN> | |
card_id = "Vg0mHtr7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HasStringValueConverter<TObject> : JsonConverter<TObject> | |
where TObject : IHasStringValue, new() | |
{ | |
public override bool CanRead { get; } = true; | |
public override bool CanWrite { get; } = true; | |
public override void WriteJson(JsonWriter writer, TObject value, JsonSerializer serializer) | |
{ | |
writer.WriteValue(value?.Value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SessionData GetSessionData(SessionRequest request, CancellationTokenSource cts, TimeSpan timeout) | |
{ | |
var response = new SessionData(); | |
var ct = cts?.Token ?? CancellationToken.None; | |
var parallelOptions = new ParallelOptions() { CancellationToken = ct }; | |
var frameAgreement = RunTaskWithTimeout(() => _thirdPartyWs.GetFrameAgreementDetail(request.FrameAgreementId), cts, timeout); | |
var agreements = frameAgreement.Agreements; | |
if (ct.CanBeCanceled && ct.IsCancellationRequested) | |
ct.ThrowIfCancellationRequested(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SessionData GetSessionData(SessionRequest request, CancellationToken ct) | |
{ | |
var response = new SessionData(); | |
var parallelOptions = new ParallelOptions() { CancellationToken = ct }; | |
var frameAgreement = _thirdPartyWs.GetFrameAgreementDetail(request.FrameAgreementId); | |
var agreements = frameAgreement.Agreements; | |
if (ct.CanBeCanceled && ct.IsCancellationRequested) | |
ct.ThrowIfCancellationRequested(); | |
Parallel.ForEach(agreements, parallelOptions, (agreement) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SessionData GetSessionData(SessionRequest request) | |
{ | |
var response = new SessionData(); | |
var frameAgreement = _thirdPartyWs.GetFrameAgreementDetail(request.FrameAgreementId); | |
var agreements = frameAgreement.Agreements; | |
Parallel.ForEach(agreements, (agreement) => | |
{ | |
var agreementDto = new AgreementDto(); | |
response.Agreements.Add(agreementDto); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public SessionData GetSessionData(SessionRequest request) | |
{ | |
var response = new SessionData(); | |
var frameAgreement = _thirdPartyWs.GetFrameAgreementDetail(request.FrameAgreementId); | |
var agreements = frameAgreement.Agreements; | |
foreach (var agreement in agreements) | |
{ | |
var agreementDto = new AgreementDto(); | |
response.Agreements.Add(agreementDto); | |