コード例 #1
0
ファイル: Config.cs プロジェクト: unshift-nl/core-dotnet
 /// <summary>
 /// Initializes a new <see cref="Config"/>.
 /// </summary>
 public Config()
 {
     Job       = new JobConfig();
     Execution = new ExecutionConfig();
     RunlyApi  = new RunlyApiConfig();
 }
コード例 #2
0
        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>());
        }