From 757ce07f34a19e3556cf4ddccddd43e4bdc5c230 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 12:24:35 +0000 Subject: [PATCH 1/2] chore(spec-sync): update LINE OpenAPI specs to fa5577c9 and regenerate --- openapi/messaging-api.yml | 176 ++++++++++++++++++ openapi/upstream-manifest.json | 6 +- .../Api/Models/PnpMessagesRequest.cs | 10 + .../Api/Models/PnpTemplatedButton.cs | 75 ++++++++ .../Api/Models/PnpTemplatedEmphasizedItem.cs | 76 ++++++++ .../Generated/Api/Models/PnpTemplatedItem.cs | 75 ++++++++ .../Api/Models/PnpTemplatedMessageBody.cs | 86 +++++++++ .../Api/Models/PnpTemplatedMessageRequest.cs | 95 ++++++++++ .../Message/Delivery/Pnp/PnpRequestBuilder.cs | 6 + .../Pnp/Templated/TemplatedRequestBuilder.cs | 101 ++++++++++ .../V2/Bot/Message/MessageRequestBuilder.cs | 6 + .../V2/Bot/Message/Pnp/PnpRequestBuilder.cs | 41 ++++ .../Pnp/Templated/Push/PushRequestBuilder.cs | 93 +++++++++ .../Pnp/Templated/TemplatedRequestBuilder.cs | 41 ++++ .../Generated/Api/kiota-lock.json | 2 +- .../Generated/Blob/kiota-lock.json | 2 +- 16 files changed, 886 insertions(+), 5 deletions(-) create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedButton.cs create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedEmphasizedItem.cs create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedItem.cs create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedMessageBody.cs create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedMessageRequest.cs create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Delivery/Pnp/Templated/TemplatedRequestBuilder.cs create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/PnpRequestBuilder.cs create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/Templated/Push/PushRequestBuilder.cs create mode 100644 src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/Templated/TemplatedRequestBuilder.cs diff --git a/openapi/messaging-api.yml b/openapi/messaging-api.yml index e5cf1e6..11f1fdb 100644 --- a/openapi/messaging-api.yml +++ b/openapi/messaging-api.yml @@ -1739,6 +1739,40 @@ paths: schema: "$ref": "#/components/schemas/ErrorResponse" + "/v2/bot/message/pnp/templated/push": + post: + externalDocs: + url: https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template + tags: + - messaging-api + operationId: pushTemplatedMessagesByPhone + description: "Send LINE notification message (template)" + parameters: + - name: X-Line-Delivery-Tag + in: header + required: false + schema: + type: string + minLength: 16 + maxLength: 100 + description: "String returned in the delivery.data property of the delivery completion event via Webhook." + requestBody: + content: + application/json: + schema: + "$ref": "#/components/schemas/PnpTemplatedMessageRequest" + required: true + responses: + "202": + description: "Accepted" + "422": + description: |+ + Failed to send the LINE notification message. For example, there is no LINE user associated with the specified phone number, the phone number is outside the LINE notification message service area, the user has refused to receive LINE notification messages, or the user hasn't agreed to LINE's Privacy Policy. + content: + "application/json": + schema: + "$ref": "#/components/schemas/ErrorResponse" + "/v2/bot/message/delivery/pnp": get: externalDocs: @@ -1770,6 +1804,37 @@ paths: status: ready success: 3 + "/v2/bot/message/delivery/pnp/templated": + get: + externalDocs: + url: https://developers.line.biz/en/reference/line-notification-messages/#get-number-of-sent-line-notification-messages-template + tags: + - messaging-api + operationId: getPNPTemplatedMessageStatistics + description: "Get number of sent LINE notification messages (template)" + parameters: + - name: date + in: query + required: true + schema: + type: string + pattern: "^[0-9]{8}$" + description: |+ + Date the message was sent + + Format: `yyyyMMdd` (Example:`20211231`) + Time zone: UTC+9 + responses: + "200": + description: "OK" + content: + "application/json": + schema: + "$ref": "#/components/schemas/NumberOfMessagesResponse" + example: + status: ready + success: 3 + # Membership "/v2/bot/membership/subscription/{userId}": get: @@ -3638,6 +3703,117 @@ components: description: "Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256." notificationDisabled: "$ref": "#/components/schemas/NotificationDisabled" + customAggregationUnits: + type: array + maxItems: 1 + description: "Name of aggregation unit. Case-sensitive." + items: + type: string + maxLength: 30 + minLength: 1 + pattern: "^[a-zA-Z0-9_]{1,30}$" + + PnpTemplatedMessageRequest: + externalDocs: + url: https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template + required: + - to + - templateKey + type: object + properties: + to: + type: string + description: "Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256." + templateKey: + type: string + description: |+ + Specify the key of the template you want to send. + For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#templates + body: + "$ref": "#/components/schemas/PnpTemplatedMessageBody" + customAggregationUnits: + type: array + maxItems: 1 + description: |+ + Name of aggregation unit. Case-sensitive. + For more information about assigning a unit name, see https://developers.line.biz/en/docs/messaging-api/unit-based-statistics-aggregation/#assign-names-to-units-when-sending-messages + items: + type: string + maxLength: 30 + minLength: 1 + pattern: "^[a-zA-Z0-9_]{1,30}$" + PnpTemplatedMessageBody: + externalDocs: + url: https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template + type: object + description: "The body object of the template you want to send. You can't specify the same item more than once in a single message." + properties: + emphasizedItem: + "$ref": "#/components/schemas/PnpTemplatedEmphasizedItem" + items: + type: array + maxItems: 15 + description: "Array of items to include in the message. The `itemKey` must be unique across `emphasizedItem` and `items`." + items: + "$ref": "#/components/schemas/PnpTemplatedItem" + buttons: + type: array + maxItems: 2 + description: "Array of buttons to include in the message. The `buttonKey` must be unique." + items: + "$ref": "#/components/schemas/PnpTemplatedButton" + PnpTemplatedEmphasizedItem: + externalDocs: + url: https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-items + required: + - itemKey + - content + type: object + description: "Item to emphasize in the message." + properties: + itemKey: + type: string + description: |+ + Specify the key of the item you want to include. + For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#items + content: + type: string + maxLength: 15 + description: "String to be displayed as the value of the item." + PnpTemplatedItem: + externalDocs: + url: https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-items + required: + - itemKey + - content + type: object + properties: + itemKey: + type: string + description: |+ + Specify the key of the item you want to include. + For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#items + content: + type: string + maxLength: 300 + description: "String to be displayed as the value of the item." + PnpTemplatedButton: + externalDocs: + url: https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-buttons + required: + - buttonKey + - url + type: object + properties: + buttonKey: + type: string + description: |+ + Specify the key of the button you want to include. + For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#buttons + url: + type: string + maxLength: 1000 + description: "URL of the page to be opened when the user presses the button." # Message objects Message: diff --git a/openapi/upstream-manifest.json b/openapi/upstream-manifest.json index d55c36d..0db349a 100644 --- a/openapi/upstream-manifest.json +++ b/openapi/upstream-manifest.json @@ -2,9 +2,9 @@ "$comment": "Provenance anchor for the vendored LINE OpenAPI spec snapshots under openapi/. Records which upstream commit the committed specs correspond to and their LF-normalized content hashes. Consumed by scripts/check-spec-drift.ps1 (drift detection) and scripts/generate.ps1 -Update (pinned re-fetch). Upstream (github.com/line/line-openapi) publishes no tags/releases and its spec info.version fields are static, so the upstream commit SHA is the only reliable version anchor. See docs/LINE-dotnet-client-design.md §9.", "schemaVersion": 1, "repository": "line/line-openapi", - "ref": "de8bd9e2872ed9d9800e23b86136695fcd370a0c", + "ref": "fa5577c9ea874d2dbd8fadc85a4cb3a1b29d8cbe", "refDate": "2026-07-28", - "retrievedAt": "2026-08-19", + "retrievedAt": "2026-10-05", "hashAlgorithm": "sha256", "hashNormalization": "line endings normalized to LF before hashing", "ignoredUpstreamFiles": [ @@ -12,7 +12,7 @@ ], "specs": { "messaging-api.yml": { - "sha256": "0227978ce1b3133e20da034fc33a9241000619ae4fea2fda7b61983abf79577a", + "sha256": "41033aa8491fc67ab09c4ec322f2aab072ae7b9402297e8c4f042eda0c2dd1fc", "package": "Line.OpenApi.Messaging", "imported": true }, diff --git a/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpMessagesRequest.cs b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpMessagesRequest.cs index 479a3d0..50ab00b 100644 --- a/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpMessagesRequest.cs +++ b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpMessagesRequest.cs @@ -14,6 +14,14 @@ public partial class PnpMessagesRequest : IAdditionalDataHolder, IParsable { /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. public IDictionary AdditionalData { get; set; } + /// Name of aggregation unit. Case-sensitive. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? CustomAggregationUnits { get; set; } +#nullable restore +#else + public List CustomAggregationUnits { get; set; } +#endif /// Message to be sent. #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER #nullable enable @@ -58,6 +66,7 @@ public virtual IDictionary> GetFieldDeserializers() { return new Dictionary> { + { "customAggregationUnits", n => { CustomAggregationUnits = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, { "messages", n => { Messages = n.GetCollectionOfObjectValues(global::Line.OpenApi.Messaging.Generated.Api.Models.Message.CreateFromDiscriminatorValue)?.AsList(); } }, { "notificationDisabled", n => { NotificationDisabled = n.GetBoolValue(); } }, { "to", n => { To = n.GetStringValue(); } }, @@ -70,6 +79,7 @@ public virtual IDictionary> GetFieldDeserializers() public virtual void Serialize(ISerializationWriter writer) { if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfPrimitiveValues("customAggregationUnits", CustomAggregationUnits); writer.WriteCollectionOfObjectValues("messages", Messages); writer.WriteBoolValue("notificationDisabled", NotificationDisabled); writer.WriteStringValue("to", To); diff --git a/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedButton.cs b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedButton.cs new file mode 100644 index 0000000..eb09f8e --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedButton.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PnpTemplatedButton : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Specify the key of the button you want to include.For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#buttons +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ButtonKey { get; set; } +#nullable restore +#else + public string ButtonKey { get; set; } +#endif + /// URL of the page to be opened when the user presses the button. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Url { get; set; } +#nullable restore +#else + public string Url { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PnpTemplatedButton() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedButton CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedButton(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "buttonKey", n => { ButtonKey = n.GetStringValue(); } }, + { "url", n => { Url = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("buttonKey", ButtonKey); + writer.WriteStringValue("url", Url); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedEmphasizedItem.cs b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedEmphasizedItem.cs new file mode 100644 index 0000000..523c7da --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedEmphasizedItem.cs @@ -0,0 +1,76 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.Models +{ + /// + /// Item to emphasize in the message. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PnpTemplatedEmphasizedItem : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// String to be displayed as the value of the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Content { get; set; } +#nullable restore +#else + public string Content { get; set; } +#endif + /// Specify the key of the item you want to include.For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#items +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ItemKey { get; set; } +#nullable restore +#else + public string ItemKey { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PnpTemplatedEmphasizedItem() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedEmphasizedItem CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedEmphasizedItem(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "content", n => { Content = n.GetStringValue(); } }, + { "itemKey", n => { ItemKey = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("content", Content); + writer.WriteStringValue("itemKey", ItemKey); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedItem.cs b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedItem.cs new file mode 100644 index 0000000..52ac9a4 --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedItem.cs @@ -0,0 +1,75 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PnpTemplatedItem : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// String to be displayed as the value of the item. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? Content { get; set; } +#nullable restore +#else + public string Content { get; set; } +#endif + /// Specify the key of the item you want to include.For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#items +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? ItemKey { get; set; } +#nullable restore +#else + public string ItemKey { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PnpTemplatedItem() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedItem CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedItem(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "content", n => { Content = n.GetStringValue(); } }, + { "itemKey", n => { ItemKey = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteStringValue("content", Content); + writer.WriteStringValue("itemKey", ItemKey); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedMessageBody.cs b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedMessageBody.cs new file mode 100644 index 0000000..b316496 --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedMessageBody.cs @@ -0,0 +1,86 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.Models +{ + /// + /// The body object of the template you want to send. You can't specify the same item more than once in a single message. + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PnpTemplatedMessageBody : IAdditionalDataHolder, IParsable + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// Array of buttons to include in the message. The `buttonKey` must be unique. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Buttons { get; set; } +#nullable restore +#else + public List Buttons { get; set; } +#endif + /// Item to emphasize in the message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedEmphasizedItem? EmphasizedItem { get; set; } +#nullable restore +#else + public global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedEmphasizedItem EmphasizedItem { get; set; } +#endif + /// Array of items to include in the message. The `itemKey` must be unique across `emphasizedItem` and `items`. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? Items { get; set; } +#nullable restore +#else + public List Items { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PnpTemplatedMessageBody() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageBody CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageBody(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "buttons", n => { Buttons = n.GetCollectionOfObjectValues(global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedButton.CreateFromDiscriminatorValue)?.AsList(); } }, + { "emphasizedItem", n => { EmphasizedItem = n.GetObjectValue(global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedEmphasizedItem.CreateFromDiscriminatorValue); } }, + { "items", n => { Items = n.GetCollectionOfObjectValues(global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedItem.CreateFromDiscriminatorValue)?.AsList(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteCollectionOfObjectValues("buttons", Buttons); + writer.WriteObjectValue("emphasizedItem", EmphasizedItem); + writer.WriteCollectionOfObjectValues("items", Items); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedMessageRequest.cs b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedMessageRequest.cs new file mode 100644 index 0000000..3fe1888 --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/Models/PnpTemplatedMessageRequest.cs @@ -0,0 +1,95 @@ +// +#pragma warning disable CS0618 +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using System.Collections.Generic; +using System.IO; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.Models +{ + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + #pragma warning disable CS1591 + public partial class PnpTemplatedMessageRequest : IAdditionalDataHolder, IParsable + #pragma warning restore CS1591 + { + /// Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + public IDictionary AdditionalData { get; set; } + /// The body object of the template you want to send. You can't specify the same item more than once in a single message. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageBody? Body { get; set; } +#nullable restore +#else + public global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageBody Body { get; set; } +#endif + /// Name of aggregation unit. Case-sensitive.For more information about assigning a unit name, see https://developers.line.biz/en/docs/messaging-api/unit-based-statistics-aggregation/#assign-names-to-units-when-sending-messages +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public List? CustomAggregationUnits { get; set; } +#nullable restore +#else + public List CustomAggregationUnits { get; set; } +#endif + /// Specify the key of the template you want to send.For available keys, see https://developers.line.biz/en/docs/partner-docs/line-notification-messages/template/#templates +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? TemplateKey { get; set; } +#nullable restore +#else + public string TemplateKey { get; set; } +#endif + /// Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public string? To { get; set; } +#nullable restore +#else + public string To { get; set; } +#endif + /// + /// Instantiates a new and sets the default values. + /// + public PnpTemplatedMessageRequest() + { + AdditionalData = new Dictionary(); + } + /// + /// Creates a new instance of the appropriate class based on discriminator value + /// + /// A + /// The parse node to use to read the discriminator value and create the object + public static global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageRequest CreateFromDiscriminatorValue(IParseNode parseNode) + { + if(ReferenceEquals(parseNode, null)) throw new ArgumentNullException(nameof(parseNode)); + return new global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageRequest(); + } + /// + /// The deserialization information for the current model + /// + /// A IDictionary<string, Action<IParseNode>> + public virtual IDictionary> GetFieldDeserializers() + { + return new Dictionary> + { + { "body", n => { Body = n.GetObjectValue(global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageBody.CreateFromDiscriminatorValue); } }, + { "customAggregationUnits", n => { CustomAggregationUnits = n.GetCollectionOfPrimitiveValues()?.AsList(); } }, + { "templateKey", n => { TemplateKey = n.GetStringValue(); } }, + { "to", n => { To = n.GetStringValue(); } }, + }; + } + /// + /// Serializes information the current object + /// + /// Serialization writer to use to serialize this model + public virtual void Serialize(ISerializationWriter writer) + { + if(ReferenceEquals(writer, null)) throw new ArgumentNullException(nameof(writer)); + writer.WriteObjectValue("body", Body); + writer.WriteCollectionOfPrimitiveValues("customAggregationUnits", CustomAggregationUnits); + writer.WriteStringValue("templateKey", TemplateKey); + writer.WriteStringValue("to", To); + writer.WriteAdditionalData(AdditionalData); + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Delivery/Pnp/PnpRequestBuilder.cs b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Delivery/Pnp/PnpRequestBuilder.cs index 10190d0..bf93f93 100644 --- a/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Delivery/Pnp/PnpRequestBuilder.cs +++ b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Delivery/Pnp/PnpRequestBuilder.cs @@ -1,6 +1,7 @@ // #pragma warning disable CS0618 using Line.OpenApi.Messaging.Generated.Api.Models; +using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Delivery.Pnp.Templated; using Microsoft.Kiota.Abstractions.Extensions; using Microsoft.Kiota.Abstractions.Serialization; using Microsoft.Kiota.Abstractions; @@ -17,6 +18,11 @@ namespace Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Delivery.Pnp [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] public partial class PnpRequestBuilder : BaseRequestBuilder { + /// The templated property + public global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Delivery.Pnp.Templated.TemplatedRequestBuilder Templated + { + get => new global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Delivery.Pnp.Templated.TemplatedRequestBuilder(PathParameters, RequestAdapter); + } /// /// Instantiates a new and sets the default values. /// diff --git a/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Delivery/Pnp/Templated/TemplatedRequestBuilder.cs b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Delivery/Pnp/Templated/TemplatedRequestBuilder.cs new file mode 100644 index 0000000..ef8db65 --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Delivery/Pnp/Templated/TemplatedRequestBuilder.cs @@ -0,0 +1,101 @@ +// +#pragma warning disable CS0618 +using Line.OpenApi.Messaging.Generated.Api.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Delivery.Pnp.Templated +{ + /// + /// Builds and executes requests for operations under \v2\bot\message\delivery\pnp\templated + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TemplatedRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TemplatedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/bot/message/delivery/pnp/templated?date={date}", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TemplatedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/bot/message/delivery/pnp/templated?date={date}", rawUrl) + { + } + /// + /// Get number of sent LINE notification messages (template) + /// + /// A + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task GetAsync(Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task GetAsync(Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + var requestInfo = ToGetRequestInformation(requestConfiguration); + return await RequestAdapter.SendAsync(requestInfo, global::Line.OpenApi.Messaging.Generated.Api.Models.NumberOfMessagesResponse.CreateFromDiscriminatorValue, default, cancellationToken).ConfigureAwait(false); + } + /// + /// Get number of sent LINE notification messages (template) + /// + /// A + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToGetRequestInformation(Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToGetRequestInformation(Action> requestConfiguration = default) + { +#endif + var requestInfo = new RequestInformation(Method.GET, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Delivery.Pnp.Templated.TemplatedRequestBuilder WithUrl(string rawUrl) + { + return new global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Delivery.Pnp.Templated.TemplatedRequestBuilder(rawUrl, RequestAdapter); + } + /// + /// Get number of sent LINE notification messages (template) + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TemplatedRequestBuilderGetQueryParameters + { + /// Date the message was sentFormat: `yyyyMMdd` (Example:`20211231`)Time zone: UTC+9 +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + [QueryParameter("date")] + public string? Date { get; set; } +#nullable restore +#else + [QueryParameter("date")] + public string Date { get; set; } +#endif + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/MessageRequestBuilder.cs b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/MessageRequestBuilder.cs index b6ba923..a5db344 100644 --- a/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/MessageRequestBuilder.cs +++ b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/MessageRequestBuilder.cs @@ -6,6 +6,7 @@ using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.MarkAsRead; using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Multicast; using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Narrowcast; +using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp; using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Progress; using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Push; using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Quota; @@ -55,6 +56,11 @@ public partial class MessageRequestBuilder : BaseRequestBuilder { get => new global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Narrowcast.NarrowcastRequestBuilder(PathParameters, RequestAdapter); } + /// The pnp property + public global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.PnpRequestBuilder Pnp + { + get => new global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.PnpRequestBuilder(PathParameters, RequestAdapter); + } /// The progress property public global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Progress.ProgressRequestBuilder Progress { diff --git a/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/PnpRequestBuilder.cs b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/PnpRequestBuilder.cs new file mode 100644 index 0000000..618d0bd --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/PnpRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp +{ + /// + /// Builds and executes requests for operations under \v2\bot\message\pnp + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PnpRequestBuilder : BaseRequestBuilder + { + /// The templated property + public global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated.TemplatedRequestBuilder Templated + { + get => new global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated.TemplatedRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PnpRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/bot/message/pnp", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PnpRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/bot/message/pnp", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/Templated/Push/PushRequestBuilder.cs b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/Templated/Push/PushRequestBuilder.cs new file mode 100644 index 0000000..982c500 --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/Templated/Push/PushRequestBuilder.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable CS0618 +using Line.OpenApi.Messaging.Generated.Api.Models; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions.Serialization; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System.Threading; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated.Push +{ + /// + /// Builds and executes requests for operations under \v2\bot\message\pnp\templated\push + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class PushRequestBuilder : BaseRequestBuilder + { + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public PushRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/bot/message/pnp/templated/push", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public PushRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/bot/message/pnp/templated/push", rawUrl) + { + } + /// + /// Send LINE notification message (template) + /// + /// The request body + /// Cancellation token to use when cancelling requests + /// Configuration for the request such as headers, query parameters, and middleware options. + /// When receiving a 422 status code +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public async Task PostAsync(global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageRequest body, Action>? requestConfiguration = default, CancellationToken cancellationToken = default) + { +#nullable restore +#else + public async Task PostAsync(global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageRequest body, Action> requestConfiguration = default, CancellationToken cancellationToken = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = ToPostRequestInformation(body, requestConfiguration); + var errorMapping = new Dictionary> + { + { "422", global::Line.OpenApi.Messaging.Generated.Api.Models.ErrorResponse.CreateFromDiscriminatorValue }, + }; + await RequestAdapter.SendNoContentAsync(requestInfo, errorMapping, cancellationToken).ConfigureAwait(false); + } + /// + /// Send LINE notification message (template) + /// + /// A + /// The request body + /// Configuration for the request such as headers, query parameters, and middleware options. +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER +#nullable enable + public RequestInformation ToPostRequestInformation(global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageRequest body, Action>? requestConfiguration = default) + { +#nullable restore +#else + public RequestInformation ToPostRequestInformation(global::Line.OpenApi.Messaging.Generated.Api.Models.PnpTemplatedMessageRequest body, Action> requestConfiguration = default) + { +#endif + if(ReferenceEquals(body, null)) throw new ArgumentNullException(nameof(body)); + var requestInfo = new RequestInformation(Method.POST, UrlTemplate, PathParameters); + requestInfo.Configure(requestConfiguration); + requestInfo.Headers.TryAdd("Accept", "application/json"); + requestInfo.SetContentFromParsable(RequestAdapter, "application/json", body); + return requestInfo; + } + /// + /// Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. + /// + /// A + /// The raw URL to use for the request builder. + public global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated.Push.PushRequestBuilder WithUrl(string rawUrl) + { + return new global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated.Push.PushRequestBuilder(rawUrl, RequestAdapter); + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/Templated/TemplatedRequestBuilder.cs b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/Templated/TemplatedRequestBuilder.cs new file mode 100644 index 0000000..143a4f3 --- /dev/null +++ b/src/Line.OpenApi.Messaging/Generated/Api/V2/Bot/Message/Pnp/Templated/TemplatedRequestBuilder.cs @@ -0,0 +1,41 @@ +// +#pragma warning disable CS0618 +using Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated.Push; +using Microsoft.Kiota.Abstractions.Extensions; +using Microsoft.Kiota.Abstractions; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using System; +namespace Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated +{ + /// + /// Builds and executes requests for operations under \v2\bot\message\pnp\templated + /// + [global::System.CodeDom.Compiler.GeneratedCode("Kiota", "1.0.0")] + public partial class TemplatedRequestBuilder : BaseRequestBuilder + { + /// The push property + public global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated.Push.PushRequestBuilder Push + { + get => new global::Line.OpenApi.Messaging.Generated.Api.V2.Bot.Message.Pnp.Templated.Push.PushRequestBuilder(PathParameters, RequestAdapter); + } + /// + /// Instantiates a new and sets the default values. + /// + /// Path parameters for the request + /// The request adapter to use to execute the requests. + public TemplatedRequestBuilder(Dictionary pathParameters, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/bot/message/pnp/templated", pathParameters) + { + } + /// + /// Instantiates a new and sets the default values. + /// + /// The raw URL to use for the request builder. + /// The request adapter to use to execute the requests. + public TemplatedRequestBuilder(string rawUrl, IRequestAdapter requestAdapter) : base(requestAdapter, "{+baseurl}/v2/bot/message/pnp/templated", rawUrl) + { + } + } +} +#pragma warning restore CS0618 diff --git a/src/Line.OpenApi.Messaging/Generated/Api/kiota-lock.json b/src/Line.OpenApi.Messaging/Generated/Api/kiota-lock.json index 13c479c..446c540 100644 --- a/src/Line.OpenApi.Messaging/Generated/Api/kiota-lock.json +++ b/src/Line.OpenApi.Messaging/Generated/Api/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "8AE8E9B85074C26B971E0C653681CCDE25B94883A7D426373EB9812879182B78AE496475F81BF1469297D805FAD5716BC729ACDD4B7DCBB3F57F8C4F740FB086", + "descriptionHash": "EC4ADC3926F294A3676A3F8306406FA3E5DDDF454E8CD961D39C5EC9B9A3C3CC172F91761B8F8B14EA5225DEB711F323F277EED357DE4CCEB371E16DF9780CD7", "descriptionLocation": "../../../../openapi/messaging-api.yml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.34.1", diff --git a/src/Line.OpenApi.Messaging/Generated/Blob/kiota-lock.json b/src/Line.OpenApi.Messaging/Generated/Blob/kiota-lock.json index 8b450d9..6117377 100644 --- a/src/Line.OpenApi.Messaging/Generated/Blob/kiota-lock.json +++ b/src/Line.OpenApi.Messaging/Generated/Blob/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "1674AB477BF5FD8C68F8D88F21243DFA31FAA0B4E4A104660B23616DB14091E00F563C8936A1E3DB5B61EC7ED69867C588748A90BE6A7FD3F8974FBEC457A55B", + "descriptionHash": "985C59E5B1CC874BECDA618A082F52DB95C3A94369F04C060F7FF8EB712865417CFD20F5E0C7C96E018D107831519078E0491F5C5A21ABEEB1DC5951884C9B07", "descriptionLocation": "../../../../openapi/messaging-api.yml", "lockFileVersion": "1.0.0", "kiotaVersion": "1.34.1", From bb774abaece1334004d701f7481a43aa11335376 Mon Sep 17 00:00:00 2001 From: Hirotada Kobayashi Date: Wed, 7 Oct 2026 16:43:39 +0900 Subject: [PATCH 2/2] fix(spec-sync): record upstream refDate correctly; changelog + gate record for fa5577c9 - generate.ps1: pwsh 7 converts the ISO commit date to DateTime, so the string Substring threw and the catch silently left refDate stale. Normalize both DateTime and string forms to a UTC yyyy-MM-dd date. - upstream-manifest.json: refDate 2026-07-28 -> 2026-09-29 (fa5577c9). - CHANGELOG (en/ja): Libraries Unreleased entry for LINE notification messages (template). - docs/reviews: 4-role gate record (all PASS, no blocking). - coverage-roadmap: note PNP template ops are generated-only for now. Co-Authored-By: Claude Opus 5.5 (1M context) --- CHANGELOG.md | 6 +++ CHANGELOG_ja.md | 6 +++ docs/coverage-roadmap.md | 4 ++ .../2026-10-07-spec-sync-fa5577c9-review.md | 52 +++++++++++++++++++ openapi/upstream-manifest.json | 2 +- scripts/generate.ps1 | 5 +- 6 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 docs/reviews/2026-10-07-spec-sync-fa5577c9-review.md diff --git a/CHANGELOG.md b/CHANGELOG.md index eac5368..a36e960 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,12 @@ First stable (GA) release. ## Libraries — `Line.OpenApi.*` +### Unreleased + +#### Added + +- **LINE notification messages (template)** — upstream spec sync to [`line/line-openapi@fa5577c9`](https://github.com/line/line-openapi/commit/fa5577c9ea874d2dbd8fadc85a4cb3a1b29d8cbe). Generated `Line.OpenApi.Messaging` client gains `POST /v2/bot/message/pnp/templated/push` (`client.Api.V2.Bot.Message.Pnp.Templated.Push`) and `GET /v2/bot/message/delivery/pnp/templated` (`client.Api.V2.Bot.Message.Delivery.Pnp.Templated`), with the models `PnpTemplatedMessageRequest`, `PnpTemplatedMessageBody`, `PnpTemplatedEmphasizedItem`, `PnpTemplatedItem` and `PnpTemplatedButton`. `PnpMessagesRequest` gains the optional `customAggregationUnits`. Additive only; no hand-written API changes. + ### 1.0.0 - 2026-08-12 First stable (GA) release of the client libraries. diff --git a/CHANGELOG_ja.md b/CHANGELOG_ja.md index 0ed01c7..9e60d87 100644 --- a/CHANGELOG_ja.md +++ b/CHANGELOG_ja.md @@ -70,6 +70,12 @@ dev トンネルの再起動時に LINE Developers コンソールへ URL を貼 ## ライブラリ — `Line.OpenApi.*` +### Unreleased + +#### 追加 + +- **LINE 通知メッセージ(テンプレート)** — 上流仕様 [`line/line-openapi@fa5577c9`](https://github.com/line/line-openapi/commit/fa5577c9ea874d2dbd8fadc85a4cb3a1b29d8cbe) への追従。生成クライアント `Line.OpenApi.Messaging` に `POST /v2/bot/message/pnp/templated/push`(`client.Api.V2.Bot.Message.Pnp.Templated.Push`)と `GET /v2/bot/message/delivery/pnp/templated`(`client.Api.V2.Bot.Message.Delivery.Pnp.Templated`)、モデル `PnpTemplatedMessageRequest`・`PnpTemplatedMessageBody`・`PnpTemplatedEmphasizedItem`・`PnpTemplatedItem`・`PnpTemplatedButton` を追加。`PnpMessagesRequest` に任意プロパティ `customAggregationUnits` を追加。追加のみで手書き API の変更なし。 + ### 1.0.0 - 2026-08-12 クライアントライブラリの初の安定版(GA)リリース。 diff --git a/docs/coverage-roadmap.md b/docs/coverage-roadmap.md index e038c00..5b8b3d5 100644 --- a/docs/coverage-roadmap.md +++ b/docs/coverage-roadmap.md @@ -30,6 +30,10 @@ line-openapi リポジトリの OpenAPI spec は **9 本**。うち **8 本を 1. 画像アップロード `setRichMenuImage` は spec 上 `*/*`(binary)だが LINE は `Content-Type: image/png`/`image/jpeg` を必須とする。生成コードは content-type を明示せず落とし穴になる(form-urlencoded の `StatelessJwtAssertionTokenSource` と同種)→ 手書きヘルパが要る。 2. 利用シーン用の便利ファサード(`LiffClient` 相当)が無く、生の生成ビルダーは辿りにくい。 +### LINE 通知メッセージ(PNP)は生成物のみで公開(2026-10-07 追記) + +電話番号宛ての LINE 通知メッセージ(パートナー契約前提)は、従来の push/送信数取得に加え、上流 `fa5577c9`(spec-sync・PR #11)で**テンプレート版**(`/v2/bot/message/pnp/templated/push`・`/v2/bot/message/delivery/pnp/templated`)が追加された。いずれも `MessagingClient.Api` の生成ビルダー経由で利用可能で、手書きファサード・CLI/MCP・AI ツールへの露出は**未着手(候補)**。露出する場合の注意: `to` はソルト無し SHA256 ハッシュで元の電話番号に戻せる(ログ・例外に出さない)、`X-Line-Delivery-Tag` は型付き引数にならず `requestConfiguration.Headers` で付ける。 + ## 第1部: 未取り込みの OpenAPI spec(残 1 本=module-attach のみ) > **更新(2026-07-15):** カバレッジ拡充で **insight / manage-audience / module / shop の 4 本を取り込み完了**(`Line.OpenApi.Insight` / `.ManageAudience` / `.Module` / `.Shop`。ラウンド 1=易 3 本、ラウンド 2=manage-audience。記録は `docs/reviews/2026-07-15-coverage-round{1,2}-review.md`)。**module-attach のみ見送り**(下表・パートナー限定 1 op でコスト対効果最低)。 diff --git a/docs/reviews/2026-10-07-spec-sync-fa5577c9-review.md b/docs/reviews/2026-10-07-spec-sync-fa5577c9-review.md new file mode 100644 index 0000000..73e84cc --- /dev/null +++ b/docs/reviews/2026-10-07-spec-sync-fa5577c9-review.md @@ -0,0 +1,52 @@ +# 2026-10-07 spec-sync 上流追従(line-openapi @ fa5577c9)レビュー記録 + +## 概要 + +週次 spec-sync(2026-10-05 cron・run [37309200951](https://github.com/pierre3/line-openapi-dotnet/actions/runs/37309200951))が上流ドリフトを検知し Issue #10 を起票。再生成・build・test・ブランチ push までは成功したが、**draft PR 作成が失敗**した。 + +- 原因: リポジトリ設定 "Allow GitHub Actions to create and approve pull requests" がオフ(`GitHub Actions is not permitted to create or approve pull requests`)。spec-sync 稼働後、実ドリフトが出たのは今回が初めてで、初めて顕在化した。**設定はオンに変更済み(人)**。 +- PR は push 済みブランチ `spec-sync/update-fa5577c9` から手動で作成 → **PR #11**(`Closes #10`)。 + +## 上流差分(`de8bd9e` → `fa5577c9`、上流コミット日 2026-09-29) + +`messaging-api.yml` のみ変化。他 7 本の取り込み spec と見送りの `module-attach.yml` は不変。**追加のみ(非破壊)**。 + +- 新規 op: `POST /v2/bot/message/pnp/templated/push`(`pushTemplatedMessagesByPhone`、任意ヘッダ `X-Line-Delivery-Tag`、202/422)、`GET /v2/bot/message/delivery/pnp/templated`(`getPNPTemplatedMessageStatistics`、`NumberOfMessagesResponse`) +- 新規モデル: `PnpTemplatedMessageRequest` / `PnpTemplatedMessageBody` / `PnpTemplatedEmphasizedItem` / `PnpTemplatedItem` / `PnpTemplatedButton` +- 既存 `PnpMessagesRequest` に任意プロパティ `customAggregationUnits` を追加 +- 生成物の変化は `Generated/Api` のみ。`Generated/Blob` は `kiota-lock.json` の descriptionHash だけ(spec 全体ハッシュのため当然) + +## 検証 + +- ローカル build(Release)エラー 0、`dotnet test` 全 422 件合格(lib 264 / Tools 131 / AI 26 / Webhook Isolation 1) +- `verify-spec-manifest.ps1` 8 本 ok +- PR #11 の CI(build-test / extension-test / pack-verify)pass + +## 4 役ゲート結果(すべて PASS・BLOCKING なし) + +- **spec-reviewer = PASS**: YAML 妥当。R1 = 新 op は op 単位 `servers` 無し=`api.line.me`、Blob 側への混入なし(include/exclude `**/content` 不変)。R2 = 改名・衝突なし。manifest のハッシュは LF 正規化 spec と一致。 +- **code-reviewer = PASS**: 手書きコード・公開 API snapshot 影響なし。新 op は `MessagingClient.Api` 経由で到達可能。既存 PNP にも手書きラッパ・CLI/MCP/AI 露出はないため、合わせて追加するものは無い(パートナー限定機能でもあり今回は露出しない)。 +- **security-reviewer = PASS**: 新 op は `api.line.me` 固定・AllowedHosts 内・data 系混入なし・R1 順序影響なし。`X-Line-Delivery-Tag` は非機密の相関 ID。 +- **test-arch-reviewer = PASS**: op 単位のホストテストは不要(全 op が `{+baseurl}` 共通で既存 `MessagingHostRoutingTests` が構造的に担保)。 + +## 本 PR で対応した指摘 + +- **refDate 据え置きバグ(spec / test-arch が独立に検出・再現確認済み)**: `scripts/generate.ps1` が `commit.committer.date.Substring(0,10)` を呼んでいたが、pwsh 7 の `ConvertFrom-Json` / `Invoke-RestMethod` は ISO 日付を `DateTime` に自動変換するため例外 → `catch` が警告にするだけで `refDate` が**黙って旧値のまま**残っていた。`DateTime` なら UTC 日付へ整形、文字列なら従来どおりに修正。manifest の `refDate` を `2026-07-28` → `2026-09-29` に手修正。 +- **CHANGELOG**(code): ライブラリ系統に `Unreleased` 節を英日で追加(次のライブラリリースは minor 相当)。 + +## 非ブロッキング follow-up(次サイクル) + +1. **spec-sync の push 不具合(test-arch・中)**: checkout は bot ブランチの追跡 ref を持たないため、同名ブランチが既存(PR マージ前に翌週 cron が同じドリフトを再検知/run の再実行)だと `--force-with-lease` が `stale info` で拒否される。pwsh はネイティブコマンドの非 0 終了で止まらないため、**run は緑のまま黙って失敗**する。方針: `git ls-remote --exit-code --heads` で既存なら push をスキップし PR 作成/更新のみ(SHA 命名で内容は決定的・レビュアー fixup 保護)、スキップを PR 本文に明記、`$PSNativeCommandUseErrorActionPreference = $true` で無言失敗を排除。 +2. **build/test 失敗が run 結果に出ない(test-arch・中)**: `continue-on-error` のため。PR 作成後の最終ステップで outcome が success 以外なら `exit 1`。 +3. **Issue と PR 結果の非連動(test-arch・低)**: PR 番号・run URL・build/test 結果を追跡 Issue にコメント。失敗時は `if: failure()` で run URL を残す。 +4. **spec 駆動の R1 ガードテスト(test-arch・中)**: `servers` が api-data のパス集合と Blob 生成フィルタ(`**/content`)の一致集合が等しいことを spec から検証(`manage-audience.yml` の `**/upload/byFile` も同型)。`/content` で終わらない data 系 op が上流に足された場合の黙った誤ルーティングを防ぐ。 +5. **`ci.yml` に `permissions:` 未指定(security・中)**: 今回の設定オンで PR 作成/承認が可能になったため明示 `contents: read` を推奨。ただしリポジトリ既定は `default_workflow_permissions: read` を API で確認済みで、現状の実リスクは低い。main のブランチ保護で bot 承認だけではマージ条件を満たさないことも確認推奨。 +6. **GITHUB_TOKEN で作った PR では `ci.yml` が起動しない(security・低)**: 今後自動作成される spec-sync PR には CI 結果が付かない。マージ前に close/reopen 等で CI を走らせる運用、または App token 化を検討。 +7. **ドキュメント注意喚起(security・低)**: PNP を概念記事で扱う/ファサード化する場合、`to` はソルト無しのハッシュで元の電話番号に戻せる(ログや例外に出さない)、パートナー契約前提、`X-Line-Delivery-Tag` は `requestConfiguration.Headers` で付ける、を明記。 +8. **露出判断の追跡(test-arch・低)**: PNP テンプレート送信の CLI/MCP 露出は `docs/coverage-roadmap.md` に候補として記録。 + +既知 follow-up(security L1: 特権ジョブ内の build/test)は未解決のまま継続。 + +## 判定 + +4 役 PASS。マージの go/no-go は人。 diff --git a/openapi/upstream-manifest.json b/openapi/upstream-manifest.json index 0db349a..def83bf 100644 --- a/openapi/upstream-manifest.json +++ b/openapi/upstream-manifest.json @@ -3,7 +3,7 @@ "schemaVersion": 1, "repository": "line/line-openapi", "ref": "fa5577c9ea874d2dbd8fadc85a4cb3a1b29d8cbe", - "refDate": "2026-07-28", + "refDate": "2026-09-29", "retrievedAt": "2026-10-05", "hashAlgorithm": "sha256", "hashNormalization": "line endings normalized to LF before hashing", diff --git a/scripts/generate.ps1 b/scripts/generate.ps1 index 12ea2be..bf96255 100644 --- a/scripts/generate.ps1 +++ b/scripts/generate.ps1 @@ -109,7 +109,10 @@ if ($Update) { $ghRaw = Invoke-GhApiRaw "repos/$repo/commits/$targetRef" $c = if ($ghRaw) { $ghRaw | ConvertFrom-Json } else { Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/commits/$targetRef" -Headers @{ "User-Agent" = "line-openapi-dotnet" } } - $manifest.refDate = ($c.commit.committer.date).Substring(0, 10) + # pwsh 7 の ConvertFrom-Json / Invoke-RestMethod は ISO 日付を DateTime へ自動変換する(文字列前提の + # Substring は例外→catch で握り潰され refDate が黙って据え置かれていた)。両形を UTC 日付へ正規化する。 + $d = $c.commit.committer.date + $manifest.refDate = if ($d -is [datetime]) { $d.ToUniversalTime().ToString('yyyy-MM-dd') } else { ([string]$d).Substring(0, 10) } } catch { Write-Warning "could not resolve commit date for $targetRef" } # LF 固定で書く(.gitattributes と併せ Windows/CI 間の改行 churn を防ぐ)。 $manifestJson = (($manifest | ConvertTo-Json -Depth 10) -replace "`r`n", "`n") + "`n"