コード例 #1
0
        /// <summary>
        /// Creates a new <see cref="ApplicationCredit"/>.
        /// </summary>
        /// <param name="credit">A new <see cref="ApplicationCredit"/>. Id should be set to null.</param>
        public virtual async Task <ApplicationCredit> CreateAsync(ApplicationCredit credit)
        {
            var req  = PrepareRequest($"application_credits.json");
            var body = new JsonContent(new
            {
                application_credit = credit,
            });

            return(await ExecuteRequestAsync <ApplicationCredit>(req, HttpMethod.Post, body, "application_credit"));
        }
コード例 #2
0
        /// <summary>
        /// Creates a new <see cref="ApplicationCredit"/>.
        /// </summary>
        /// <param name="credit">A new <see cref="ApplicationCredit"/>. Id should be set to null.</param>
        /// <param name="cancellationToken">Cancellation Token</param>
        public virtual async Task <ApplicationCredit> CreateAsync(ApplicationCredit credit, CancellationToken cancellationToken = default)
        {
            var req  = PrepareRequest($"application_credits.json");
            var body = new JsonContent(new
            {
                application_credit = credit,
            });

            var response = await ExecuteRequestAsync <ApplicationCredit>(req, HttpMethod.Post, cancellationToken, body, "application_credit");

            return(response.Result);
        }