コード例 #1
0
        /// <summary>
        /// Creates a Gfy using a remote url and returns the Gfy status
        /// </summary>
        /// <param name="remoteUrl"></param>
        /// <param name="parameters"></param>
        /// <param name="options">The options for this request</param>
        /// <returns></returns>
        public async Task <GfyStatus> CreateGfyAsync(string remoteUrl, GfyCreationParameters parameters = null, RequestOptions options = null)
        {
            UploadKey key = await ApiClient.CreateGfyFromFetchUrlAsync(remoteUrl, parameters ?? new GfyCreationParameters(), options).ConfigureAwait(false);

            await Task.Delay(500).ConfigureAwait(false);

            return(await GetGfyUploadStatusAsync(key.Gfycat, options).ConfigureAwait(false));
        }
コード例 #2
0
        /// <summary>
        /// Creates a Gfycat using the specified stream and upload parameters
        /// </summary>
        /// <param name="data"></param>
        /// <param name="parameters"></param>
        /// <param name="options">The options for this request</param>
        /// <returns></returns>
        public async Task <GfyStatus> CreateGfyAsync(Stream data, GfyCreationParameters parameters = null, RequestOptions options = null)
        {
            UploadKey uploadKey = await ApiClient.GetUploadKeyAsync(parameters.CreateModel(), options).ConfigureAwait(false);

            await ApiClient.PostGfyStreamAsync(uploadKey, data, options).ConfigureAwait(false);

            await Task.Delay(500).ConfigureAwait(false);

            return(await GetGfyUploadStatusAsync(uploadKey.Gfycat, options).ConfigureAwait(false));
        }