Example #1
0
        /// <summary>
        /// Create FunctionSchedules.
        /// </summary>
        /// <param name="functionSchedules">FunctionSchedules to create.</param>
        /// <param name="token">Optional cancellation token.</param>
        /// <returns>Sequence of created FunctionSchedules.</returns>
        public async Task <IEnumerable <FunctionSchedule> > CreateAsync(IEnumerable <FunctionScheduleCreate> functionSchedules, CancellationToken token = default)
        {
            if (functionSchedules is null)
            {
                throw new ArgumentNullException(nameof(functionSchedules));
            }

            var req = FunctionSchedules.create(functionSchedules);

            return(await RunAsync(req, token).ConfigureAwait(false));
        }
Example #2
0
        /// <summary>
        /// Delete multiple FunctionSchedules in the same project, along with all their descendants in the Function hierarchy if
        /// recursive is true.
        /// </summary>
        /// <param name="ids">The ids of FunctionSchedules to delete.</param>
        /// <param name="token">Optional cancellation token.</param>
        public async Task <EmptyResponse> DeleteAsync(IEnumerable <long> ids, CancellationToken token = default)
        {
            if (ids is null)
            {
                throw new ArgumentNullException(nameof(ids));
            }

            var req = FunctionSchedules.delete(ids);

            return(await RunAsync(req, token).ConfigureAwait(false));
        }
Example #3
0
        /// <summary>
        /// Retrieves list of FunctionSchedules matching query.
        /// </summary>
        /// <param name="token">Optional cancellation token to use.</param>
        /// <returns>List of FunctionSchedules</returns>
        public async Task <ItemsWithoutCursor <FunctionSchedule> > ListAsync(CancellationToken token = default)
        {
            var req = FunctionSchedules.list();

            return(await RunAsync(req, token).ConfigureAwait(false));
        }