public Tss( Guid id, string description, TssState state, DateTime createdUtc, DateTime initializedUtc, DateTime disabledUtc, string certificate, string certificateSerial, string publicKey, int signatureCounter, string signatureAlgorithm, long transactionCounter) { Id = id; Description = description; State = state; CreatedUtc = createdUtc; InitializedUtc = initializedUtc; DisabledUtc = disabledUtc; Certificate = certificate; CertificateSerial = certificateSerial; PublicKey = publicKey; SignatureCounter = signatureCounter; SignatureAlgorithm = signatureAlgorithm; TransactionCounter = transactionCounter; }
internal static Dto.UpdateTssRequest UpdateTss(TssState state) { return(new Dto.UpdateTssRequest { State = SerializeTssState(state) }); }
internal static Dto.CreateTssRequest CreateTss(TssState state, string description = "") { return(new Dto.CreateTssRequest { Description = description, State = SerializeTssState(state) }); }
private static Dto.TssState SerializeTssState(TssState state) { return(state.Match( TssState.Disabled, _ => Dto.TssState.DISABLED, TssState.Initialized, _ => Dto.TssState.INITIALIZED, TssState.Uninitialized, _ => Dto.TssState.UNINITIALIZED )); }
public Task <ResponseResult <Tss> > CreateTssAsync(AccessToken token, TssState state, string description = null) { return(Client.ProcessRequestAsync <Dto.CreateTssRequest, Dto.TssResponse, Tss>( method: HttpMethod.Put, endpoint: $"tss/{Guid.NewGuid()}", request: RequestCreator.CreateTss(state, description), successFunc: response => ModelMapper.MapTss(response), token: token )); }
public async Task <ResponseResult <Tss> > CreateTssAsync(AccessToken token, TssState state, string description = null) { var request = RequestCreator.CreateTss(state, description); return(await Client.ProcessRequestAsync <Dto.CreateTssRequest, Dto.TssResponse, Tss>( method : HttpMethod.Put, endpoint : $"tss/{Guid.NewGuid()}", request : request, successFunc : response => ModelMapper.MapTss(response), token : token ).ConfigureAwait(continueOnCapturedContext: false)); }
private static Dto.TssState SerializeTssState(TssState state) { switch (state) { case TssState.Disabled: return(Dto.TssState.DISABLED); case TssState.Initialized: return(Dto.TssState.INITIALIZED); case TssState.Uninitialized: return(Dto.TssState.UNINITIALIZED); default: throw new NotImplementedException($"Tss state: {state} is not implemented."); } ; }
public async Task <ResponseResult <Tss> > UpdateTssAsync(AccessToken token, Guid tssId, TssState state) { var request = RequestCreator.UpdateTss(state); return(await Client.ProcessRequestAsync <Dto.UpdateTssRequest, Dto.TssResponse, Tss>( method : HttpMethod.Put, endpoint : $"tss/{tssId}", request : request, successFunc : response => ModelMapper.MapTss(response), token : token ).ConfigureAwait(continueOnCapturedContext: false)); }
public Task <ResponseResult <Tss> > UpdateTssAsync(AccessToken token, Guid tssId, TssState state) { return(Client.ProcessRequestAsync <Dto.UpdateTssRequest, Dto.TssResponse, Tss>( method: HttpMethod.Put, endpoint: $"tss/{tssId}", request: RequestCreator.UpdateTss(state), successFunc: response => ModelMapper.MapTss(response), token: token )); }