diff --git a/README.md b/README.md index 8f0cd66..bdf34e3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,12 @@ SDL Dynamic Experience Delivery GraphQL client for .NET === - Develop: ![Build Status](https://github.com/sdl/graphql-client-dotnet/workflows/Build/badge.svg?branch=develop) -- 2.2: ![Build Status](https://github.com/sdl/graphql-client-dotnet/workflows/Build/badge.svg?branch=release/2.2) + +Prerequisites +------------- +For building .NET you must have the following installed: +- Visual Studio 2019 +- .NET Framework 4.6.2 Prerequisites ------------- @@ -53,7 +58,7 @@ Of course, it is also possible (and appreciated) to report an issue without asso License ------- -Copyright (c) 2014-2020 SDL Group. +Copyright (c) 2014-2021 SDL Group. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/_travis.yml b/_travis.yml deleted file mode 100644 index 2c613e5..0000000 --- a/_travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: csharp -solution: net/sln/Sdl.Tridion.Api.Client.sln - diff --git a/net/BuildGraphQLModel.cmd b/net/BuildGraphQLModel.cmd index 2d02e7e..58e76e9 100644 --- a/net/BuildGraphQLModel.cmd +++ b/net/BuildGraphQLModel.cmd @@ -1,3 +1,3 @@ @echo off msbuild sln\BuildGraphQLModel.sln -src\BuildGraphQLModel\bin\Debug\BuildGraphQLModel.exe -ns Sdl.Tridion.Api.Client.ContentModel -e http://localhost:8081/udp/content -o src\Sdl.Tridion.Api.Client\ContentModel\ContentModel.cs -f cs \ No newline at end of file +src\BuildGraphQLModel\bin\Debug\BuildGraphQLModel.exe -ns Sdl.Tridion.Api.Client.ContentModel -e http://localhost:8081/cd/api -o src\Sdl.Tridion.Api.Client\ContentModel\ContentModel.cs -f cs \ No newline at end of file diff --git a/net/sln/Sdl.Tridion.Api.Client.Tests.sln b/net/sln/Sdl.Tridion.Api.Client.Tests.sln new file mode 100644 index 0000000..87610c4 --- /dev/null +++ b/net/sln/Sdl.Tridion.Api.Client.Tests.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.32802.440 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sdl.Tridion.Api.Client.Tests", "..\src\Sdl.Tridion.Api.Client.Tests\Sdl.Tridion.Api.Client.Tests.csproj", "{28B0C39E-749E-4AED-87D6-84A78783D47F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {28B0C39E-749E-4AED-87D6-84A78783D47F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28B0C39E-749E-4AED-87D6-84A78783D47F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28B0C39E-749E-4AED-87D6-84A78783D47F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28B0C39E-749E-4AED-87D6-84A78783D47F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A8491C8F-ADA3-4779-B46F-044B6BAB646D} + EndGlobalSection +EndGlobal diff --git a/net/src/Sdl.Tridion.Api.Client.Tests/MockGraphQLClient.cs b/net/src/Sdl.Tridion.Api.Client.Tests/MockGraphQLClient.cs index a6323e6..583fde3 100644 --- a/net/src/Sdl.Tridion.Api.Client.Tests/MockGraphQLClient.cs +++ b/net/src/Sdl.Tridion.Api.Client.Tests/MockGraphQLClient.cs @@ -44,5 +44,6 @@ public Task SchemaAsync() } public List LastErrors { get; } + public int RetryCount { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } } } diff --git a/net/src/Sdl.Tridion.Api.Client.Tests/TestPublicContentApi.cs b/net/src/Sdl.Tridion.Api.Client.Tests/TestPublicContentApi.cs index 96857f9..c2d0d1f 100644 --- a/net/src/Sdl.Tridion.Api.Client.Tests/TestPublicContentApi.cs +++ b/net/src/Sdl.Tridion.Api.Client.Tests/TestPublicContentApi.cs @@ -57,6 +57,7 @@ public Task SchemaAsync() } public List LastErrors { get; } + public int RetryCount { get => throw new System.NotImplementedException(); set => throw new System.NotImplementedException(); } private void ValidateRequest(IGraphQLRequest request) { @@ -122,6 +123,30 @@ public void TestGlobalContextData() var client = CreateClient(new MockGraphQLClient(expected)); + InputItemFilter filters = new InputItemFilter + { + ItemTypes = new List {FilterItemType.COMPONENT}, + Schema = new InputSchemaCriteria { Id = 5309 }, + PublicationIds = new List {14} + }; + + List orList = new List(); + InputItemFilter inputItemFilterCustomMeta = new InputItemFilter(); + inputItemFilterCustomMeta.CustomMeta = new InputCustomMetaCriteria { Key = "solutionCategory", Scope = CriteriaScope.Item, Value = "Hello" }; + orList.Add(inputItemFilterCustomMeta); + filters.And = orList; + + InputSortParam sort = new InputSortParam + { + Order = SortOrderType.Descending, + SortBy = SortFieldType.CUSTOM_META, + KeyType = SortKeyType.DATE, + Key = "dateSort" + }; + + client.ExecuteItemQuery(filters, sort, new Pagination() {First = 5}, null, ContentIncludeMode.Exclude, false, null); + + client.GetBinaryComponent(ContentNamespace.Sites, 1, "/", null, claims); client.GlobalContextData = claims; diff --git a/net/src/Sdl.Tridion.Api.Client/ApiClient.cs b/net/src/Sdl.Tridion.Api.Client/ApiClient.cs index 8ff1f06..3040b44 100644 --- a/net/src/Sdl.Tridion.Api.Client/ApiClient.cs +++ b/net/src/Sdl.Tridion.Api.Client/ApiClient.cs @@ -55,6 +55,12 @@ public int Timeout set { _client.Timeout = value; } } + public int RetryCount + { + get { return _client.RetryCount; } + set { _client.RetryCount = value; } + } + public IHttpClient HttpClient => _client.HttpClient; @@ -321,6 +327,101 @@ public List GetSitemapSubtree(ContentNamespace ns, int publ } } + /// + /// Search by raw criteria + /// + /// Raw criteria DSL generated by IqQuery API + /// Result filter + /// Pagination + /// Search results + public FacetedSearchResults SearchByRawCriteria(string rawCriteria, InputResultFilter resultFilter, IPagination pagination) + { + try + { + var response = + _client.Execute(GraphQLRequests.SearchByRawCriteria(rawCriteria, resultFilter, pagination)); + return response.TypedResponseData.Search; + } + catch (RuntimeBinderException e) + { + throw new ApiException( + $"Failed to get search results (rawCriteria:{rawCriteria})", e); + } + } + + /// + /// Search by criteria + /// + /// + /// + /// + /// + /// + public FacetedSearchResults SearchByCriteria(InputCriteria inputCriteria, InputResultFilter resultFilter, IPagination pagination) + { + try + { + var response = + _client.Execute(GraphQLRequests.SearchByCriteria(inputCriteria, resultFilter, pagination)); + return response.TypedResponseData.Search; + } + catch (RuntimeBinderException e) + { + throw new ApiException( + $"Failed to get search results (inputCriteria:{inputCriteria})", e); + } + } + + /// + /// Faceted Search by criteria + /// + /// + /// + /// + /// + /// + /// + public FacetedSearchResults FacetedSearch(InputCriteria inputCriteria, InputFacets inputFacets, string language, InputResultFilter resultFilter, IPagination pagination) + { + try + { + var response = + _client.Execute(GraphQLRequests.FacetedSearch(inputCriteria, inputFacets, language, resultFilter, pagination)); + return response.TypedResponseData.Search; + } + catch (RuntimeBinderException e) + { + throw new ApiException( + $"Failed to get search results (inputCriteria:{inputCriteria})", e); + } + } + + /// + /// Suggest - Filter results to match facets used within your content + /// + /// + /// + /// + /// + /// + /// + /// + /// + public ConceptSuggestionConnection Suggest(string label, string language, bool fuzzy, bool used, string connectorId, IPagination pagination) + { + try + { + var response = + _client.Execute(GraphQLRequests.Suggest(label, language, fuzzy, used, connectorId, pagination)); + return response.TypedResponseData.Suggest; + } + catch (RuntimeBinderException e) + { + throw new ApiException( + $"Failed to get search results (Suggest:{label})", e); + } + } + #endregion #region IPublicContentApiAsync diff --git a/net/src/Sdl.Tridion.Api.Client/ContentModel/ContentModel.cs b/net/src/Sdl.Tridion.Api.Client/ContentModel/ContentModel.cs index ffaa51c..ee97839 100644 --- a/net/src/Sdl.Tridion.Api.Client/ContentModel/ContentModel.cs +++ b/net/src/Sdl.Tridion.Api.Client/ContentModel/ContentModel.cs @@ -1,4 +1,4 @@ -// This file was generated by a tool on 25/10/2018 09:36:50 +// This file was generated by a tool on 20/03/2023 12:50:12 using System.Collections; using System.Collections.Generic; using Newtonsoft.Json; @@ -6,111 +6,182 @@ namespace Sdl.Tridion.Api.Client.ContentModel { - /// - /// The query root for the GraphQL Public Content API. - /// - public class ContentQuery - { - /// - /// Returns the binary component given its CM_URI (takes precedence over the other arguments).ONLY if CM_URI is not specified, the binary is identified by its namespaceId, publicationId and binaryId. Alternatively a binary varinat URL can be used instead of a binary ID. - /// - public BinaryComponent BinaryComponent { get; set; } + /// + /// The query root for the GraphQL Public Content API. + /// + public class ContentQuery + { + /// + /// Returns the binary component given its CM_URI (takes precedence over the other arguments).ONLY if CM_URI is not specified, the binary is identified by its namespaceId, publicationId and binaryId. Alternatively a binary variant URL can be used instead of a binary ID. + /// + public BinaryComponent BinaryComponent { get; set; } - /// - /// Resolve a link by parameters. - /// - public Link BinaryLink { get; set; } + /// + /// Resolve a link by parameters. + /// + public Link BinaryLink { get; set; } - /// - /// Returns the categories for the given namespace and publication IDs. - /// - public KeywordConnection Categories { get; set; } + /// + /// Returns the categories for the given namespace and publication IDs. + /// + public KeywordConnection Categories { get; set; } - /// - /// Resolve a link by parameters. - /// - public Link ComponentLink { get; set; } + /// + /// Returns the component given the namespace, publication, component IDs. + /// + public Component Component { get; set; } - /// - /// Returns the component presentation given the namespace, publication, component and template IDs. - /// - public ComponentPresentation ComponentPresentation { get; set; } + /// + /// Resolve a link by parameters. + /// + public Link ComponentLink { get; set; } - /// - /// Get a list of component presentations filtered by set of criteria. - /// - public ComponentPresentationConnection ComponentPresentations { get; set; } + /// + /// Returns the component presentation given the namespace, publication, component and template IDs. + /// + public ComponentPresentation ComponentPresentation { get; set; } - /// - /// Resolve a link by parameters. - /// - public Link DynamicComponentLink { get; set; } + /// + /// Get a list of component presentations filtered by set of criteria. + /// + public ComponentPresentationConnection ComponentPresentations { get; set; } - /// - /// Get a list of items filtered by set of criteria. - /// - public ItemConnection Items { get; set; } + /// + /// Resolve a link by parameters. + /// + public Link DynamicComponentLink { get; set; } - /// - /// Returns the keyword for the given namespace, publication, category and keyword IDs. - /// - public Keyword Keyword { get; set; } + /// + /// Get a list of items filtered by set of criteria. + /// + public ItemConnection Items { get; set; } - /// - /// Returns the page given its CM_URI. Takes precedence over the other arguments.ONLY If CM_URI is not specified, the page is identified by its namespaceId, publicationId and pageId. Alternatively a page URL can be used instead of a page ID. - /// - public Page Page { get; set; } + /// + /// Returns the keyword for the given namespace, publication, category and keyword IDs. + /// + public Keyword Keyword { get; set; } - /// - /// Resolve a link by parameters. - /// - public Link PageLink { get; set; } + /// + /// Returns the page given its CM_URI. Takes precedence over the other arguments.ONLY If CM_URI is not specified, the page is identified by its namespaceId, publicationId and pageId. Alternatively a page URL can be used instead of a page ID. + /// + public Page Page { get; set; } - /// - /// Returns the list of pages matching the provided namespace ID and page URL. - /// - public PageConnection Pages { get; set; } + /// + /// Resolve a link by parameters. + /// + public Link PageLink { get; set; } - /// - /// Returns the publication given the specified namespace and publication IDs. - /// - public Publication Publication { get; set; } + /// + /// Returns the list of pages matching the provided namespace ID and page URL. + /// + public PageConnection Pages { get; set; } - /// - /// Returns the publication mapping given the specified namespace and site URL. - /// - public PublicationMapping PublicationMapping { get; set; } + /// + /// Returns the publication given the specified namespace and publication IDs. + /// + public Publication Publication { get; set; } - /// - /// Returns the list of publications given the namespace ID and an optional filter. - /// - public PublicationConnection Publications { get; set; } + /// + /// Returns the publication mapping given the specified namespace and site URL. + /// + public PublicationMapping PublicationMapping { get; set; } - /// - /// Returns the structure group for the given namespace, publication and structure group IDs. - /// - public StructureGroup StructureGroup { get; set; } + /// + /// Returns the publication mappings for all publications or specified publication within the specified namespace. + /// + public PublicationMappingConnection PublicationMappings { get; set; } - /// - /// Returns the structure groups for the given namespace and publication IDs. - /// - public StructureGroupConnection StructureGroups { get; set; } + /// + /// Returns the list of publications given the namespace ID and an optional filter. + /// + public PublicationConnection Publications { get; set; } - /// - /// Get sitemap - /// - public TaxonomySitemapItem Sitemap { get; set; } + /// + /// Get navigation site map. + /// + public TaxonomySitemapItem Sitemap { get; set; } - /// - /// Get sitemap subtree - /// - public List SitemapSubtree { get; set; } - } + /// + /// Get navigation site map subtree. + /// + public UntypedContent SitemapStructure { get; set; } - /// - /// Represents a component which has binary content. - /// - public class BinaryComponent : IContentComponent, IItem + /// + /// Get navigation site map subtree. + /// + public List SitemapSubtree { get; set; } + + /// + /// Returns the structure group for the given namespace, publication and structure group IDs. + /// + public StructureGroup StructureGroup { get; set; } + + /// + /// Returns the structure groups for the given namespace and publication IDs. + /// + public StructureGroupConnection StructureGroups { get; set; } + + /// + /// Returns the typed component given the namespace, publication, component IDs. + /// + public IContentComponent TypedComponent { get; set; } + + /// + /// Returns the typed page given its CM_URI. Takes precedence over the other arguments.ONLY If CM_URI is not specified, the page is identified by its namespaceId, publicationId and pageId. Alternatively a page URL can be used instead of a page ID. + /// + public IPageItem TypedPage { get; set; } + + /// + /// Faceted search using a criteria. + /// + public FacetedSearchResults Search { get; set; } + + /// + /// Get ish publication given the specified publication Id. + /// + public IshPublication IshPublication { get; set; } + + /// + /// Get list of ish publications. + /// + public IshPublicationConnection IshPublications { get; set; } + + /// + /// Get TOC for a given publication. + /// + public IshToc IshToc { get; set; } + + /// + /// Get TOC structure for a given publication. + /// + public UntypedContent IshTocStructure { get; set; } + + /// + /// Get topic by Id or Url. + /// + public IIshTopic IshTopic { get; set; } + + /// + /// Get a list of topics matching filter. + /// + public IshTopicConnection IshTopics { get; set; } + + /// + /// Suggest + /// + public ConceptSuggestionConnection Suggest { get; set; } + + /// + /// Taxonomy search. + /// + public List Taxonomy { get; set; } + } + + + /// + /// Represents a component which has binary content. + /// + public class BinaryComponent : IContentComponent, IItem { /// /// Returns the date the item was created. @@ -600,10 +671,152 @@ public interface IContentComponent bool? MultiMedia { get; set; } } - /// - /// Represents an item. The root of all content models. - /// - public interface IItem + /// + /// Represents a page item. The root of all page models. + /// + public interface IPageItem + { + /// + /// Returns the list of components in region. + /// + List Components { get; set; } + + /// + /// Returns the items in this container. + /// + List ContainerItems { get; set; } + + /// + /// Returns the content in the page. + /// + IContent Content { get; set; } + + /// + /// Returns the date the item was created. + /// + string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + UntypedContent CustomMetasStructure { get; set; } + + /// + /// Returns the file name path to the page. + /// + string FileName { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + string LastPublishDate { get; set; } + + /// + /// Returns the name of the region. + /// + string Name { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + ContentNamespace NamespaceId { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + int? OwningPublicationId { get; set; } + + /// + /// Returns the template for the page. + /// + Template PageTemplate { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + int PublicationId { get; set; } + + /// + /// Returns the raw content in the page. + /// + RawContent RawContent { get; set; } + + /// + /// Returns the regions for the page. + /// + List Regions { get; set; } + + /// + /// Returns the list of taxonomies for the item. + /// + List Taxonomies { get; set; } + + /// + /// Returns the title of the item. + /// + string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + string UpdatedDate { get; set; } + + /// + /// Identifies the URL of the page. + /// + string Url { get; set; } + } + + /// + /// Represents a page region. + /// + public interface IPageRegion + { + /// + /// Returns the list of components in region. + /// + List Components { get; set; } + + /// + /// Returns the name of the region. + /// + string Name { get; set; } + + /// + /// Returns the regions for the page. + /// + List Regions { get; set; } + } + + /// + /// Represents an item. The root of all content models. + /// + public interface IItem { /// /// Returns the date the item was created. @@ -687,302 +900,458 @@ public class InputClaimValue public string Value { get; set; } } - /// - /// Represents the type of claim value. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum ClaimValueType - { - /// - /// A string value. - /// - STRING, + /// + /// Filter for the componentPresentation root query. When the filter is applied, only the component presentations matching the filter will be in the query result + /// + public class InputComponentPresentationFilter + { + /// + /// List of filters. Items in the query result will match ALL of the elements of the list + /// + public List And { get; set; } - /// - /// A date value. - /// - DATE, + public InputCustomMetaCriteria CustomMeta { get; set; } - /// - /// A float value. - /// - FLOAT, + public InputDateRangeCriteriaImpl DateRange { get; set; } - /// - /// A number value. - /// - NUMBER, + public InputKeywordCriteria Keyword { get; set; } - BOOLEAN - } + /// + /// List of filters. Items in the query result will match ANY of the elements of the list + /// + public List Or { get; set; } - /// - /// Represents a Link. - /// - public class Link - { - /// - /// Identifies the item ID. - /// - public int ItemId { get; set; } + public InputSchemaCriteria Schema { get; set; } - /// - /// Identifies the namespace ID of the item. - /// - public ContentNamespace NamespaceId { get; set; } + public InputTemplateCriteria Template { get; set; } + } - /// - /// Identifies the publication ID of the item. - /// - public int PublicationId { get; set; } + public class InputConcept + { + /// + /// Concept IDs + /// + public List ConceptIds { get; set; } - /// - /// Link type. - /// - public LinkType Type { get; set; } + /// + /// Concept labels + /// + public List ConceptLabels { get; set; } - /// - /// Link url. - /// - public string Url { get; set; } - } + /// + /// Namespace connector ID + /// + public string ConnectorId { get; set; } - /// - /// Represents the type of link. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum LinkType - { - /// - /// A page link. - /// - PAGE, + /// + /// Language + /// + public string Language { get; set; } - /// - /// A component link. - /// - COMPONENT, + /// + /// Concept scheme title + /// + public string SchemeTitle { get; set; } + } - /// - /// A binary link. - /// - BINARY, + /// + /// Concept Facet + /// + public class InputConceptFacet + { + /// + /// Concept scheme Title + /// + public string SchemeTitle { get; set; } - DYNAMIC_COMPONENT - } + /// + /// Connector namespace Id. + /// + public string ConnectorId { get; set; } - /// - /// A connection to a list of items. - /// - public class KeywordConnection - { - /// - /// a list of edges - /// - public List Edges { get; set; } - } + /// + /// Maximum number of results per concept scheme. + /// + public int? First { get; set; } - /// - /// An edge in a connection - /// - public class KeywordEdge - { - /// - /// The item at the end of the edge - /// - public Keyword Node { get; set; } + /// + /// Language + /// + public string Language { get; set; } + } - /// - /// cursor marks a unique position or index into the connection - /// - public string Cursor { get; set; } - } + /// + /// Input Concept Recommendation + /// + public class InputConceptRecommendation + { + /// + /// Boost factor for given concept scheme. Default value is 1.0 + /// + public float BoostBy { get; set; } - /// - /// Represents a keyword taxonomy item. - /// - public class Keyword : ITaxonomyItem, IItem - { - /// - /// Returns the child taxonomies for the taxonomy. - /// - public TaxonomyItemConnection Children { get; set; } + /// + /// Parent level used when broadening the results with hierarchy for given concept scheme. Default value is 0, broadening will not happen. When value is 1 or higher, broadening will happen until given level. + /// + public int? BroadenBy { get; set; } - /// - /// Returns the date the item was created. - /// - public string CreationDate { get; set; } + /// + /// When defined concept IDs will be used for recommendations + /// + public List ConceptIds { get; set; } - /// - /// Returns the custom meta data for the item. - /// - public CustomMetaConnection CustomMetas { get; set; } + /// + /// Namespace connector ID + /// + public string ConnectorId { get; set; } + } - /// - /// Returns the depth (level) of the taxonomy. - /// - public int? Depth { get; set; } + public class InputCriteria + { + public List And { get; set; } - /// - /// Returns the description of the keyword. - /// - public string Description { get; set; } + public InputConcept Concept { get; set; } - /// - /// Identifies the unique ID of the node. - /// - public string Id { get; set; } + public InputField Field { get; set; } - /// - /// Returns the date the item was initially published. - /// - public string InitialPublishDate { get; set; } + public List GroupBy { get; set; } - /// - /// Identifies the item ID. - /// - public int ItemId { get; set; } + public InputId Id { get; set; } - /// - /// Returns the item type of the item. - /// - public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + public InputFieldLanguage LanguageField { get; set; } - /// - /// Returns the key of the taxonomy. - /// - public string Key { get; set; } + public InputFieldMetadata MetadataField { get; set; } - /// - /// Returns the date the item was most recently published. - /// - public string LastPublishDate { get; set; } + public List Or { get; set; } + } - /// - /// Returns the name of the keyword. - /// - public string Name { get; set; } + public class InputCustomMetaCriteria + { + public string Key { get; set; } - /// - /// Identifies the namespace ID of the item. - /// - public ContentNamespace NamespaceId { get; set; } + /// + /// If not given, defaults to Item + /// + public CriteriaScope Scope { get; set; } - /// - /// Returns the publication ID of the publication to which this item belongs. - /// - public int? OwningPublicationId { get; set; } + public string Value { get; set; } - /// - /// Returns the parent taxonomy of the taxonomy. - /// - public ITaxonomyItem Parent { get; set; } + public CustomMetaValueType ValueType { get; set; } + } - /// - /// Identifies the publication ID of the item. - /// - public int PublicationId { get; set; } + public class InputDateRangeCriteriaImpl + { + /// + /// End date & time + /// + public string End { get; set; } - /// - /// Identifies the ID of the taxonomy. - /// - public int TaxonomyId { get; set; } + /// + /// Start date & time + /// + public string Start { get; set; } - /// - /// Identifies the type of the taxonomy. - /// - public TaxonomyType TaxonomyType { get; set; } + /// + /// Date range type + /// + public DateRangeType Type { get; set; } + } - /// - /// Returns the title of the item. - /// - public string Title { get; set; } + /// + /// Input Facets + /// + public class InputFacets + { + /// + /// Concept facets + /// + public List Concepts { get; set; } + } - /// - /// Returns total number of related items. - /// - public int? TotalRelatedItems { get; set; } + public class InputField + { + public string Key { get; set; } - /// - /// Returns the date the item was updated. - /// - public string UpdatedDate { get; set; } + public bool? Strict { get; set; } - /// - /// Returns true if the taxonomy has child taxonomies. - /// - public bool? HasChildren { get; set; } + public string Value { get; set; } + } - /// - /// Returns true if the taxonomy is abstract. - /// - public bool? Abstract { get; set; } + public class InputFieldLanguage + { + public string Key { get; set; } - /// - /// Returns true if the taxonomy is navigable. - /// - public bool? Navigable { get; set; } + public string Language { get; set; } - /// - /// Returns true if the keyword is used for identification. - /// - public bool? UsedForIdentification { get; set; } - } + public bool? Strict { get; set; } - /// - /// Represents a component presentation which has a component associated with a template. - /// - public class ComponentPresentation : IContentFragment, IItem - { - /// - /// Returns the component of the component presentation. - /// - public IContentComponent Component { get; set; } + public string Value { get; set; } + } - /// - /// Returns the component template of the component presentation. - /// - public Template ComponentTemplate { get; set; } + public class InputFieldMetadata + { + public List Keys { get; set; } - /// - /// Returns the content of the component presentation. - /// - public IContent Content { get; set; } + public bool? Strict { get; set; } - /// - /// Returns the date the item was created. - /// - public string CreationDate { get; set; } + public MetadataFieldType Type { get; set; } - /// - /// Returns the custom meta data for the item. - /// - public CustomMetaConnection CustomMetas { get; set; } + public string Value { get; set; } + } + + public class InputId + { + public List Values { get; set; } + } + + /// + /// Represents an ish condition. + /// + public class InputIshCondition + { + /// + /// The condition name. + /// + public string Name { get; set; } + + /// + /// The condition values. + /// + public List Values { get; set; } + } + + /// + /// Docs Item filter for the topics root query. When the filter is applied, only the items matching the filter will be in the query result + /// + public class InputIshItemFilter + { + /// + /// List of filters. Items in the query result will match ALL of the elements of the list + /// + public List And { get; set; } + + public InputCustomMetaCriteria CustomMeta { get; set; } + + /// + /// List of filters. Items in the query result will match ANY of the elements of the list + /// + public List Or { get; set; } + + /// + /// list of publication IDs + /// + public List PublicationIds { get; set; } + } + + /// + /// Item filter for the items root query. When the filter is applied, only the items matching the filter will be in the query result + /// + public class InputItemFilter + { + /// + /// List of filters. Items in the query result will match ALL of the elements of the list + /// + public List And { get; set; } + + public InputCustomMetaCriteria CustomMeta { get; set; } + + /// + /// list of item types to be selected + /// + public List ItemTypes { get; set; } + + public InputKeywordCriteria Keyword { get; set; } + + /// + /// list of namespace IDs + /// + public List NamespaceIds { get; set; } + + /// + /// List of filters. Items in the query result will match ANY of the elements of the list + /// + public List Or { get; set; } + + /// + /// list of publication IDs + /// + public List PublicationIds { get; set; } + + public InputSchemaCriteria Schema { get; set; } + } + + public class InputKeywordCriteria + { + /// + /// Id of the category. Takes precedence over categoryName, if both are present + /// + public int? CategoryId { get; set; } + + public string CategoryName { get; set; } + + public string Key { get; set; } + + /// + /// Id of the keyword. Takes precedence over key, if both are present + /// + public int? KeywordId { get; set; } + } + + /// + /// Represents a filter for a publication query. + /// + public class InputPublicationFilter + { + /// + /// Represents the query type for the filter. + /// + public ContentFilterQueryType QueryType { get; set; } + + /// + /// Represents the value to filter by in the form of 'key=value' pair. + /// + public string Value { get; set; } + + /// + /// Represents the custom meta value type for the filter. UNKNOWN not supported. Defaults to 'String', if empty. + /// + public CustomMetaValueType ValueType { get; set; } + } + + /// + /// Input parameter to enable recommendations + /// + public class InputRecommendation + { + /// + /// Recommend items for the given concepts + /// + public List Concepts { get; set; } + + /// + /// Recommend items for the given item ID + /// + public string Id { get; set; } + } + + /// + /// Filtering and highlighting the search results + /// + public class InputResultFilter + { + /// + /// Fields that will be excluded from results. + /// + public List ExcludeFields { get; set; } + + /// + /// Parameter to enable highlight in all. + /// + public bool? HighlightInAllIsEnabled { get; set; } + + /// + /// Parameter to enable highlight. + /// + public bool? HighlightingIsEnabled { get; set; } + } + + public class InputSchemaCriteria + { + /// + /// Id of the schema. Takes precedence over title, if both are present + /// + public int? Id { get; set; } + + /// + /// Title of the schema. Applicable only for schemas related to dynamic component presentations. + /// + public string Title { get; set; } + } + + /// + /// To define the metadata field type + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum MetadataFieldType + { + /// + /// ANY + /// + ANY, + + /// + /// DATE + /// + DATE, + + /// + /// DOUBLE + /// + DOUBLE, + + /// + /// LONG + /// + LONG, + + TEXT + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum MetadataType + { + /// + /// STRING + /// + STRING, + + /// + /// DATE + /// + DATE, + + FLOAT + } + + /// + /// Represents the type of claim value. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ClaimValueType + { /// - /// Identifies the unique ID of the node. + /// A string value. /// - public string Id { get; set; } + STRING, /// - /// Returns the date the item was initially published. + /// A date value. /// - public string InitialPublishDate { get; set; } + DATE, /// - /// Identifies the item ID. + /// A float value. /// - public int ItemId { get; set; } + FLOAT, /// - /// Returns the item type of the item. + /// A number value. /// - public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + NUMBER, + + BOOLEAN + } + /// + /// Represents a Link. + /// + public class Link + { /// - /// Returns the date the item was most recently published. + /// Identifies the item ID. /// - public string LastPublishDate { get; set; } + public int ItemId { get; set; } /// /// Identifies the namespace ID of the item. @@ -990,36 +1359,82 @@ public class ComponentPresentation : IContentFragment, IItem public ContentNamespace NamespaceId { get; set; } /// - /// Returns the publication ID of the publication to which this item belongs. + /// Identifies the publication ID of the item. /// - public int? OwningPublicationId { get; set; } + public int PublicationId { get; set; } /// - /// Identifies the publication ID of the item. + /// Link type. /// - public int PublicationId { get; set; } + public LinkType Type { get; set; } /// - /// Returns the raw content of the component presentation. + /// Link url. /// - public RawContent RawContent { get; set; } + public string Url { get; set; } + } + /// + /// Represents the type of link. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum LinkType + { /// - /// Returns the title of the item. + /// A page link. /// - public string Title { get; set; } + PAGE, /// - /// Returns the date the item was updated. + /// A component link. /// - public string UpdatedDate { get; set; } + COMPONENT, + + /// + /// A binary link. + /// + BINARY, + + DYNAMIC_COMPONENT } /// - /// Represents a template. + /// A connection to a list of items. /// - public class Template : IItem + public class KeywordConnection + { + /// + /// a list of edges + /// + public List Edges { get; set; } + } + + /// + /// An edge in a connection + /// + public class KeywordEdge + { + /// + /// The item at the end of the edge + /// + public Keyword Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + /// + /// Represents a keyword taxonomy item. + /// + public class Keyword : ITaxonomyItem, IItem { + /// + /// Returns the child taxonomies for the taxonomy. + /// + public TaxonomyItemConnection Children { get; set; } + /// /// Returns the date the item was created. /// @@ -1030,6 +1445,16 @@ public class Template : IItem /// public CustomMetaConnection CustomMetas { get; set; } + /// + /// Returns the depth (level) of the taxonomy. + /// + public int? Depth { get; set; } + + /// + /// Returns the description of the keyword. + /// + public string Description { get; set; } + /// /// Identifies the unique ID of the node. /// @@ -1050,18 +1475,220 @@ public class Template : IItem /// public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + /// + /// Returns the key of the taxonomy. + /// + public string Key { get; set; } + /// /// Returns the date the item was most recently published. /// public string LastPublishDate { get; set; } + /// + /// Returns the name of the keyword. + /// + public string Name { get; set; } + /// /// Identifies the namespace ID of the item. /// public ContentNamespace NamespaceId { get; set; } /// - /// Returns the output format of the template. + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Returns the parent taxonomy of the taxonomy. + /// + public ITaxonomyItem Parent { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Identifies the ID of the taxonomy. + /// + public int TaxonomyId { get; set; } + + /// + /// Identifies the type of the taxonomy. + /// + public TaxonomyType TaxonomyType { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns total number of related items. + /// + public int? TotalRelatedItems { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Returns true if the taxonomy has child taxonomies. + /// + public bool? HasChildren { get; set; } + + /// + /// Returns true if the taxonomy is abstract. + /// + public bool? Abstract { get; set; } + + /// + /// Returns true if the taxonomy is navigable. + /// + public bool? Navigable { get; set; } + + /// + /// Returns true if the keyword is used for identification. + /// + public bool? UsedForIdentification { get; set; } + } + + /// + /// Represents a component presentation which has a component associated with a template. + /// + public class ComponentPresentation : IContentFragment, IItem + { + /// + /// Returns the component of the component presentation. + /// + public IContentComponent Component { get; set; } + + /// + /// Returns the component template of the component presentation. + /// + public Template ComponentTemplate { get; set; } + + /// + /// Returns the content of the component presentation. + /// + public IContent Content { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Returns the raw content of the component presentation. + /// + public RawContent RawContent { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + } + + /// + /// Represents a template. + /// + public class Template : IItem + { + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Returns the output format of the template. /// public string OutputFormat { get; set; } @@ -1228,46 +1855,6 @@ public class ComponentPresentationEdge public string Cursor { get; set; } } - /// - /// Filter for the componentPresentation root query. When the filter is applied, only the component presentations matching the filter will be in the query result - /// - public class InputComponentPresentationFilter - { - /// - /// List of filters. Items in the query result will match ALL of the elements of the list - /// - public List And { get; set; } - - public InputCustomMetaCriteria CustomMeta { get; set; } - - public InputDateRangeCriteriaImpl DateRange { get; set; } - - public InputKeywordCriteria Keyword { get; set; } - - /// - /// List of filters. Items in the query result will match ANY of the elements of the list - /// - public List Or { get; set; } - - public InputSchemaCriteria Schema { get; set; } - - public InputTemplateCriteria Template { get; set; } - } - - public class InputCustomMetaCriteria - { - public string Key { get; set; } - - /// - /// If not given, defaults to Item - /// - public CriteriaScope Scope { get; set; } - - public string Value { get; set; } - - public CustomMetaValueType ValueType { get; set; } - } - [JsonConverter(typeof(StringEnumConverter))] public enum CriteriaScope { @@ -1284,24 +1871,6 @@ public enum CriteriaScope ItemInPublication } - public class InputDateRangeCriteriaImpl - { - /// - /// End date & time - /// - public string End { get; set; } - - /// - /// Start date & time - /// - public string Start { get; set; } - - /// - /// Date range type - /// - public DateRangeType Type { get; set; } - } - [JsonConverter(typeof(StringEnumConverter))] public enum DateRangeType { @@ -1323,59 +1892,61 @@ public enum DateRangeType LAST_PUBLISH_DATE } - public class InputKeywordCriteria + public class InputTemplateCriteria { /// - /// Id of the category. Takes precedence over categoryName, if both are present + /// Id of the template. /// - public int? CategoryId { get; set; } + public int? Id { get; set; } + } - public string CategoryName { get; set; } + /// + /// Sorting the search results + /// + public class InputSortBy + { + /// + /// Fields to sort. + /// + public List Fields { get; set; } - public string Key { get; set; } + /// + /// Sort values as text. + /// + public bool? SortAsText { get; set; } - /// - /// Id of the keyword. Takes precedence over key, if both are present - /// - public int? KeywordId { get; set; } - } + /// + /// Sorting direction. + /// + public SortingDirectionType SortingDirection { get; set; } + } - public class InputSchemaCriteria + /// + /// Represents a typical sort type. When used, the default sorting mechanism (by namespace and by id) is overridden + /// + public class InputSortParam { /// - /// Id of the schema. Takes precedence over title, if both are present + /// The sort order type. /// - public int? Id { get; set; } + public SortOrderType Order { get; set; } /// - /// Title of the schema. + /// The item field used for sorting /// - public string Title { get; set; } - } + public SortFieldType SortBy { get; set; } - public class InputTemplateCriteria - { - /// - /// Id of the template. - /// - public int? Id { get; set; } + public SortKeyType KeyType { get; set; } + public string Key { get; set; } } - /// - /// Represents a typical sort type. When used, the default sorting mechanism (by namespace and by id) is overridden - /// - public class InputSortParam - { - /// - /// The sort order type. - /// - public SortOrderType Order { get; set; } - - /// - /// The item field used for sorting - /// - public SortFieldType SortBy { get; set; } - } + [JsonConverter(typeof(StringEnumConverter))] + public enum SortKeyType + { + DATE, + FLOAT, + STRING + } /// /// Represents a type of natural sort: descending or ascending @@ -1442,13 +2013,29 @@ public enum SortFieldType /// TITLE, - UPDATED_DATE + UPDATED_DATE, + + CUSTOM_META } - /// - /// A connection to a list of items. - /// - public class ItemConnection + /// + /// Sorting direction of results + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SortingDirectionType + { + /// + /// ASCENDING + /// + ASCENDING, + + DESCENDING + } + + /// + /// A connection to a list of items. + /// + public class ItemConnection { /// /// a list of edges @@ -1484,43 +2071,6 @@ public class ItemEdge public string Cursor { get; set; } } - /// - /// Item filter for the items root query. When the filter is applied, only the items matching the filter will be in the query result - /// - public class InputItemFilter - { - /// - /// List of filters. Items in the query result will match ALL of the elements of the list - /// - public List And { get; set; } - - public InputCustomMetaCriteria CustomMeta { get; set; } - - /// - /// list of item types to be selected - /// - public List ItemTypes { get; set; } - - public InputKeywordCriteria Keyword { get; set; } - - /// - /// list of namespace IDs - /// - public List NamespaceIds { get; set; } - - /// - /// List of filters. Items in the query result will match ANY of the elements of the list - /// - public List Or { get; set; } - - /// - /// list of publication IDs - /// - public List PublicationIds { get; set; } - - public InputSchemaCriteria Schema { get; set; } - } - [JsonConverter(typeof(StringEnumConverter))] public enum FilterItemType { @@ -1848,10 +2398,37 @@ public class PublicationMapping public int PublicationId { get; set; } } - /// - /// A connection to a list of items. - /// - public class PublicationConnection + /// + /// A connection to a list of items. + /// + public class PublicationMappingConnection + { + /// + /// a list of edges + /// + public List Edges { get; set; } + } + + /// + /// An edge in a connection + /// + public class PublicationMappingEdge + { + /// + /// The item at the end of the edge + /// + public PublicationMapping Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + /// + /// A connection to a list of items. + /// + public class PublicationConnection { /// /// a list of edges @@ -1875,27 +2452,6 @@ public class PublicationEdge public string Cursor { get; set; } } - /// - /// Represents a filter for a publication query. - /// - public class InputPublicationFilter - { - /// - /// Represents the query type for the filter. - /// - public ContentFilterQueryType QueryType { get; set; } - - /// - /// Represents the value to filter by in the form of 'key=value' pair. - /// - public string Value { get; set; } - - /// - /// Represents the custom meta value type for the filter. UNKNOWN not supported. Defaults to 'String', if empty. - /// - public CustomMetaValueType ValueType { get; set; } - } - [JsonConverter(typeof(StringEnumConverter))] public enum ContentFilterQueryType { @@ -2340,4 +2896,2825 @@ public class ClaimValue public string Value { get; set; } } + /// + /// Represents a facet node. + /// + public interface IFacet + { + /// + /// Identifies the unique ID of the facet. + /// + string Id { get; set; } + } + + /// + /// Faceted search results. + /// + public class FacetedSearchResults + { + /// + /// Facets. + /// + public List Facets { get; set; } + + /// + /// Search results. + /// + public SearchResultsConnection Results { get; set; } + } + + /// + /// A connection to a list of items. + /// + public class SearchResultsConnection + { + /// + /// The total number of the hits + /// + public int? Hits { get; set; } + + /// + /// a list of edges + /// + public List Edges { get; set; } + + /// + /// details about this specific page + /// + public PageInfo PageInfo { get; set; } + } + + /// + /// An edge in a connection + /// + public class SearchResultsEdge + { + /// + /// The item at the end of the edge + /// + public SearchResults Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + /// + /// This is the search result response that contains results from search and broker database. + /// + public class SearchResults + { + /// + /// This is the results from broker database. + /// + public List Broker { get; set; } + + /// + /// This is the results from query service. + /// + public Search Search { get; set; } + } + + public class Search + { + /// + /// The author of the search result. + /// + public string Author { get; set; } + + /// + /// The author of the binary file. + /// + public string BinaryAuthor { get; set; } + + /// + /// The binary content length of the search result. + /// + public long BinaryContentLength { get; set; } + + /// + /// The binary content type of the search result. + /// + public string BinaryContentType { get; set; } + + /// + /// The creation date of the binary file. + /// + public string BinaryCreatedDate { get; set; } + + /// + /// The binary file name of the search result. + /// + public string BinaryFileName { get; set; } + + /// + /// The language of the search result. (binary file) + /// + public string BinaryLanguage { get; set; } + + /// + /// The title of binary file. + /// + public string BinaryTitle { get; set; } + + /// + /// Concept schemes attached to a search result. + /// + public List ConceptSchemes { get; set; } + + /// + /// The creation date of the search result. + /// + public string CreatedDate { get; set; } + + /// + /// A map of fields defined on the search result. + /// + public IDictionary Fields { get; set; } + + /// + /// A map of highlighted search results. + /// + public IDictionary Highlighted { get; set; } + + /// + /// The search result identifier. + /// + public string Id { get; set; } + + /// + /// The item type of the search result. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// The locale of the search result. + /// + public string Locale { get; set; } + + /// + /// The location of the search result. + /// + public string Location { get; set; } + + /// + /// The content of the search result (indexed by locale). + /// + public string MainContentField { get; set; } + + /// + /// The major version of the search result. + /// + public string MajorVersion { get; set; } + + /// + /// The minor version of the search result. + /// + public string MinorVersion { get; set; } + + /// + /// The updated date of the search result. + /// + public string ModifiedDate { get; set; } + + /// + /// The namespace of the search result. + /// + public string Namespace { get; set; } + + /// + /// The publication ID of the search result. + /// + public int? PublicationId { get; set; } + + /// + /// The publication title of the search result. + /// + public string PublicationTitle { get; set; } + + /// + /// The raw content of the search result. + /// + public string RawContent { get; set; } + + /// + /// The title of the search result (indexed by locale). + /// + public string RawLanguageTitle { get; set; } + + /// + /// The schema id of the search result. + /// + public string SchemaId { get; set; } + + /// + /// Matching score of the result. + /// + public float Score { get; set; } + + /// + /// The url of the search result. + /// + public string Url { get; set; } + } + + public class Concept + { + /// + /// Returns the alternative labels for concept. + /// + public List AlternativeLabels { get; set; } + + /// + /// Returns the concept Id. These are case sensitive, so do not mix case when defining IDs. + /// + public string Id { get; set; } + + /// + /// Returns the concept label. + /// + public string Label { get; set; } + + /// + /// Returns the narrower concepts. + /// + public TaxonomyNarrowerConceptsConnection NarrowerConcepts { get; set; } + + /// + /// Returns the parent concept Id graph. + /// + public List ParentConceptIdsGraph { get; set; } + + /// + /// Returns the parent concept Uri graph. + /// + public List ParentConceptsGraph { get; set; } + + /// + /// Returns the related concept Ids graph. + /// + public List RelatedConceptIds { get; set; } + + /// + /// Returns the related concept labels. + /// + public List RelatedConceptLabels { get; set; } + + /// + /// Returns the related concepts. + /// + public TaxonomyRelatedConceptsConnection RelatedConcepts { get; set; } + + /// + /// Returns the concept Uri. + /// + public string Uri { get; set; } + } + + public class ConceptAggregation + { + /// + /// Returns the concept hits. + /// + public int? Count { get; set; } + + /// + /// Returns the concept Id. These are case sensitive, so do not mix case when defining IDs. + /// + public string Id { get; set; } + + /// + /// Returns the concept label. + /// + public string Label { get; set; } + + /// + /// Returns the concept URI. + /// + public string Uri { get; set; } + } + + /// + /// Represents a concept facet. + /// + public class ConceptFacet : IFacet + { + /// + /// Identifies the unique ID of the facet. + /// + public string Id { get; set; } + + /// + /// Concepts. + /// + public List Concepts { get; set; } + + /// + /// Connector ID. + /// + public string ConnectorId { get; set; } + + /// + /// Concept scheme title. + /// + public string Title { get; set; } + + /// + /// Concept scheme URI. + /// + public string Uri { get; set; } + } + + /// + /// Concept Scheme. + /// + public class ConceptScheme + { + /// + /// Returns the default language for this concept scheme. + /// + public string DefaultLanguage { get; set; } + + /// + /// Returns the concept scheme language. + /// + public string Language { get; set; } + + /// + /// Returns the top-level concepts (no parents) for this concept scheme. + /// + public TaxonomyTopConceptsSearchResultsConnection TopConcepts { get; set; } + + /// + /// Returns the results of a concept search within this particular concept scheme. + /// + public List Concepts { get; set; } + + /// + /// Returns the connector Id for this concept scheme. + /// + public string ConnectorId { get; set; } + + /// + /// Returns the concept scheme title. + /// + public string Title { get; set; } + + /// + /// Returns the concept scheme uri. + /// + public string Uri { get; set; } + } + + public class ConceptSuggestion + { + /// + /// Returns the alternative labels for concept. + /// + public List AlternativeLabels { get; set; } + + /// + /// Returns the connector Id. + /// + public string ConnectorId { get; set; } + + /// + /// Returns number of documents marked with concept. + /// + public int? Count { get; set; } + + /// + /// Returns the concept highlighted label. + /// + public List Highlight { get; set; } + + /// + /// Returns the concept Id. These are case sensitive, so do not mix case when defining IDs. + /// + public string Id { get; set; } + + /// + /// Returns the concept label. + /// + public string Label { get; set; } + + /// + /// Returns the narrower concepts. + /// + public TaxonomyNarrowerConceptsConnection NarrowerConcepts { get; set; } + + /// + /// Returns the parent concept Id graph. + /// + public List ParentConceptIdsGraph { get; set; } + + /// + /// Returns the parent concept Uri graph. + /// + public List ParentConceptsGraph { get; set; } + + /// + /// Returns the related concept Ids graph. + /// + public List RelatedConceptIds { get; set; } + + /// + /// Returns the related concept labels. + /// + public List RelatedConceptLabels { get; set; } + + /// + /// Returns the related concepts. + /// + public TaxonomyRelatedConceptsConnection RelatedConcepts { get; set; } + + /// + /// Returns the concept Uri. + /// + public string Uri { get; set; } + } + + /// + /// A connection to a list of items. + /// + public class ConceptSuggestionConnection + { + /// + /// a list of edges + /// + public List Edges { get; set; } + } + + /// + /// An edge in a connection + /// + public class ConceptSuggestionEdge + { + /// + /// The item at the end of the edge + /// + public ConceptSuggestion Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + /// + /// A connection to a list of items. + /// + public class TaxonomyRelatedConceptsConnection + { + /// + /// a list of edges + /// + public List Edges { get; set; } + } + + /// + /// An edge in a connection + /// + public class TaxonomyRelatedConceptsEdge + { + /// + /// The item at the end of the edge + /// + public Concept Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + /// + /// A connection to a list of items. + /// + public class TaxonomyNarrowerConceptsConnection + { + /// + /// a list of edges + /// + public List Edges { get; set; } + } + + /// + /// An edge in a connection + /// + public class TaxonomyNarrowerConceptsEdge + { + /// + /// The item at the end of the edge + /// + public Concept Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + /// + /// A connection to a list of items. + /// + public class TaxonomyTopConceptsSearchResultsConnection + { + /// + /// a list of edges + /// + public List Edges { get; set; } + } + + /// + /// An edge in a connection + /// + public class TaxonomyTopConceptsSearchResultsEdge + { + /// + /// The item at the end of the edge + /// + public Concept Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + /// + /// Information about pagination in a connection. + /// + public class PageInfo + { + /// + /// When paginating forwards, are there more items? + /// + public bool HasNextPage { get; set; } + + /// + /// When paginating backwards, are there more items? + /// + public bool HasPreviousPage { get; set; } + + /// + /// When paginating backwards, the cursor to continue. + /// + public string StartCursor { get; set; } + + /// + /// When paginating forwards, the cursor to continue. + /// + public string EndCursor { get; set; } + } + + /// + /// Represents a concept topic. + /// + public class IshConceptTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshConceptTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a concept topic body. + /// + public class IshConceptTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return Examples + /// + public List Examples { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a collection of ish conditions. + /// + public class IshConditions + { + /// + /// The conditions definitions. + /// + public IDictionary ConditionDefinitions { get; set; } + + /// + /// The publication defined conditions. + /// + public IDictionary PublicationDefinedConditions { get; set; } + + /// + /// The used conditions. + /// + public IDictionary UsedConditions { get; set; } + } + + /// + /// Represents a generic topic. + /// + public class IshGenericTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshGenericTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a generic topic body. + /// + public class IshGenericTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return Examples + /// + public List Examples { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a glossary entry topic. + /// + public class IshGlossaryEntryTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshConceptTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Glossary Definition + /// + public IshTopicSection GlossaryDefinition { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a glossary group topic. + /// + public class IshGlossaryGroupTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshConceptTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Glossary Entries + /// + public List GlossaryEntries { get; set; } + + /// + /// Glossary Groups + /// + public List GlossaryGroups { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning assessment topic. + /// + public class IshLearningAssessmentTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshLearningAssessmentTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning assessment topic body. + /// + public class IshLearningAssessmentTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return lcDuration + /// + public IshTopicSection LcDuration { get; set; } + + /// + /// Return lcInteraction + /// + public List LcInteraction { get; set; } + + /// + /// Return lcIntro + /// + public IshTopicSection LcIntro { get; set; } + + /// + /// Return lcObjectives + /// + public IshTopicSection LcObjectives { get; set; } + + /// + /// Return lcSummary + /// + public IshTopicSection LcSummary { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning content topic. + /// + public class IshLearningContentTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshLearningContentTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning content topic body. + /// + public class IshLearningContentTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return lcChallenge + /// + public IshTopicSection LcChallenge { get; set; } + + /// + /// Return lcDuration + /// + public List LcDuration { get; set; } + + /// + /// Return lcIntructions + /// + public IshTopicSection LcInstruction { get; set; } + + /// + /// Return lcIntro + /// + public List LcIntro { get; set; } + + /// + /// Return lcObjectives + /// + public List LcObjectives { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning overview topic. + /// + public class IshLearningOverviewTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshLearningOverviewTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning overview topic body. + /// + public class IshLearningOverviewTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return lcAudience + /// + public List LcAudience { get; set; } + + /// + /// Return lcDuration + /// + public IshTopicSection LcDuration { get; set; } + + /// + /// Return lcObjectives + /// + public IshTopicSection LcObjectives { get; set; } + + /// + /// Return lcPrereqs + /// + public IshTopicSection LcPrereqs { get; set; } + + /// + /// Return lcResources + /// + public IshTopicSection LcResources { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning plan topic. + /// + public class IshLearningPlanTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshLearningPlanTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning plan topic body. + /// + public class IshLearningPlanTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return lcGapAnalysis + /// + public IshTopicSection LcGapAnalysis { get; set; } + + /// + /// Return lcIntervention + /// + public IshTopicSection LcIntervention { get; set; } + + /// + /// Return lcNeedsAnalysis + /// + public IshTopicSection LcNeedsAnalysis { get; set; } + + /// + /// Return lcProject + /// + public IshTopicSection LcProject { get; set; } + + /// + /// Return lcTechnical + /// + public IshTopicSection LcTechnical { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning summary topic. + /// + public class IshLearningSummaryTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshLearningSummaryTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a learning summary topic body. + /// + public class IshLearningSummaryTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return lcNextSteps + /// + public List LcNextSteps { get; set; } + + /// + /// Return lcObjectives + /// + public List LcObjectives { get; set; } + + /// + /// Return lcResources + /// + public List LcResources { get; set; } + + /// + /// Return lcReview + /// + public List LcReview { get; set; } + + /// + /// Return lcSummary + /// + public List LcSummary { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + public class IshPublication + { + /// + /// Get conditions for the publication. + /// + public IshConditions Conditions { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Returns the multimedia path for the publication. + /// + public string MultimediaPath { get; set; } + + /// + /// Returns the multimedia URL for the publication. + /// + public string MultimediaUrl { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Returns the publication key. + /// + public string PublicationKey { get; set; } + + /// + /// Returns the publication path. + /// + public string PublicationPath { get; set; } + + /// + /// Returns the publication URL. + /// + public string PublicationUrl { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + } + + /// + /// A connection to a list of items. + /// + public class IshPublicationConnection + { + /// + /// a list of edges + /// + public List Edges { get; set; } + } + + /// + /// An edge in a connection + /// + public class IshPublicationEdge + { + /// + /// The item at the end of the edge + /// + public IshPublication Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + public class IshPublicationMetadata + { + /// + /// Changes + /// + public string Changes { get; set; } + + /// + /// Description + /// + public string Description { get; set; } + + /// + /// Document Languages + /// + public List DocLanguages { get; set; } + + /// + /// Language Card Id + /// + public int? LanguageCardId { get; set; } + + /// + /// Logical Ref Id + /// + public int? LogicalRefId { get; set; } + + /// + /// Product Family Name + /// + public string ProductFamilyName { get; set; } + + /// + /// Product Release Labels + /// + public List ProductReleaseLabels { get; set; } + + /// + /// Product Release Name + /// + public string ProductReleaseName { get; set; } + + /// + /// Publication Source Languages + /// + public List PublicationSourceLanguages { get; set; } + + /// + /// Publication Title + /// + public string PublicationTitle { get; set; } + + /// + /// Document Language + /// + public string Publisher { get; set; } + + /// + /// Read Access + /// + public List ReadAccess { get; set; } + + /// + /// Publication Status + /// + public string Status { get; set; } + + /// + /// Title + /// + public string Title { get; set; } + + /// + /// User Groups + /// + public List UserGroups { get; set; } + + /// + /// Version + /// + public string Version { get; set; } + } + + /// + /// Represents a reference topic. + /// + public class IshReferenceTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshReferenceTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a reference topic body. + /// + public class IshReferenceTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return Examples + /// + public List Examples { get; set; } + + /// + /// Return syntax or signature contents + /// + public List RefSyn { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a task topic. + /// + public class IshTaskTopic : IIshTopic, IItem + { + /// + /// Topic abstract + /// + public IshTopicSection Abstract { get; set; } + + /// + /// Topic body + /// + public IshTaskTopicBody Body { get; set; } + + /// + /// Topic Body XHTML + /// + public string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + public string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + public CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + public UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + public string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + public int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + public Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + public string LastPublishDate { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + public ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + public List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + public int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + public int PublicationId { get; set; } + + /// + /// Related links + /// + public IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + public string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + public string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + public string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + public string Url { get; set; } + + /// + /// Used conditions within topic. + /// + public IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Represents a task topic body. + /// + public class IshTaskTopicBody + { + /// + /// Returns the anonymous topic body sections. + /// + public List AnonymousSections { get; set; } + + /// + /// Return Context + /// + public IshTopicSection Context { get; set; } + + /// + /// Return Examples + /// + public List Examples { get; set; } + + /// + /// Return Postreq + /// + public IshTopicSection Postreq { get; set; } + + /// + /// Return Prereq + /// + public IshTopicSection Prereq { get; set; } + + /// + /// Return Result + /// + public IshTopicSection Result { get; set; } + + /// + /// Returns the topic body sections. + /// + public List Sections { get; set; } + + /// + /// Return Steps + /// + public IshTopicSection Steps { get; set; } + + /// + /// Topic XHTML + /// + public string Xhtml { get; set; } + } + + /// + /// Table of Contents + /// + public class IshToc + { + /// + /// Returns the child entries in the TOC. + /// + public List Entries { get; set; } + + /// + /// Identifies the unique ID of the TOC. + /// + public string Id { get; set; } + + /// + /// Returns the title of the TOC. + /// + public string Title { get; set; } + + /// + /// Returns true if TOC has entries below it. + /// + public bool? HasChildren { get; set; } + } + + /// + /// Table of Contents + /// + public class IshTocItem + { + /// + /// Returns custom meta for this TOC entry. + /// + public IDictionary CustomMeta { get; set; } + + /// + /// Returns TOC entries. + /// + public List Entries { get; set; } + + /// + /// Identifies the unique ID of the TOC item. + /// + public string Id { get; set; } + + /// + /// Returns the title of the table of contents. + /// + public string Title { get; set; } + + /// + /// Returns the id of the table of contents entry. + /// + public string TocId { get; set; } + + /// + /// Returns the url for the entry in the TOC. + /// + public string Url { get; set; } + + /// + /// Returns true if this TOC item has entries below it. + /// + public bool? HasChildren { get; set; } + } + + /// + /// Represents an ish Topic. + /// + public interface IIshTopic + { + /// + /// Topic abstract + /// + IshTopicSection Abstract { get; set; } + + /// + /// Topic Body XHTML + /// + string BodyXhtml { get; set; } + + /// + /// Returns the date the item was created. + /// + string CreationDate { get; set; } + + /// + /// Returns the custom meta data for the item. + /// + CustomMetaConnection CustomMetas { get; set; } + + /// + /// Returns the custom meta data structure for the item. Can be used to group related fields together. + /// + UntypedContent CustomMetasStructure { get; set; } + + /// + /// Identifies the unique ID of the node. + /// + string Id { get; set; } + + /// + /// Returns the date the item was initially published. + /// + string InitialPublishDate { get; set; } + + /// + /// Identifies the item ID. + /// + int ItemId { get; set; } + + /// + /// Returns the item type of the item. + /// + Sdl.Tridion.Api.Client.ItemType ItemType { get; set; } + + /// + /// Returns the date the item was most recently published. + /// + string LastPublishDate { get; set; } + + /// + /// Links + /// + List Links { get; set; } + + /// + /// Identifies the namespace ID of the item. + /// + ContentNamespace NamespaceId { get; set; } + + /// + /// Nested topics + /// + List NestedTopics { get; set; } + + /// + /// Returns the publication ID of the publication to which this item belongs. + /// + int? OwningPublicationId { get; set; } + + /// + /// Identifies the publication ID of the item. + /// + int PublicationId { get; set; } + + /// + /// Related links + /// + IshTopicRelatedLinks RelatedLinks { get; set; } + + /// + /// Topic short description + /// + string ShortDescription { get; set; } + + /// + /// Returns the title of the item. + /// + string Title { get; set; } + + /// + /// Returns the date the item was updated. + /// + string UpdatedDate { get; set; } + + /// + /// Topic Url + /// + string Url { get; set; } + + /// + /// Used conditions within topic. + /// + IDictionary UsedConditions { get; set; } + + /// + /// Topic XHTML + /// + string Xhtml { get; set; } + } + + /// + /// A connection to a list of items. + /// + public class IshTopicConnection + { + /// + /// a list of edges + /// + public List Edges { get; set; } + } + + /// + /// An edge in a connection + /// + public class IshTopicEdge + { + /// + /// The item at the end of the edge + /// + public IIshTopic Node { get; set; } + + /// + /// cursor marks a unique position or index into the connection + /// + public string Cursor { get; set; } + } + + public class IshTopicLink + { + /// + /// CM Uri + /// + public string CmUri { get; set; } + + /// + /// Linked item + /// + public IItem Item { get; set; } + + /// + /// Title + /// + public string Title { get; set; } + + /// + /// Type + /// + public string Type { get; set; } + + /// + /// Uri + /// + public string Uri { get; set; } + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum IshTopicLinkRenderOptions + { + /// + /// ABSOLUTE + /// + ABSOLUTE, + + RELATIVE + } + + public class IshTopicRelatedLinks + { + /// + /// Links. + /// + public List Links { get; set; } + + /// + /// Xhtml. + /// + public string Xhtml { get; set; } + } + + [JsonConverter(typeof(StringEnumConverter))] + public enum IshTopicRenderOptions + { + /// + /// RENDER_IMAGES + /// + RENDER_IMAGES, + + /// + /// FAST_RENDER_IMAGES + /// + FAST_RENDER_IMAGES, + + NONE + } + + /// + /// Represents a topic section. + /// + public class IshTopicSection + { + /// + /// Identifies the unique ID of the node. + /// + public string Id { get; set; } + + /// + /// Links + /// + public List Links { get; set; } + + /// + /// Name + /// + public string Title { get; set; } + + /// + /// Type + /// + public string Type { get; set; } + + /// + /// XHTML + /// + public string Xhtml { get; set; } + } + } diff --git a/net/src/Sdl.Tridion.Api.Client/GraphQLClient/GraphQLClient.cs b/net/src/Sdl.Tridion.Api.Client/GraphQLClient/GraphQLClient.cs index 4753244..0425096 100644 --- a/net/src/Sdl.Tridion.Api.Client/GraphQLClient/GraphQLClient.cs +++ b/net/src/Sdl.Tridion.Api.Client/GraphQLClient/GraphQLClient.cs @@ -70,6 +70,15 @@ public int Timeout set { _httpClient.Timeout = value; } } + /// + /// Get/Sets the retry count for any request. + /// + public int RetryCount + { + get { return _httpClient.RetryCount; } + set { _httpClient.RetryCount = value; } + } + /// /// HttpClient used for performing the actual request. /// diff --git a/net/src/Sdl.Tridion.Api.Client/GraphQLClient/IGraphQLClient.cs b/net/src/Sdl.Tridion.Api.Client/GraphQLClient/IGraphQLClient.cs index 3580201..9bba279 100644 --- a/net/src/Sdl.Tridion.Api.Client/GraphQLClient/IGraphQLClient.cs +++ b/net/src/Sdl.Tridion.Api.Client/GraphQLClient/IGraphQLClient.cs @@ -23,6 +23,11 @@ public interface IGraphQLClient /// int Timeout { get; set; } + /// + /// Get/Sets the retry count for the requests. + /// + int RetryCount { get; set; } + /// /// HttpClient used for performing the actual request. /// diff --git a/net/src/Sdl.Tridion.Api.Client/GraphQLRequests.cs b/net/src/Sdl.Tridion.Api.Client/GraphQLRequests.cs index f400eca..9c0f8e6 100644 --- a/net/src/Sdl.Tridion.Api.Client/GraphQLRequests.cs +++ b/net/src/Sdl.Tridion.Api.Client/GraphQLRequests.cs @@ -304,6 +304,63 @@ public static IGraphQLRequest SitemapSubtree(ContentNamespace ns, int publicatio .Build(); } + public static IGraphQLRequest SearchByRawCriteria(string rawCritera, InputResultFilter resultFilter, IPagination pagination) + { + QueryBuilder builder = + new QueryBuilder().WithQueryResource("SearchByRawCriteria", false); + + return + builder + .WithVariable("rawCriteria", rawCritera) + .WithVariable("inputResultFilter", resultFilter) + .WithPagination(pagination) + .Build(); + } + + public static IGraphQLRequest SearchByCriteria(InputCriteria criteria, InputResultFilter resultFilter, IPagination pagination) + { + QueryBuilder builder = + new QueryBuilder().WithQueryResource("SearchByCriteria", false); + + return + builder + .WithVariable("criteria", criteria) + .WithVariable("inputResultFilter", resultFilter) + .WithPagination(pagination) + .Build(); + } + + public static IGraphQLRequest FacetedSearch(InputCriteria criteria, InputFacets inputFacets, string language, InputResultFilter resultFilter, IPagination pagination) + { + QueryBuilder builder = + new QueryBuilder().WithQueryResource("SearchByFaceted", false); + + return + builder + .WithVariable("criteria", criteria) + .WithVariable("facets", inputFacets) + .WithVariable("inputResultFilter", resultFilter) + .WithPagination(pagination) + .WithLanguageFilter(language) + .Build(); + } + + public static IGraphQLRequest Suggest(string label, string langauage, bool fuzzy, bool used, string connectorId, IPagination pagination) + { + QueryBuilder builder = + new QueryBuilder().WithQueryResource("Suggest", false); + + return + builder + .WithVariable("label", label) + .WithVariable("langauage", langauage) + .WithVariable("fuzzy", fuzzy) + .WithVariable("used", used) + .WithVariable("connectorId", connectorId) + .WithPagination(pagination) + .Build(); + } + #region Query Builder Helpers public static ClaimValue CreateClaim(ModelServiceLinkRendering linkRendering) => new ClaimValue diff --git a/net/src/Sdl.Tridion.Api.Client/HttpClient/HttpClient.cs b/net/src/Sdl.Tridion.Api.Client/HttpClient/HttpClient.cs index bc4c3b4..12d6c66 100644 --- a/net/src/Sdl.Tridion.Api.Client/HttpClient/HttpClient.cs +++ b/net/src/Sdl.Tridion.Api.Client/HttpClient/HttpClient.cs @@ -22,6 +22,7 @@ public class HttpClient : IHttpClient { public Uri BaseUri { get; set; } public int Timeout { get; set; } = 30000; + public int RetryCount { get; set; } = 5; public string UserAgent { get; set; } = "SDL.PCA.NET"; public HttpHeaders Headers { get; set; } = new HttpHeaders(); public ILogger Logger { get; } = new NullLogger(); @@ -74,38 +75,36 @@ public HttpClient(Uri endpoint, ILogger logger, IAuthentication auth) : this(end public virtual IHttpClientResponse Execute(IHttpClientRequest clientRequest) { - HttpWebRequest request = CreateHttpWebRequest(clientRequest); try { - using (WebResponse response = request.GetResponse()) + return RetryBlock>(() => { - HttpWebResponse httpWebResponse = (HttpWebResponse)response; - - using (Stream responseStream = response.GetResponseStream()) + var request = CreateHttpWebRequest(clientRequest); + using (var response = request.GetResponse()) { - if (responseStream != null) + var httpWebResponse = (HttpWebResponse) response; + using (var responseStream = response.GetResponseStream()) { - byte[] data = ReadStream(responseStream); - + if (responseStream == null) return default(HttpClientResponse); + var data = ReadStream(responseStream); LogErrorResponse(data); - - T deserialized = Deserialize(data, httpWebResponse.ContentType, clientRequest.Binder, clientRequest.Convertors); - + var deserialized = Deserialize(data, httpWebResponse.ContentType, clientRequest.Binder, + clientRequest.Convertors); return new HttpClientResponse { - StatusCode = (int)httpWebResponse.StatusCode, + StatusCode = (int) httpWebResponse.StatusCode, ContentType = httpWebResponse.ContentType, Headers = new HttpHeaders(httpWebResponse.Headers), ResponseData = deserialized }; } } - } + }, RetryCount); } catch (WebException e) { if (e.Response == null) throw new HttpClientException(e.Message, e); - byte[] data = ReadStream(e.Response.GetResponseStream()); + var data = ReadStream(e.Response.GetResponseStream()); throw new HttpClientException( $"Failed to get http response from '{BaseUri}' with request: {clientRequest}", e, (int)e.Status, Encoding.UTF8.GetString(data)); @@ -114,16 +113,14 @@ public virtual IHttpClientResponse Execute(IHttpClientRequest clientReques { throw new HttpClientException($"Failed to get http response from '{BaseUri}' with request: {clientRequest}", e); } - - throw new HttpClientException($"Failed to get http response from '{BaseUri}' with request: {clientRequest}"); } public virtual async Task> ExecuteAsync(IHttpClientRequest clientRequest, CancellationToken cancellationToken = default(CancellationToken)) { - HttpWebRequest request = CreateHttpWebRequest(clientRequest); try { + HttpWebRequest request = CreateHttpWebRequest(clientRequest); using (WebResponse response = await request.GetResponseAsync().ConfigureAwait(false)) { HttpWebResponse httpWebResponse = (HttpWebResponse)response; @@ -213,7 +210,7 @@ private void LogErrorResponse(byte[] data) if (Logger.IsTracingEnabled && responseData.Contains("errors")) //not the best way to do it, but couldn't see any other way { - Logger.Trace($"Error Respose: {responseData}"); + Logger.Trace($"Error Response: {responseData}"); } } @@ -284,5 +281,48 @@ protected virtual T Deserialize(byte[] data, string contentType, Serializatio settings.Converters.Add(x); return JsonConvert.DeserializeObject(json, settings); } + + protected T RetryBlock(Func block, int retryCount) + { + if (retryCount < 0) + return default(T); + + int sleepTime = 1000; + while (retryCount > 0) + { + retryCount--; + try + { + return block(); + } + catch (Exception e) + { + WebException webException = e as WebException; + if (webException != null) + { + Logger.Debug($"Received web exception status code = {webException.Status}"); + } + if (retryCount <= 0) + { + Logger.Debug("Failed to receive a valid response after exhausting all retry attempts.."); + if (webException == null) throw; + if (webException.Response == null) throw; + var responseStream = webException.Response.GetResponseStream(); + if (responseStream == null) throw; + var resp = new StreamReader(responseStream).ReadToEnd(); + dynamic obj = JsonConvert.DeserializeObject(resp); + var serverResponseMsg = obj.error.message; + Logger.Debug($"Response message from server was {serverResponseMsg}"); + throw; + } + + Logger.Debug($"Sleeping for {sleepTime}ms"); + Thread.Sleep(sleepTime); + sleepTime += sleepTime; + } + } + + return default(T); + } } } diff --git a/net/src/Sdl.Tridion.Api.Client/HttpClient/IHttpClient.cs b/net/src/Sdl.Tridion.Api.Client/HttpClient/IHttpClient.cs index fcc777e..d676b5d 100644 --- a/net/src/Sdl.Tridion.Api.Client/HttpClient/IHttpClient.cs +++ b/net/src/Sdl.Tridion.Api.Client/HttpClient/IHttpClient.cs @@ -13,6 +13,7 @@ public interface IHttpClient { Uri BaseUri { get; set; } int Timeout { get; set; } + int RetryCount { get; set; } string UserAgent { get; set; } HttpHeaders Headers { get; set; } IHttpClientResponse Execute(IHttpClientRequest request); diff --git a/net/src/Sdl.Tridion.Api.Client/IApiClient.cs b/net/src/Sdl.Tridion.Api.Client/IApiClient.cs index 9182a45..379e1e3 100644 --- a/net/src/Sdl.Tridion.Api.Client/IApiClient.cs +++ b/net/src/Sdl.Tridion.Api.Client/IApiClient.cs @@ -350,5 +350,46 @@ TaxonomySitemapItem GetSitemap(ContentNamespace ns, int publicationId, int desce List GetSitemapSubtree(ContentNamespace ns, int publicationId, string taxonomyNodeId, int descendantLevels, Ancestor ancestor, IContextData contextData); + + + /// + /// Search by raw criteria + /// + /// Raw criteria DSL generated by IqQuery API + /// Result filter + /// Pagination + /// Search results + FacetedSearchResults SearchByRawCriteria(string rawCriteria, InputResultFilter resultFilter, IPagination pagination); + + /// + /// Search by criteria + /// + /// + /// + /// + /// + FacetedSearchResults SearchByCriteria(InputCriteria criteria, InputResultFilter resultFilter, IPagination pagination); + + /// + /// Faceted Search by criteria + /// + /// + /// + /// + /// + /// + FacetedSearchResults FacetedSearch(InputCriteria criteria, InputFacets inputFacets, string language, InputResultFilter resultFilter, IPagination pagination); + + /// + /// Suggest - Filter results to match facets used within your content + /// + /// + /// + /// + /// + /// + /// + /// + ConceptSuggestionConnection Suggest(string label, string langauage, bool fuzzy, bool used, string connectorId, IPagination pagination); } } \ No newline at end of file diff --git a/net/src/Sdl.Tridion.Api.Client/ItemTypes.cs b/net/src/Sdl.Tridion.Api.Client/ItemTypes.cs index fe64061..5aac548 100644 --- a/net/src/Sdl.Tridion.Api.Client/ItemTypes.cs +++ b/net/src/Sdl.Tridion.Api.Client/ItemTypes.cs @@ -29,6 +29,7 @@ public enum ItemType StructureGroup = 0x4, Schema = 0x8, Component = 0x10, + Binary = 0x10, //Search is not handled for "itemType": "binary" pdf indexed data for this responseData.TypedResponseData = responseData.Data.ToObject(); ComponentTemplate = 0x20, Page = 0x40, PageTemplate = 0x80, diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentByCmUri.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentByCmUri.graphql index e2cd3ed..fe5e952 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentByCmUri.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentByCmUri.graphql @@ -1,4 +1,4 @@ -query binaryComponent($namespaceId: Int!, $publicationId: Int!, $cmUri: String, $contextData: [InputClaimValue!]) { +query binaryComponent($namespaceId: Int!, $publicationId: Int!, $cmUri: String, $contextData: [InputClaimValue]) { binaryComponent(namespaceId: $namespaceId, publicationId: $publicationId, cmUri: $cmUri, contextData: $contextData) { ...ItemFields ...BinaryComponentFields diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentById.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentById.graphql index 94bc0a6..fe61553 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentById.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentById.graphql @@ -1,4 +1,4 @@ -query binaryComponent($namespaceId: Int!, $publicationId: Int!, $binaryId: Int!, $contextData: [InputClaimValue!]) { +query binaryComponent($namespaceId: Int!, $publicationId: Int!, $binaryId: Int!, $contextData: [InputClaimValue]) { binaryComponent(namespaceId: $namespaceId, publicationId: $publicationId, binaryId: $binaryId, contextData: $contextData) { ...ItemFields ...BinaryComponentFields diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentByUrl.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentByUrl.graphql index 54bacb0..bbf013e 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentByUrl.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/BinaryComponentByUrl.graphql @@ -1,4 +1,4 @@ -query binaryComponent($namespaceId: Int!, $publicationId: Int!, $url: String, $contextData: [InputClaimValue!]) { +query binaryComponent($namespaceId: Int!, $publicationId: Int!, $url: String, $contextData: [InputClaimValue]) { binaryComponent(namespaceId: $namespaceId, publicationId: $publicationId, url: $url, contextData: $contextData) { ...ItemFields ...BinaryComponentFields diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/ComponentPresentation.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/ComponentPresentation.graphql index 5bead29..ee73cb5 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/ComponentPresentation.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/ComponentPresentation.graphql @@ -1,4 +1,4 @@ -query componentPresentation($namespaceId: Int!, $publicationId: Int!, $componentId: Int!, $templateId: Int!, $contextData: [InputClaimValue!]) { +query componentPresentation($namespaceId: Int!, $publicationId: Int!, $componentId: Int!, $templateId: Int!, $contextData: [InputClaimValue]) { componentPresentation(namespaceId: $namespaceId, publicationId: $publicationId, componentId: $componentId, templateId: $templateId, contextData: $contextData) { ...ComponentPresentationFields } diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/ComponentPresentations.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/ComponentPresentations.graphql index 8e551ec..94384d4 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/ComponentPresentations.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/ComponentPresentations.graphql @@ -1,4 +1,4 @@ -query componentPresentations($namespaceId: Int!, $publicationId: Int!, $first: Int, $after: String, $filter: InputComponentPresentationFilter!, $inputSortParam: InputSortParam, $contextData: [InputClaimValue!]) { +query componentPresentations($namespaceId: Int!, $publicationId: Int!, $first: Int, $after: String, $filter: InputComponentPresentationFilter!, $inputSortParam: InputSortParam, $contextData: [InputClaimValue]) { componentPresentations(namespaceId: $namespaceId, publicationId: $publicationId, first: $first, after: $after, filter: $filter, sort: $inputSortParam, contextData: $contextData) { edges { cursor diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/EntityModelById.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/EntityModelById.graphql index 1df95af..424964f 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/EntityModelById.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/EntityModelById.graphql @@ -1,4 +1,4 @@ -query componentPresentation($namespaceId: Int!, $publicationId: Int!, $componentId: Int!, $templateId: Int!, $contextData: [InputClaimValue!]) { +query componentPresentation($namespaceId: Int!, $publicationId: Int!, $componentId: Int!, $templateId: Int!, $contextData: [InputClaimValue]) { componentPresentation(namespaceId: $namespaceId, publicationId: $publicationId, componentId: $componentId, templateId: $templateId, contextData: $contextData) { itemId includeContent? { diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/ItemQuery.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/ItemQuery.graphql index faf58c7..6dc4ae4 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/ItemQuery.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/ItemQuery.graphql @@ -1,4 +1,4 @@ -query items($first: Int, $after: String, $inputItemFilter: InputItemFilter!, $inputSortParam: InputSortParam, $contextData: [InputClaimValue!]) { +query items($first: Int, $after: String, $inputItemFilter: InputItemFilter!, $inputSortParam: InputSortParam, $contextData: [InputClaimValue]) { items(first: $first, after: $after, filter: $inputItemFilter, sort: $inputSortParam, contextData: $contextData) { edges { cursor diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/PageByCmUri.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/PageByCmUri.graphql index 080253e..c014a87 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/PageByCmUri.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/PageByCmUri.graphql @@ -1,4 +1,4 @@ -query page($namespaceId: Int!, $publicationId: Int!, $cmUri: String, $contextData: [InputClaimValue!]) { +query page($namespaceId: Int!, $publicationId: Int!, $cmUri: String, $contextData: [InputClaimValue]) { page(namespaceId: $namespaceId, publicationId: $publicationId, cmUri: $cmUri, contextData: $contextData) { ...PageItemFields diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/PageById.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/PageById.graphql index d706787..ba3221c 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/PageById.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/PageById.graphql @@ -1,4 +1,4 @@ -query page($namespaceId: Int!, $publicationId: Int!, $pageId: Int!, $contextData: [InputClaimValue!]) { +query page($namespaceId: Int!, $publicationId: Int!, $pageId: Int!, $contextData: [InputClaimValue]) { page(namespaceId: $namespaceId, publicationId: $publicationId, pageId: $pageId, contextData: $contextData) { ...PageItemFields diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/PageByUrl.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/PageByUrl.graphql index 22e8984..ba993fd 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/PageByUrl.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/PageByUrl.graphql @@ -1,4 +1,4 @@ -query page($namespaceId: Int!, $publicationId: Int!, $url: String, $contextData: [InputClaimValue!]) { +query page($namespaceId: Int!, $publicationId: Int!, $url: String, $contextData: [InputClaimValue]) { page(namespaceId: $namespaceId, publicationId: $publicationId, url: $url, contextData: $contextData) { ...PageItemFields diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/PageModelById.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/PageModelById.graphql index 5daa169..7fe8185 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/PageModelById.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/PageModelById.graphql @@ -1,4 +1,4 @@ -query page($pageId: Int!, $namespaceId: Int!, $publicationId: Int!, $contextData: [InputClaimValue!]) { +query page($pageId: Int!, $namespaceId: Int!, $publicationId: Int!, $contextData: [InputClaimValue]) { page(pageId: $pageId, namespaceId: $namespaceId, publicationId: $publicationId, contextData: $contextData) { itemId includeContent? { diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/PageModelByUrl.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/PageModelByUrl.graphql index 918bc6c..33301db 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/PageModelByUrl.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/PageModelByUrl.graphql @@ -1,4 +1,4 @@ -query page($namespaceId: Int!, $publicationId: Int!, $url: String, $contextData: [InputClaimValue!]) { +query page($namespaceId: Int!, $publicationId: Int!, $url: String, $contextData: [InputClaimValue]) { page(namespaceId: $namespaceId, publicationId: $publicationId, url: $url, contextData: $contextData) { itemId includeContent? { diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/PagesByUrl.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/PagesByUrl.graphql index 40ff21b..c5a6549 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/PagesByUrl.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/PagesByUrl.graphql @@ -1,4 +1,4 @@ -query pages($namespaceId: Int!, $first: Int, $after: String, $url: String!, $contextData: [InputClaimValue!]) { +query pages($namespaceId: Int!, $first: Int, $after: String, $url: String!, $contextData: [InputClaimValue]) { pages(namespaceId: $namespaceId, first: $first, after: $after, url: $url, contextData: $contextData) { edges { cursor diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/Publication.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/Publication.graphql index 33bb14a..6389d3b 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/Publication.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/Publication.graphql @@ -1,4 +1,4 @@ -query publication($namespaceId: Int!, $publicationId: Int!, $contextData: [InputClaimValue!]) { +query publication($namespaceId: Int!, $publicationId: Int!, $contextData: [InputClaimValue]) { publication(namespaceId: $namespaceId, publicationId: $publicationId, contextData: $contextData) { ...ItemFields ...PublicationFields diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/Publications.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/Publications.graphql index 3c75515..47fa89d 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/Publications.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/Publications.graphql @@ -1,4 +1,4 @@ -query publications($namespaceId: Int!, $first: Int, $after: String, $filter: InputPublicationFilter, $contextData: [InputClaimValue!]) { +query publications($namespaceId: Int!, $first: Int, $after: String, $filter: InputPublicationFilter, $contextData: [InputClaimValue]) { publications(namespaceId: $namespaceId, first: $first, after: $after, filter: $filter, contextData: $contextData) { edges { cursor diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/SearchByCriteria.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/SearchByCriteria.graphql new file mode 100644 index 0000000..884ee30 --- /dev/null +++ b/net/src/Sdl.Tridion.Api.Client/Queries/SearchByCriteria.graphql @@ -0,0 +1,38 @@ +query search($first: Int, $after: String, $criteria: InputCriteria, $inputResultFilter: InputResultFilter) { + search(InputCriteria: $criteria, resultFilter: $inputResultFilter ) { + results(first: $first, after: $after) { + hits + edges { + node { + search { + id + author + binaryAuthor + binaryContentType + binaryCreatedDate + binaryFileName + binaryLanguage + binaryTitle + createdDate + fields + highlighted + itemType + locale + location + mainContentField + majorVersion + minorVersion + modifiedDate + namespace + publicationId + publicationTitle + rawLanguageTitle + schemaId + score + url + } + } + } + } + } +} \ No newline at end of file diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/SearchByFaceted.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/SearchByFaceted.graphql new file mode 100644 index 0000000..a8bc8f3 --- /dev/null +++ b/net/src/Sdl.Tridion.Api.Client/Queries/SearchByFaceted.graphql @@ -0,0 +1,58 @@ +query search($criteria: InputCriteria, $facets: InputFacets,$inputResultFilter:InputResultFilter,$first: Int, $after: String) { + search(criteria: $criteria, facets: $facets,resultFilter:$inputResultFilter) { + facets@languageArgs { + ... on ConceptFacet { + connectorId + title + concepts { + label + id + count + } + } + } + results(first: $first, after: $after) { + hits + edges { + node { + search { + id + author + binaryAuthor + binaryContentType + binaryCreatedDate + binaryFileName + binaryLanguage + binaryTitle + createdDate + fields + highlighted + itemType + locale + location + mainContentField + majorVersion + minorVersion + modifiedDate + namespace + publicationId + publicationTitle + rawLanguageTitle + schemaId + score + url + conceptSchemes { + title + connectorId + concepts { + id + label + uri + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/SearchByRawCriteria.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/SearchByRawCriteria.graphql new file mode 100644 index 0000000..ad3b205 --- /dev/null +++ b/net/src/Sdl.Tridion.Api.Client/Queries/SearchByRawCriteria.graphql @@ -0,0 +1,38 @@ +query search($first: Int, $after: String, $rawCriteria: String, $inputResultFilter: InputResultFilter) { + search(rawCriteria: $rawCriteria, resultFilter: $inputResultFilter ) { + results(first: $first, after: $after) { + hits + edges { + node { + search { + id + author + binaryAuthor + binaryContentType + binaryCreatedDate + binaryFileName + binaryLanguage + binaryTitle + createdDate + fields + highlighted + itemType + locale + location + mainContentField + majorVersion + minorVersion + modifiedDate + namespace + publicationId + publicationTitle + rawLanguageTitle + schemaId + score + url + } + } + } + } + } +} \ No newline at end of file diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/Sitemap.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/Sitemap.graphql index 42afdd3..0358191 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/Sitemap.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/Sitemap.graphql @@ -1,4 +1,4 @@ -query sitemap($namespaceId: Int!, $publicationId: Int!, $contextData: [InputClaimValue!]) { +query sitemap($namespaceId: Int!, $publicationId: Int!, $contextData: [InputClaimValue]) { sitemap(namespaceId: $namespaceId, publicationId: $publicationId, contextData: $contextData) { ...TaxonomyItemFields ...RecurseItems diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/SitemapSubtree.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/SitemapSubtree.graphql index 2fca359..6ae40b7 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/SitemapSubtree.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/SitemapSubtree.graphql @@ -1,4 +1,4 @@ -query sitemapSubtree($namespaceId: Int!, $publicationId: Int!, $taxonomyNodeId: String, $ancestor: Ancestor, $contextData: [InputClaimValue!]) { +query sitemapSubtree($namespaceId: Int!, $publicationId: Int!, $taxonomyNodeId: String, $ancestor: Ancestor, $contextData: [InputClaimValue]) { sitemapSubtree(namespaceId: $namespaceId, publicationId: $publicationId, taxonomyNodeId: $taxonomyNodeId, ancestor: $ancestor, contextData: $contextData) { ...TaxonomyItemFields ...RecurseItems diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/SitemapSubtreeNoRecurse.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/SitemapSubtreeNoRecurse.graphql index c153002..07b91b5 100644 --- a/net/src/Sdl.Tridion.Api.Client/Queries/SitemapSubtreeNoRecurse.graphql +++ b/net/src/Sdl.Tridion.Api.Client/Queries/SitemapSubtreeNoRecurse.graphql @@ -1,4 +1,4 @@ -query sitemapSubtree($namespaceId: Int!, $publicationId: Int!, $taxonomyNodeId: String, $ancestor: Ancestor, $contextData: [InputClaimValue!]) { +query sitemapSubtree($namespaceId: Int!, $publicationId: Int!, $taxonomyNodeId: String, $ancestor: Ancestor, $contextData: [InputClaimValue]) { sitemapSubtree(namespaceId: $namespaceId, publicationId: $publicationId, taxonomyNodeId: $taxonomyNodeId, ancestor: $ancestor, contextData: $contextData) { ...TaxonomyItemFields } diff --git a/net/src/Sdl.Tridion.Api.Client/Queries/Suggest.graphql b/net/src/Sdl.Tridion.Api.Client/Queries/Suggest.graphql new file mode 100644 index 0000000..efeaff2 --- /dev/null +++ b/net/src/Sdl.Tridion.Api.Client/Queries/Suggest.graphql @@ -0,0 +1,23 @@ +query suggest($label: String!, $langauage: String, $fuzzy: Boolean, $first: Int, $after: String, $used:Boolean, $connectorId: String) { + suggest(label: $label, language: $langauage, fuzzy: $fuzzy, first: $first, after: $after, used:$used,connectorId:$connectorId) { + edges { + cursor + node { + connectorId + id + label + alternativeLabels + highlight + narrowerConcepts { + edges { + node { + id + label + alternativeLabels + } + } + } + } + } + } +} \ No newline at end of file diff --git a/net/src/Sdl.Tridion.Api.Client/QueryBuilder.cs b/net/src/Sdl.Tridion.Api.Client/QueryBuilder.cs index 592246b..ccacce9 100644 --- a/net/src/Sdl.Tridion.Api.Client/QueryBuilder.cs +++ b/net/src/Sdl.Tridion.Api.Client/QueryBuilder.cs @@ -18,6 +18,7 @@ public class QueryBuilder private List _convertors; private IContextData _contextData; private string _customMetaFilter; + private string _languageFilter; private string _operationName; private int _descendantLevels; private ContentIncludeMode _contentIncludeMode = ContentIncludeMode.Exclude; @@ -49,6 +50,11 @@ public QueryBuilder WithCustomMetaFilter(string customMetaFilter) _customMetaFilter = customMetaFilter; return this; } + public QueryBuilder WithLanguageFilter(string languageFilter) + { + _languageFilter = languageFilter; + return this; + } public QueryBuilder WithOperationName(string operationName) { @@ -155,6 +161,9 @@ public IGraphQLRequest Build() ReplaceTag("customMetaArgs", string.IsNullOrEmpty(_customMetaFilter) ? "" : $"(filter: \"{_customMetaFilter}\")"); + ReplaceTag("languageArgs", + string.IsNullOrEmpty(_languageFilter) ? "" : $"(language: \"{_languageFilter}\")"); + ReplaceTag("renderContentArgs", $"(renderContent: {(_contentIncludeMode == ContentIncludeMode.IncludeDataAndRender || _contentIncludeMode == ContentIncludeMode.IncludeJsonAndRender ? "true" : "false")})"); diff --git a/net/src/Sdl.Tridion.Api.Client/Sdl.Tridion.Api.Client.csproj b/net/src/Sdl.Tridion.Api.Client/Sdl.Tridion.Api.Client.csproj index 792f3ec..3defff6 100644 --- a/net/src/Sdl.Tridion.Api.Client/Sdl.Tridion.Api.Client.csproj +++ b/net/src/Sdl.Tridion.Api.Client/Sdl.Tridion.Api.Client.csproj @@ -207,6 +207,10 @@ + + + +