public virtual IActionResult PostCreateEndpointForClient( [FromRoute] Guid clientUid, [FromBody] EndpointInformation endpoint) { if (clientUid == Guid.Empty) { return(StatusCode((int)HttpStatusCode.BadRequest)); } if (!EndpointManager.IsUrlPartAvailable(endpoint.UrlPart)) { return(StatusCode((int)HttpStatusCode.BadRequest, "{\"error\":\"URL Part already in use\"}")); } if (endpoint.Uid == Guid.Empty) { endpoint.Uid = Guid.NewGuid(); } // create this endpoint and register to this client EndpointManager.AddOrUpdate( endpoint.Uid, endpoint.ChannelType, endpoint.UrlPart, clientUid); return(StatusCode((int)HttpStatusCode.Created, endpoint)); }
public virtual IActionResult PostCreateRestEndpointForClient([FromRoute] Guid clientUid) { if (clientUid == Guid.Empty) { return(StatusCode((int)HttpStatusCode.BadRequest)); } EndpointInformation endpoint = new EndpointInformation( Guid.NewGuid(), EndpointInformation.EndpointChannelType.RestHook, null); EndpointManager.AddOrUpdate( endpoint.Uid, endpoint.ChannelType, endpoint.UrlPart, clientUid); return(StatusCode((int)HttpStatusCode.Created, endpoint)); }