public PublicationConnection GetPublications(ContentNamespace ns, IPagination pagination,
                                              InputPublicationFilter filter, string customMetaFilter,
                                              IContextData contextData)
 =>
 _client.Execute <ContentQuery>(GraphQLRequests.Publications(ns, pagination, filter, customMetaFilter,
                                                             contextData,
                                                             GlobalContextDataInternal)).TypedResponseData.Publications;
 public async Task <Page> GetPageAsync(CmUri cmUri,
                                       string customMetaFilter, ContentIncludeMode contentIncludeMode, IContextData contextData,
                                       CancellationToken cancellationToken = default(CancellationToken))
 => (await _client.ExecuteAsync <ContentQuery>(
         GraphQLRequests.Page(cmUri, customMetaFilter, contentIncludeMode, contextData, GlobalContextDataInternal),
         cancellationToken).ConfigureAwait(false))
 .TypedResponseData.Page;
 public async Task <string> ResolvePageLinkAsync(ContentNamespace ns, int publicationId, int pageId,
                                                 bool renderRelativeLink             = true,
                                                 CancellationToken cancellationToken = default(CancellationToken)) => (
     await
     _client.ExecuteAsync <ContentQuery>(
         GraphQLRequests.ResolvePageLink(ns, publicationId, pageId, renderRelativeLink),
         cancellationToken).ConfigureAwait(false)).TypedResponseData.PageLink.Url;
 public ItemConnection ExecuteItemQuery(InputItemFilter filter, InputSortParam sort, IPagination pagination,
                                        string customMetaFilter, ContentIncludeMode contentIncludeMode, bool includeContainerItems,
                                        IContextData contextData)
 =>
 _client.Execute <ContentQuery>(GraphQLRequests.ExecuteItemQuery(filter, sort, pagination,
                                                                 customMetaFilter, contentIncludeMode, includeContainerItems,
                                                                 contextData, GlobalContextDataInternal)).TypedResponseData.Items;
 public BinaryComponent GetBinaryComponent(ContentNamespace ns, int publicationId, string url,
                                           string customMetaFilter,
                                           IContextData contextData)
 =>
 _client.Execute <ContentQuery>(GraphQLRequests.BinaryComponent(ns, publicationId, url, customMetaFilter,
                                                                contextData,
                                                                GlobalContextDataInternal)).TypedResponseData.BinaryComponent;
 public Page GetPage(ContentNamespace ns, int publicationId, string url, string customMetaFilter,
                     ContentIncludeMode contentIncludeMode,
                     IContextData contextData)
 => _client.Execute <ContentQuery>(
     GraphQLRequests.Page(ns, publicationId, url, customMetaFilter, contentIncludeMode, contextData,
                          GlobalContextDataInternal))
 .TypedResponseData.Page;
 public ComponentPresentation GetComponentPresentation(ContentNamespace ns, int publicationId, int componentId,
                                                       int templateId,
                                                       string customMetaFilter, ContentIncludeMode contentIncludeMode, IContextData contextData)
 => _client.Execute <ContentQuery>(
     GraphQLRequests.ComponentPresentation(ns, publicationId, componentId, templateId, customMetaFilter,
                                           contentIncludeMode, contextData, GlobalContextDataInternal))
 .TypedResponseData.ComponentPresentation;
 public async Task <Publication> GetPublicationAsync(ContentNamespace ns, int publicationId,
                                                     string customMetaFilter,
                                                     IContextData contextData, CancellationToken cancellationToken = default(CancellationToken)) => (
     await
     _client.ExecuteAsync <ContentQuery>(
         GraphQLRequests.Publication(ns, publicationId, customMetaFilter, contextData,
                                     GlobalContextDataInternal),
         cancellationToken).ConfigureAwait(false)).TypedResponseData.Publication;
 public ComponentPresentationConnection GetComponentPresentations(ContentNamespace ns, int publicationId,
                                                                  InputComponentPresentationFilter filter, InputSortParam sort, IPagination pagination,
                                                                  string customMetaFilter,
                                                                  ContentIncludeMode contentIncludeMode, IContextData contextData)
 => _client.Execute <ContentQuery>(
     GraphQLRequests.ComponentPresentations(ns, publicationId, filter, sort, pagination, customMetaFilter,
                                            contentIncludeMode, contextData, GlobalContextDataInternal))
 .TypedResponseData.ComponentPresentations;
 public async Task <ComponentPresentation> GetComponentPresentationAsync(ContentNamespace ns, int publicationId,
                                                                         int componentId, int templateId,
                                                                         string customMetaFilter, ContentIncludeMode contentIncludeMode, IContextData contextData,
                                                                         CancellationToken cancellationToken)
 => (await _client.ExecuteAsync <ContentQuery>(
         GraphQLRequests.ComponentPresentation(ns, publicationId, componentId, templateId, customMetaFilter,
                                               contentIncludeMode, contextData, GlobalContextDataInternal),
         cancellationToken).ConfigureAwait(false))
 .TypedResponseData.ComponentPresentation;
 public async Task <ComponentPresentationConnection> GetComponentPresentationsAsync(ContentNamespace ns,
                                                                                    int publicationId, InputComponentPresentationFilter filter,
                                                                                    InputSortParam sort, IPagination pagination, string customMetaFilter, ContentIncludeMode contentIncludeMode,
                                                                                    IContextData contextData, CancellationToken cancellationToken)
 => (await _client.ExecuteAsync <ContentQuery>(
         GraphQLRequests.ComponentPresentations(ns, publicationId, filter, sort, pagination, customMetaFilter,
                                                contentIncludeMode, contextData, GlobalContextDataInternal),
         cancellationToken).ConfigureAwait(false))
 .TypedResponseData.ComponentPresentations;
 public async Task <PageConnection> GetPagesAsync(ContentNamespace ns, IPagination pagination, string url,
                                                  string customMetaFilter,
                                                  ContentIncludeMode contentIncludeMode, IContextData contextData,
                                                  CancellationToken cancellationToken = default(CancellationToken))
 => (await _client.ExecuteAsync <ContentQuery>(
         GraphQLRequests.Pages(ns, pagination, url, customMetaFilter, contentIncludeMode, contextData,
                               GlobalContextDataInternal),
         cancellationToken).ConfigureAwait(false))
 .TypedResponseData.Pages;
 public async Task <ItemConnection> ExecuteItemQueryAsync(InputItemFilter filter, InputSortParam sort,
                                                          IPagination pagination, string customMetaFilter, ContentIncludeMode contentIncludeMode,
                                                          bool includeContainerItems,
                                                          IContextData contextData,
                                                          CancellationToken cancellationToken = default(CancellationToken)) => (
     await
     _client.ExecuteAsync <ContentQuery>(
         GraphQLRequests.ExecuteItemQuery(filter, sort, pagination, customMetaFilter, contentIncludeMode,
                                          includeContainerItems,
                                          contextData, GlobalContextDataInternal)
         , cancellationToken).ConfigureAwait(false)).TypedResponseData.Items;
 public dynamic GetPageModelData(ContentNamespace ns, int publicationId, string url,
                                 PageInclusion pageInclusion, ContentIncludeMode contentIncludeMode, IContextData contextData)
 {
     try
     {
         var response =
             _client.Execute(GraphQLRequests.PageModelData(ns, publicationId, url,
                                                           pageInclusion, contentIncludeMode, contextData, GlobalContextDataInternal));
         return(response.Data.page.rawContent.data);
     }
     catch (RuntimeBinderException e)
     {
         throw new ApiException(
                   $"Failed to get page model data (namespaceId:{ns}, publicationId:{publicationId}, url:{url}", e);
     }
 }
 public dynamic GetEntityModelData(ContentNamespace ns, int publicationId, int entityId, int templateId,
                                   ContentIncludeMode contentIncludeMode, IContextData contextData)
 {
     try
     {
         var response =
             _client.Execute(GraphQLRequests.EntityModelData(ns, publicationId, entityId, templateId,
                                                             contentIncludeMode, contextData, GlobalContextDataInternal));
         return(response.Data.componentPresentation.rawContent.data);
     }
     catch (RuntimeBinderException e)
     {
         throw new ApiException(
                   $"Failed to get enity model data (namespaceId:{ns}, publicationId:{publicationId}, entityId:{entityId}",
                   e);
     }
 }
 public TaxonomySitemapItem GetSitemap(ContentNamespace ns, int publicationId, int descendantLevels,
                                       IContextData contextData)
 {
     try
     {
         var response =
             _client.Execute <ContentQuery>(GraphQLRequests.Sitemap(ns, publicationId, descendantLevels,
                                                                    contextData, GlobalContextDataInternal));
         return(response.TypedResponseData.Sitemap);
     }
     catch (RuntimeBinderException e)
     {
         throw new ApiException(
                   $"Failed to get sitemap (namespaceId:{ns}, publicationId:{publicationId}, descendantLevels:{descendantLevels}",
                   e);
     }
 }
 public List <TaxonomySitemapItem> GetSitemapSubtree(ContentNamespace ns, int publicationId, string taxonomyNodeId,
                                                     int descendantLevels, Ancestor ancestor,
                                                     IContextData contextData)
 {
     try
     {
         var response =
             _client.Execute <ContentQuery>(GraphQLRequests.SitemapSubtree(ns, publicationId, taxonomyNodeId,
                                                                           descendantLevels, ancestor, contextData, GlobalContextDataInternal));
         return(response.TypedResponseData.SitemapSubtree);
     }
     catch (RuntimeBinderException e)
     {
         throw new ApiException(
                   $"Failed to get sitemap subtree (namespaceId:{ns}, publicationId:{publicationId}, taxonomyNodeId{taxonomyNodeId}, descendantLevels:{descendantLevels}",
                   e);
     }
 }
        public async Task <dynamic> GetPageModelDataAsync(ContentNamespace ns, int publicationId, string url,
                                                          PageInclusion pageInclusion, ContentIncludeMode contentIncludeMode, IContextData contextData,
                                                          CancellationToken cancellationToken = default(CancellationToken))
        {
            try
            {
                var response =
                    await
                    _client.ExecuteAsync(
                        GraphQLRequests.PageModelData(ns, publicationId, url, pageInclusion,
                                                      contentIncludeMode, contextData, GlobalContextDataInternal), cancellationToken)
                    .ConfigureAwait(false);

                return(response.Data.page.rawContent.data);
            }
            catch (RuntimeBinderException e)
            {
                throw new ApiException(
                          $"Failed to get page model data (namespaceId:{ns}, publicationId:{publicationId}, url:{url}", e);
            }
        }
        public async Task <List <TaxonomySitemapItem> > GetSitemapSubtreeAsync(ContentNamespace ns, int publicationId,
                                                                               string taxonomyNodeId, int descendantLevels, Ancestor ancestor,
                                                                               IContextData contextData, CancellationToken cancellationToken = default(CancellationToken))
        {
            try
            {
                var response =
                    await
                    _client.ExecuteAsync(
                        GraphQLRequests.SitemapSubtree(ns, publicationId, taxonomyNodeId, descendantLevels,
                                                       ancestor, contextData, GlobalContextDataInternal), cancellationToken)
                    .ConfigureAwait(false);

                return(response.Data.sitemapSubtree);
            }
            catch (RuntimeBinderException e)
            {
                throw new ApiException(
                          $"Failed to get sitemap subtree (namespaceId:{ns}, publicationId:{publicationId}, taxonomyNodeId{taxonomyNodeId}, descendantLevels:{descendantLevels}",
                          e);
            }
        }
        public async Task <dynamic> GetEntityModelDataAsync(ContentNamespace ns, int publicationId, int entityId,
                                                            int templateId, ContentIncludeMode contentIncludeMode, IContextData contextData,
                                                            CancellationToken cancellationToken = default(CancellationToken))
        {
            try
            {
                var response =
                    await
                    _client.ExecuteAsync(
                        GraphQLRequests.EntityModelData(ns, publicationId, entityId, templateId,
                                                        contentIncludeMode, contextData, GlobalContextDataInternal), cancellationToken)
                    .ConfigureAwait(false);

                return(response.Data.entity.rawContent.data);
            }
            catch (RuntimeBinderException e)
            {
                throw new ApiException(
                          $"Failed to get enity model data (namespaceId:{ns}, publicationId:{publicationId}, entityId:{entityId}",
                          e);
            }
        }
 public async Task <PublicationMapping> GetPublicationMappingAsync(ContentNamespace ns, string url,
                                                                   CancellationToken cancellationToken = default(CancellationToken)) => (await
                                                                                                                                         _client.ExecuteAsync <ContentQuery>(GraphQLRequests.PublicationMapping(ns, url), cancellationToken)
                                                                                                                                         .ConfigureAwait(false))
 .TypedResponseData.PublicationMapping;
 public T ExecuteExternalItemQuery <T>(string eclUri, string itemType, List <string> itemFields)
 => _client.Execute <ExternalItemConnection <T> >(GraphQLRequests.BuildExternalItemQuery(eclUri, itemType, itemFields)).TypedResponseData.ExternalItem;
 public Publication GetPublication(ContentNamespace ns, int publicationId,
                                   string customMetaFilter, IContextData contextData)
 => _client.Execute <ContentQuery>(GraphQLRequests.Publication(ns, publicationId, customMetaFilter,
                                                               contextData, GlobalContextDataInternal)).TypedResponseData.Publication;
 public async Task <T> ExecuteExternalItemQueryAsync <T>(string eclUri, string itemType, List <string> itemFields, CancellationToken cancellationToken = default(CancellationToken))
 => (
     await
     _client.ExecuteAsync <ExternalItemConnection <T> >(
         GraphQLRequests.BuildExternalItemQuery(eclUri, itemType, itemFields)
         , cancellationToken).ConfigureAwait(false)).TypedResponseData.ExternalItem;
 public string ResolvePageLink(ContentNamespace ns, int publicationId, int pageId, bool renderRelativeLink = true)
 =>
 _client.Execute <ContentQuery>(GraphQLRequests.ResolvePageLink(ns, publicationId, pageId,
                                                                renderRelativeLink))
 .TypedResponseData.PageLink.Url;
 public async Task <BinaryComponent> GetBinaryComponentAsync(CmUri cmUri, string customMetaFilter,
                                                             IContextData contextData, CancellationToken cancellationToken = default(CancellationToken)) => (await
                                                                                                                                                             _client.ExecuteAsync <ContentQuery>(
                                                                                                                                                                 GraphQLRequests.BinaryComponent(cmUri, customMetaFilter, contextData, GlobalContextDataInternal),
                                                                                                                                                                 cancellationToken).ConfigureAwait(false))
 .TypedResponseData.BinaryComponent;
 public string ResolveComponentLink(ContentNamespace ns, int publicationId, int componentId, int?sourcePageId,
                                    int?excludeComponentTemplateId, bool renderRelativeLink = true)
 => _client.Execute <ContentQuery>(GraphQLRequests.ResolveComponentLink(ns, publicationId, componentId,
                                                                        sourcePageId, excludeComponentTemplateId, renderRelativeLink)).TypedResponseData.ComponentLink.Url;
 public string ResolveBinaryLink(ContentNamespace ns, int publicationId, int binaryId, string variantId,
                                 bool renderRelativeLink = true)
 =>
 _client.Execute <ContentQuery>(GraphQLRequests.ResolveBinaryLink(ns, publicationId, binaryId, variantId,
                                                                  renderRelativeLink))
 .TypedResponseData.BinaryLink.Url;
 public string ResolveDynamicComponentLink(ContentNamespace ns, int publicationId, int pageId, int componentId,
                                           int templateId, bool renderRelativeLink = true)
 => _client.Execute <ContentQuery>(GraphQLRequests.ResolveDynamicComponentLink(ns, publicationId, pageId,
                                                                               componentId, templateId, renderRelativeLink)).TypedResponseData.DynamicComponentLink.Url;
 public PublicationMapping GetPublicationMapping(ContentNamespace ns, string url)
 => _client.Execute <ContentQuery>(GraphQLRequests.PublicationMapping(ns, url))
 .TypedResponseData.PublicationMapping;