/// <summary> /// Initializes a new <see cref="Config"/>. /// </summary> public Config() { Job = new JobConfig(); Execution = new ExecutionConfig(); RunlyApi = new RunlyApiConfig(); }
public async Task <JobTemplate> CreateJobTemplate(string organization, string environment, string id, bool allowRestrictedApps, object config, JobConfig job, string schedule) { var req = new HttpRequestMessage(HttpMethod.Post, $"/{organization}/environments/{environment}/templates/").WithJsonContent(new { id, allowRestrictedApps, job, config, schedule }); req.Headers.Authorization = await tokenProvider.AcquireAuthHeader(); var response = await api.SendAsync(req); await response.EnsureSuccess(); return(await response.Content.ReadAsAsync <JobTemplate>()); }