Exemple #1
0
        /// <summary>
        /// Create new ApiKey
        /// </summary>
        /// <param name="apiKeyRecord">The entity we are going to insert</param>
        /// <param name="ctk">CancellationToken</param>
        /// <returns>ApiKey Output entity</returns>
        public Task <ApiKey.Output> CreateApiKeyAsync(ApiKey.Input apiKeyRecord, CancellationToken ctk = default)
        {
            apiKeyRecord.Validate();

            var url = "/apikey/entity";

            return(_client.Exec <ApiKey.Output, ApiKey.Input>(HttpMethod.Post, url, apiKeyRecord, ctk: ctk));
        }
Exemple #2
0
        public void ApiKey_CreateApiKeyAsync()
        {
            using (var httpTest = new HttpTest())
            {
                var mds = new MarketDataService(_cfg);

                var apiKey = new ApiKey.Input()
                {
                    Id = 0
                };

                var mdq = mds.CreateApiKeyAsync(apiKey).ConfigureAwait(true).GetAwaiter().GetResult();

                httpTest.ShouldHaveCalledPath($"{_cfg.BaseAddress}v2.1/apikey/entity")
                .WithVerb(HttpMethod.Post)
                .WithContentType("application/x.msgpacklz4")
                .WithHeadersTest()
                .Times(1);
            }
        }
Exemple #3
0
 public Task <ApiKey.Output> CreateApiKeyAsync(ApiKey.Input apiKeyRecord, CancellationToken ctk = default)
 {
     throw new NotImplementedException();
 }