private Task EndpointEvent(EndpointEventApiModel ev) { EndpointList.Results.Update(ev); PagedendpointList = EndpointList.GetPaged(int.Parse(Page), CommonHelper.PageLength, EndpointList.Error); StateHasChanged(); return(Task.CompletedTask); }
public void GetsEndpoint() { var mockChildMatches = new EndpointList { ["{id}"] = new ElementEndpoint { Schema = Sample.ContactSchema, Children = { ["sub"] = new Endpoint { Description = "sub" } } }, ["other"] = new Endpoint { Description = "other" } }; TryGetEndpoint(CollectionTree, mockChildMatches).Should().BeEquivalentTo(new CollectionEndpoint { Schema = Sample.ContactSchema, Element = new ElementEndpoint { Children = { ["sub"] = new Endpoint { Description = "sub" } } }, Children = { ["other"] = new Endpoint { Description = "other" } }, Description = "Collection of contacts." }, options => options.IncludingAllRuntimeProperties()); }
public void GetsEndpoint() { var mockChildMatches = new EndpointList { ["{id}"] = new Endpoint { Description = "element" }, ["other"] = new Endpoint { Description = "other" } }; TryGetEndpoint(new PathTree(), mockChildMatches).Should().BeEquivalentTo(new IndexerEndpoint { Element = new Endpoint { Description = "element" }, Children = { ["other"] = new Endpoint { Description = "other" } } }, options => options.IncludingAllRuntimeProperties()); }
protected IEndpoint TryGetEndpoint(PathTree tree, EndpointList mockChildMatches = null) { var patternMatcherMock = new Mock <IPatternMatcher>(); patternMatcherMock.Setup(x => x.GetEndpoints(tree)) .Returns(mockChildMatches ?? new EndpointList()); return(new TPattern().TryGetEndpoint(tree, patternMatcherMock.Object)); }
private static Endpoints Convert(EndpointList response) { return(new Endpoints { MapsUrl = response.MapsUrl, ActivitiesUrl = response.ActivitiesUrl, ActorsUrl = response.ActorsUrl, ActionsUrl = response.ActionsUrl }); }
public static Uri UploadPackageToBlob(IServiceManagement channel, string storageName, string subscriptionId, string packagePath) { StorageService storageKeys = channel.GetStorageKeys(subscriptionId, storageName); string primary = storageKeys.StorageServiceKeys.Primary; storageKeys = channel.GetStorageService(subscriptionId, storageName); EndpointList endpoints = storageKeys.StorageServiceProperties.Endpoints; string str = ((List <string>)endpoints).Find((string p) => p.Contains(".blob.")); return(AzureBlob.UploadFile(storageName, primary, str, packagePath)); }
/// <summary> /// Notify page change /// </summary> /// <param name="page"></param> public async Task PagerPageChangedAsync(int page) { CommonHelper.Spinner = "loader-big"; StateHasChanged(); if (!string.IsNullOrEmpty(EndpointList.ContinuationToken) && page > PagedendpointList.PageCount) { EndpointList = await RegistryHelper.GetEndpointListAsync(DiscovererId, ApplicationId, SupervisorId, EndpointList); } PagedendpointList = EndpointList.GetPaged(page, CommonHelper.PageLength, null); NavigationManager.NavigateTo(NavigationManager.BaseUri + "endpoints/" + page + "/" + DiscovererId + "/" + ApplicationId + "/" + SupervisorId); CommonHelper.Spinner = string.Empty; StateHasChanged(); }
public ITypeList Generate([NotNull] EndpointList endpoints, IDictionary <string, OpenApiSchema> schemas) { var typeList = new TypeList(); GenerateSchemas(schemas, typeList); var entryEndpoint = GenerateEntryEndpoint(); entryEndpoint.Properties.AddRange(GenerateEndpoints(endpoints, typeList)); typeList.Add(new Endpoint(), entryEndpoint); return(typeList); }
private static IEndpoint ExtractElementEndpoint(EndpointList childEndpoints) { var match = childEndpoints.FirstOrDefault(x => x.Key.StartsWith("{") && x.Key.EndsWith("}")); if (match.Value == null) { return(null); } childEndpoints.Remove(match.Key); match.Value.Uri = null; return(match.Value); }
public static void DeletePackageFromBlob(IServiceManagement channel, string storageName, string subscriptionId, Uri packageUri) { StorageService storageKeys = channel.GetStorageKeys(subscriptionId, storageName); string primary = storageKeys.StorageServiceKeys.Primary; storageKeys = channel.GetStorageService(subscriptionId, storageName); EndpointList endpoints = storageKeys.StorageServiceProperties.Endpoints; string str = ((List <string>)endpoints).Find((string p) => p.Contains(".blob.")); StorageCredentialsAccountAndKey storageCredentialsAccountAndKey = new StorageCredentialsAccountAndKey(storageName, primary); CloudBlobClient cloudBlobClient = new CloudBlobClient(str, storageCredentialsAccountAndKey); CloudBlob blobReference = cloudBlobClient.GetBlobReference(packageUri.AbsoluteUri); blobReference.DeleteIfExists(); }
public EndpointList GetEndpoints(PathTree tree) { var result = new EndpointList(); foreach (var pair in tree.Children) { var endpoint = _patterns.Select(x => x.TryGetEndpoint(pair.Value, this)) .First(x => x != null); endpoint.Uri = "./" + pair.Key; result[pair.Key] = endpoint; } return(result); }
/// <summary> /// OnAfterRenderAsync /// </summary> /// <param name="firstRender"></param> protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { EndpointList = await RegistryHelper.GetEndpointListAsync(DiscovererId, ApplicationId, SupervisorId); Page = "1"; PagedendpointList = EndpointList.GetPaged(int.Parse(Page), CommonHelper.PageLength, EndpointList.Error); CommonHelper.Spinner = string.Empty; CommonHelper.CheckErrorOrEmpty(PagedendpointList, ref _tableView, ref _tableEmpty); StateHasChanged(); _endpointEvents = await RegistryServiceEvents.SubscribeEndpointEventsAsync( ev => InvokeAsync(() => EndpointEvent(ev))); } }
private IEnumerable <CSharpProperty> GenerateEndpoints(EndpointList endpoints, TypeList typeList) => endpoints.Select(x => GenerateEndpoint(x.Key, x.Value, typeList));
public static OpenApiDocument SetTypedRestEndpoints([NotNull] this OpenApiDocument document, [NotNull] EndpointList list) { document.Extensions[EndpointList.ExtensionKey] = list; return(document); }