From 7e482678067314d19ea84b216d54b68549653a7b Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 14:40:44 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 17 +++++ .../Generated/Models/Common/Attribution.cs | 10 +++ .../Models/Common/AttributionSource.cs | 64 +++++++++++++++++++ .../Generated/Models/Common/CreatedBy.cs | 2 + .../Generated/Models/Common/IAttribution.cs | 14 ++++ .../Generated/Models/Common/ICreatedBy.cs | 2 + .../Models/Common/ILastModifiedBy.cs | 2 + .../Generated/Models/Common/LastModifiedBy.cs | 2 + .../Common/AttributionQueryBuilderDsl.cs | 30 +++++++++ .../Common/CreatedByQueryBuilderDsl.cs | 9 +++ .../Common/LastModifiedByQueryBuilderDsl.cs | 9 +++ .../schema.graphqls | 12 ++++ references.txt | 1 + 13 files changed, 174 insertions(+) create mode 100644 commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/Attribution.cs create mode 100644 commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/AttributionSource.cs create mode 100644 commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/IAttribution.cs create mode 100644 commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/AttributionQueryBuilderDsl.cs diff --git a/changes.md b/changes.md index 36c7ab98765..be933fc483c 100644 --- a/changes.md +++ b/changes.md @@ -1,3 +1,20 @@ +**Api changes** + +
+Added Property(s) + +- added property `attributedTo` to type `CreatedBy` +- added property `attributedTo` to type `LastModifiedBy` +
+ + +
+Added Type(s) + +- added type `Attribution` +- added type `AttributionSource` +
+ **Import changes**
diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/Attribution.cs b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/Attribution.cs new file mode 100644 index 00000000000..41c5eb2a1ba --- /dev/null +++ b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/Attribution.cs @@ -0,0 +1,10 @@ +namespace commercetools.Sdk.Api.Models.Common +{ + + public partial class Attribution : IAttribution + { + public string ClientId { get; set; } + + public IAttributionSource Source { get; set; } + } +} diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/AttributionSource.cs b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/AttributionSource.cs new file mode 100644 index 00000000000..03af797e3f8 --- /dev/null +++ b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/AttributionSource.cs @@ -0,0 +1,64 @@ +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using commercetools.Base.CustomAttributes; +using commercetools.Base.Models; + +// ReSharper disable CheckNamespace +namespace commercetools.Sdk.Api.Models.Common +{ + public enum AttributionSource + { + [Description("Import")] + Import, + + [Description("Export")] + Export + } + + public class AttributionSourceWrapper : IAttributionSource + { + public string JsonName { get; internal set; } + public AttributionSource? Value { get; internal set; } + public override string ToString() + { + return JsonName; + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public new IEnumerator GetEnumerator() + { + return JsonName.GetEnumerator(); + } + } + + [EnumInterfaceCreator(typeof(IAttributionSource), "FindEnum")] + public interface IAttributionSource : IJsonName, IEnumerable + { + public static IAttributionSource Import = new AttributionSourceWrapper + { Value = AttributionSource.Import, JsonName = "Import" }; + + public static IAttributionSource Export = new AttributionSourceWrapper + { Value = AttributionSource.Export, JsonName = "Export" }; + + AttributionSource? Value { get; } + + static IAttributionSource[] Values() + { + return new[] + { + Import , + Export + }; + } + static IAttributionSource FindEnum(string value) + { + return Values().FirstOrDefault(origin => origin.JsonName == value) ?? new AttributionSourceWrapper() { JsonName = value }; + } + } +} diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/CreatedBy.cs b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/CreatedBy.cs index 95ae99f8c86..3b41066fe29 100644 --- a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/CreatedBy.cs +++ b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/CreatedBy.cs @@ -15,5 +15,7 @@ public partial class CreatedBy : ICreatedBy public string AnonymousId { get; set; } public ICustomerReference Associate { get; set; } + + public IAttribution AttributedTo { get; set; } } } diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/IAttribution.cs b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/IAttribution.cs new file mode 100644 index 00000000000..ca1c762a8fb --- /dev/null +++ b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/IAttribution.cs @@ -0,0 +1,14 @@ +using commercetools.Base.CustomAttributes; + +// ReSharper disable CheckNamespace +namespace commercetools.Sdk.Api.Models.Common +{ + [DeserializeAs(typeof(commercetools.Sdk.Api.Models.Common.Attribution))] + public partial interface IAttribution + { + string ClientId { get; set; } + + IAttributionSource Source { get; set; } + + } +} diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/ICreatedBy.cs b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/ICreatedBy.cs index 3423c25bb19..41107ba5b6a 100644 --- a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/ICreatedBy.cs +++ b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/ICreatedBy.cs @@ -15,6 +15,8 @@ public partial interface ICreatedBy : IClientLogging new string AnonymousId { get; set; } + IAttribution AttributedTo { get; set; } + new ICustomerReference Associate { get; set; } } diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/ILastModifiedBy.cs b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/ILastModifiedBy.cs index dba3e79f2f9..1cd370861e1 100644 --- a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/ILastModifiedBy.cs +++ b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/ILastModifiedBy.cs @@ -15,6 +15,8 @@ public partial interface ILastModifiedBy : IClientLogging new string AnonymousId { get; set; } + IAttribution AttributedTo { get; set; } + new ICustomerReference Associate { get; set; } } diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/LastModifiedBy.cs b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/LastModifiedBy.cs index 54482060a14..8e84a49832c 100644 --- a/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/LastModifiedBy.cs +++ b/commercetools.Sdk/commercetools.Sdk.Api/Generated/Models/Common/LastModifiedBy.cs @@ -15,5 +15,7 @@ public partial class LastModifiedBy : ILastModifiedBy public string AnonymousId { get; set; } public ICustomerReference Associate { get; set; } + + public IAttribution AttributedTo { get; set; } } } diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/AttributionQueryBuilderDsl.cs b/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/AttributionQueryBuilderDsl.cs new file mode 100644 index 00000000000..28dd84ec00e --- /dev/null +++ b/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/AttributionQueryBuilderDsl.cs @@ -0,0 +1,30 @@ +// ReSharper disable CheckNamespace +namespace commercetools.Sdk.Api.Predicates.Query.Common +{ + + public partial class AttributionQueryBuilderDsl + { + public AttributionQueryBuilderDsl() + { + } + + public static AttributionQueryBuilderDsl Of() + { + return new AttributionQueryBuilderDsl(); + } + + public IComparisonPredicateBuilder ClientId() + { + return new ComparisonPredicateBuilder(BinaryQueryPredicate.Of().Left(new ConstantQueryPredicate("clientId")), + p => new CombinationQueryPredicate(p, AttributionQueryBuilderDsl.Of), + PredicateFormatter.Format); + } + public IComparisonPredicateBuilder Source() + { + return new ComparisonPredicateBuilder(BinaryQueryPredicate.Of().Left(new ConstantQueryPredicate("source")), + p => new CombinationQueryPredicate(p, AttributionQueryBuilderDsl.Of), + PredicateFormatter.Format); + } + + } +} diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/CreatedByQueryBuilderDsl.cs b/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/CreatedByQueryBuilderDsl.cs index 8dce5d79cf6..9d5f6ab89a3 100644 --- a/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/CreatedByQueryBuilderDsl.cs +++ b/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/CreatedByQueryBuilderDsl.cs @@ -51,6 +51,15 @@ public CombinationQueryPredicate Associate( CreatedByQueryBuilderDsl.Of); } + public CombinationQueryPredicate AttributedTo( + Func> fn) + { + return new CombinationQueryPredicate(ContainerQueryPredicate.Of() + .Parent(ConstantQueryPredicate.Of().Constant("attributedTo")) + .Inner(fn.Invoke(commercetools.Sdk.Api.Predicates.Query.Common.AttributionQueryBuilderDsl.Of())), + CreatedByQueryBuilderDsl.Of); + } + } } diff --git a/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/LastModifiedByQueryBuilderDsl.cs b/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/LastModifiedByQueryBuilderDsl.cs index 46d0b80b9cb..f2ec6a5e7d6 100644 --- a/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/LastModifiedByQueryBuilderDsl.cs +++ b/commercetools.Sdk/commercetools.Sdk.Api/Predicates/Query/Generated/Common/LastModifiedByQueryBuilderDsl.cs @@ -51,6 +51,15 @@ public CombinationQueryPredicate Associate( LastModifiedByQueryBuilderDsl.Of); } + public CombinationQueryPredicate AttributedTo( + Func> fn) + { + return new CombinationQueryPredicate(ContainerQueryPredicate.Of() + .Parent(ConstantQueryPredicate.Of().Constant("attributedTo")) + .Inner(fn.Invoke(commercetools.Sdk.Api.Predicates.Query.Common.AttributionQueryBuilderDsl.Of())), + LastModifiedByQueryBuilderDsl.Of); + } + } } diff --git a/commercetools.Sdk/commercetools.Sdk.GraphQL.Api/schema.graphqls b/commercetools.Sdk/commercetools.Sdk.GraphQL.Api/schema.graphqls index bacdc9a8b6d..8741258ea1b 100644 --- a/commercetools.Sdk/commercetools.Sdk.GraphQL.Api/schema.graphqls +++ b/commercetools.Sdk/commercetools.Sdk.GraphQL.Api/schema.graphqls @@ -1213,6 +1213,17 @@ input AttributeTypeDraft { ltext: SimpleAttributeTypeDraft } +type Attribution { + clientId: String + source: AttributionSource! + userRef: Reference +} + +enum AttributionSource { + Export + Import +} + "AuthenticationMode values." enum AuthenticationMode { ExternalAuth @@ -4672,6 +4683,7 @@ type Initiator { isPlatformClient: Boolean externalUserId: String anonymousId: String + attributedTo: Attribution clientId: String customerRef: Reference userRef: Reference diff --git a/references.txt b/references.txt index 1d4e829ab88..b7bac63bd03 100644 --- a/references.txt +++ b/references.txt @@ -234,3 +234,4 @@ d6c4e8ca039647373df3aeb8369342bd50b02d61 c19a4123795d7a2d583abb9f278ce1264b030a91 9194bacd1d05947096d049eb383656c8d7f30812 cec3e86fa69d9a68a2add55c132e2ffff406a294 +a9d748dbcbfc8d2a1cd8d0f8c4e48807e502e79e