public async Task <IActionResult> CreateProjectKey(string projectId, [FromBody] CreateProjectKeyRequest createProjectKey) { var result = await _kotori.CreateProjectKeyAsync(_instance, projectId, new KotoriCore.Configurations.ProjectKey { IsReadonly = createProjectKey.IsReadonly ?? false }); return(Created(result.Url, new { id = result.Id, url = result.Url })); }
public async Task <IActionResult> UpsertProjectKey(string projectId, [Required] string key, [FromBody] CreateProjectKeyRequest createProjectKey) { var result = await _kotori.UpsertProjectKeyAsync(_instance, projectId, new KotoriCore.Configurations.ProjectKey { Key = key, IsReadonly = createProjectKey.IsReadonly ?? false }); if (result.NewResource) { return(Created(result.Url, new { id = result.Id, url = result.Url })); } return(Ok()); }