public static System.Threading.Tasks.Task <RunnerRegistered> RegisterAsync(this Meziantou.GitLab.IGitLabRunnersClient client, string token, string?description = default(string?), bool?active = default(bool?), bool?locked = default(bool?), bool?runUntagged = default(bool?), System.Collections.Generic.IEnumerable <string>?tagList = default(System.Collections.Generic.IEnumerable <string>?), RunnerAccessLevel?accessLevel = default(RunnerAccessLevel?), int?maximumTimeout = default(int?), Meziantou.GitLab.RequestOptions?requestOptions = default(Meziantou.GitLab.RequestOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Meziantou.GitLab.RegisterRunnerRequest request = new Meziantou.GitLab.RegisterRunnerRequest(token); request.Description = description; request.Active = active; request.Locked = locked; request.RunUntagged = runUntagged; request.TagList = tagList; request.AccessLevel = accessLevel; request.MaximumTimeout = maximumTimeout; return(client.RegisterAsync(request, requestOptions, cancellationToken)); }
private async System.Threading.Tasks.Task <RunnerRegistered> Runners_RegisterAsync(Meziantou.GitLab.RegisterRunnerRequest request, Meziantou.GitLab.RequestOptions?requestOptions = default(Meziantou.GitLab.RequestOptions), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { string url = Meziantou.GitLab.GitLabClient.Runners_RegisterAsync_BuildUrl(); using (System.Net.Http.HttpRequestMessage requestMessage = new System.Net.Http.HttpRequestMessage()) { requestMessage.Method = System.Net.Http.HttpMethod.Post; requestMessage.RequestUri = new System.Uri(url, System.UriKind.RelativeOrAbsolute); requestMessage.Content = new Meziantou.GitLab.Internals.JsonContent(request, Meziantou.GitLab.Serialization.JsonSerialization.Options); HttpResponse?response = null; try { response = await this.SendAsync(requestMessage, requestOptions, cancellationToken).ConfigureAwait(false); await response.EnsureStatusCodeAsync(cancellationToken).ConfigureAwait(false); RunnerRegistered?result = await response.ToObjectAsync <RunnerRegistered>(cancellationToken).ConfigureAwait(false); if ((result == null)) { throw new Meziantou.GitLab.GitLabException(response.RequestMethod, response.RequestUri, response.StatusCode, "The response cannot be converted to 'RunnerRegistered' because the body is null or empty"); } return(result); } finally { if ((response != null)) { response.Dispose(); } } } }
System.Threading.Tasks.Task <RunnerRegistered> Meziantou.GitLab.IGitLabRunnersClient.RegisterAsync(Meziantou.GitLab.RegisterRunnerRequest request, Meziantou.GitLab.RequestOptions?requestOptions, System.Threading.CancellationToken cancellationToken) { return(this.Runners_RegisterAsync(request, requestOptions, cancellationToken)); }