/// <summary> /// Creates a theme to apply to the components in an Amplify app. /// </summary> /// <param name="request">Container for the necessary parameters to execute the CreateTheme service method.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the CreateTheme service method, as returned by AmplifyUIBuilder.</returns> /// <exception cref="Amazon.AmplifyUIBuilder.Model.InternalServerException"> /// An internal error has occurred. Please retry your request. /// </exception> /// <exception cref="Amazon.AmplifyUIBuilder.Model.InvalidParameterException"> /// An invalid or out-of-range value was supplied for the input parameter. /// </exception> /// <exception cref="Amazon.AmplifyUIBuilder.Model.ResourceConflictException"> /// The resource specified in the request conflicts with an existing resource. /// </exception> /// <exception cref="Amazon.AmplifyUIBuilder.Model.ServiceQuotaExceededException"> /// You exceeded your service quota. Service quotas, also referred to as limits, are the /// maximum number of service resources or operations for your Amazon Web Services account. /// </exception> /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/amplifyuibuilder-2021-08-11/CreateTheme">REST API Reference for CreateTheme Operation</seealso> public virtual Task <CreateThemeResponse> CreateThemeAsync(CreateThemeRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var options = new InvokeOptions(); options.RequestMarshaller = CreateThemeRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateThemeResponseUnmarshaller.Instance; return(InvokeAsync <CreateThemeResponse>(request, options, cancellationToken)); }
internal virtual CreateThemeResponse CreateTheme(CreateThemeRequest request) { var options = new InvokeOptions(); options.RequestMarshaller = CreateThemeRequestMarshaller.Instance; options.ResponseUnmarshaller = CreateThemeResponseUnmarshaller.Instance; return(Invoke <CreateThemeResponse>(request, options)); }
public async Task <ActionResult> Create(CreateThemeRequest model) { if (ModelState.IsValid) { await _themeAdminService.CreateThemeAsync(model); return(RedirectToAction("Index", new { subjectId = model.SubjectId })); } ViewBag.Title = "Add a new theme"; return(View(model)); }
public ActionResult Create(Guid subjectId) { CreateThemeRequest createThemeRequest = new CreateThemeRequest() { SubjectId = subjectId, TimeLine = 1 }; ViewBag.Title = "Add a new theme"; return(View(createThemeRequest)); }
public async Task CreateThemeAsync(CreateThemeRequest model) { Theme theme = new Theme() { Id = Guid.NewGuid(), Title = model.Title, Created = DateTime.UtcNow, SubjectId = model.SubjectId, TimeLine = model.TimeLine }; UnitOfWork.ThemeRepository.Add(theme); await UnitOfWork.SaveChangesAsync(); }
public async Task <IActionResult> Create(CreateThemeRequest request) { var dic = new Dictionary <string, string> { { "--accent-color1", request.AccentColor1 }, { "--accent-color2", request.AccentColor2 }, { "--accent-color3", request.AccentColor3 } }; var id = await _themeService.Create(request.Name, dic); if (id == 0) { return(Conflict("Theme with same name already exists")); } return(Ok(id)); }