public async Task CreatePersonalUrl() { Printer.PrintStepTitle("Creates Purl"); Console.Write("Enter Approval ID:"); string id = Console.ReadLine(); if (id == "-1") { return; } Console.Write("Enter Approval Version:"); string versionInput = Console.ReadLine(); int.TryParse(versionInput, out int version); Console.Write("Enter User ID:"); string userId = Console.ReadLine(); var parameters = new PersonalUrlCreateParameters { ApprovalId = id, Version = version, UserId = userId }; Console.WriteLine("Creating PURL..."); var purl = await _apiClient.Approvals.CreatePersonalUrl(parameters); Console.WriteLine($"Successfully created URL: {purl.Url}"); }
/// <inheritdoc /> public async Task <PersonalUrlCreateResult> CreatePersonalUrl(PersonalUrlCreateParameters parameters) { var response = await ApiClient.PostAsJsonAsync("Approvals/CreatePersonalUrl/", parameters); if (response.IsSuccessStatusCode) { return(await response.Content.ReadAsJsonAsync <PersonalUrlCreateResult>()); } throw new ApiException("Approvals.GetPersonalUrl", response.StatusCode, await response.Content.ReadAsStringAsync()); }
public static async Task CreatePersonalUrl() { Printer.PrintStepTitle("Creates Purl"); var parameters = new PersonalUrlCreateParameters { ApprovalId = TestContainer.Approval.Id, Version = TestContainer.Approval.Versions.FirstOrDefault().Version, UserId = TestContainer.User.Id }; Printer.Print("Creating PURL..."); var purl = await ApiClient.Approvals.CreatePersonalUrl(parameters); Printer.Print($"Successfully created URL: {purl.Url}"); }