Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ src/main/java/com/linecorp/bot/messaging/model/NumberOfMessagesResponse.java
src/main/java/com/linecorp/bot/messaging/model/OperatorDemographicFilter.java
src/main/java/com/linecorp/bot/messaging/model/OperatorRecipient.java
src/main/java/com/linecorp/bot/messaging/model/PnpMessagesRequest.java
src/main/java/com/linecorp/bot/messaging/model/PnpTemplatedButton.java
src/main/java/com/linecorp/bot/messaging/model/PnpTemplatedEmphasizedItem.java
src/main/java/com/linecorp/bot/messaging/model/PnpTemplatedItem.java
src/main/java/com/linecorp/bot/messaging/model/PnpTemplatedMessageBody.java
src/main/java/com/linecorp/bot/messaging/model/PnpTemplatedMessageRequest.java
src/main/java/com/linecorp/bot/messaging/model/PostbackAction.java
src/main/java/com/linecorp/bot/messaging/model/PushMessageRequest.java
src/main/java/com/linecorp/bot/messaging/model/PushMessageResponse.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import com.linecorp.bot.messaging.model.NarrowcastRequest;
import com.linecorp.bot.messaging.model.NumberOfMessagesResponse;
import com.linecorp.bot.messaging.model.PnpMessagesRequest;
import com.linecorp.bot.messaging.model.PnpTemplatedMessageRequest;
import com.linecorp.bot.messaging.model.PushMessageRequest;
import com.linecorp.bot.messaging.model.PushMessageResponse;
import com.linecorp.bot.messaging.model.QuotaConsumptionResponse;
Expand Down Expand Up @@ -425,6 +426,19 @@ CompletableFuture<Result<NumberOfMessagesResponse>> getNumberOfSentReplyMessages
CompletableFuture<Result<NumberOfMessagesResponse>> getPNPMessageStatistics(
@Query("date") String date);

/**
* Get number of sent LINE notification messages (template)
*
* @param date Date the message was sent Format: &#x60;yyyyMMdd&#x60;
* (Example:&#x60;20211231&#x60;) Time zone: UTC+9 (required)
* @see <a
* href="https://developers.line.biz/en/reference/line-notification-messages/#get-number-of-sent-line-notification-messages-template">
* Documentation</a>
*/
@GET("/v2/bot/message/delivery/pnp/templated")
CompletableFuture<Result<NumberOfMessagesResponse>> getPNPTemplatedMessageStatistics(
@Query("date") String date);

/**
* Get profile
*
Expand Down Expand Up @@ -700,6 +714,21 @@ CompletableFuture<Result<Void>> pushMessagesByPhone(
@Header("X-Line-Delivery-Tag") String xLineDeliveryTag,
@Body PnpMessagesRequest pnpMessagesRequest);

/**
* Send LINE notification message (template)
*
* @param xLineDeliveryTag String returned in the delivery.data property of the delivery
* completion event via Webhook. (optional)
* @param pnpTemplatedMessageRequest (required)
* @see <a
* href="https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template">
* Documentation</a>
*/
@POST("/v2/bot/message/pnp/templated/push")
CompletableFuture<Result<Void>> pushTemplatedMessagesByPhone(
@Header("X-Line-Delivery-Tag") String xLineDeliveryTag,
@Body PnpTemplatedMessageRequest pnpTemplatedMessageRequest);

/**
* Send reply message
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,15 @@ public record PnpMessagesRequest(
* they have disabled push notifications in LINE and/or their device). The default value is
* false.
*/
@JsonProperty("notificationDisabled") Boolean notificationDisabled) {
@JsonProperty("notificationDisabled") Boolean notificationDisabled,
/** Name of aggregation unit. Case-sensitive. */
@JsonProperty("customAggregationUnits") List<String> customAggregationUnits) {

public static class Builder {
private List<Message> messages;
private String to;
private Boolean notificationDisabled;
private List<String> customAggregationUnits;

public Builder(List<Message> messages, String to) {

Expand All @@ -69,8 +72,13 @@ public Builder notificationDisabled(Boolean notificationDisabled) {
return this;
}

public Builder customAggregationUnits(List<String> customAggregationUnits) {
this.customAggregationUnits = customAggregationUnits;
return this;
}

public PnpMessagesRequest build() {
return new PnpMessagesRequest(messages, to, notificationDisabled);
return new PnpMessagesRequest(messages, to, notificationDisabled, customAggregationUnits);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* PnpTemplatedButton
*
* @see <a
* href="https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-buttons">
* Documentation</a>
*/
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record PnpTemplatedButton(
/**
* 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
*/
@JsonProperty("buttonKey") String buttonKey,
/** URL of the page to be opened when the user presses the button. */
@JsonProperty("url") String url) {

public static class Builder {
private String buttonKey;
private String url;

public Builder(String buttonKey, String url) {

this.buttonKey = buttonKey;

this.url = url;
}

public PnpTemplatedButton build() {
return new PnpTemplatedButton(buttonKey, url);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Item to emphasize in the message.
*
* @see <a
* href="https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-items">
* Documentation</a>
*/
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record PnpTemplatedEmphasizedItem(
/**
* 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
*/
@JsonProperty("itemKey") String itemKey,
/** String to be displayed as the value of the item. */
@JsonProperty("content") String content) {

public static class Builder {
private String itemKey;
private String content;

public Builder(String itemKey, String content) {

this.itemKey = itemKey;

this.content = content;
}

public PnpTemplatedEmphasizedItem build() {
return new PnpTemplatedEmphasizedItem(itemKey, content);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* PnpTemplatedItem
*
* @see <a
* href="https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template-items">
* Documentation</a>
*/
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record PnpTemplatedItem(
/**
* 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
*/
@JsonProperty("itemKey") String itemKey,
/** String to be displayed as the value of the item. */
@JsonProperty("content") String content) {

public static class Builder {
private String itemKey;
private String content;

public Builder(String itemKey, String content) {

this.itemKey = itemKey;

this.content = content;
}

public PnpTemplatedItem build() {
return new PnpTemplatedItem(itemKey, content);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
* The body object of the template you want to send. You can&#39;t specify the same item more than
* once in a single message.
*
* @see <a
* href="https://developers.line.biz/en/reference/line-notification-messages/#send-line-notification-message-template">
* Documentation</a>
*/
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record PnpTemplatedMessageBody(
/** Get emphasizedItem */
@JsonProperty("emphasizedItem") PnpTemplatedEmphasizedItem emphasizedItem,
/**
* Array of items to include in the message. The &#x60;itemKey&#x60; must be unique across
* &#x60;emphasizedItem&#x60; and &#x60;items&#x60;.
*/
@JsonProperty("items") List<PnpTemplatedItem> items,
/** Array of buttons to include in the message. The &#x60;buttonKey&#x60; must be unique. */
@JsonProperty("buttons") List<PnpTemplatedButton> buttons) {

public static class Builder {
private PnpTemplatedEmphasizedItem emphasizedItem;
private List<PnpTemplatedItem> items;
private List<PnpTemplatedButton> buttons;

public Builder() {}

public Builder emphasizedItem(PnpTemplatedEmphasizedItem emphasizedItem) {
this.emphasizedItem = emphasizedItem;
return this;
}

public Builder items(List<PnpTemplatedItem> items) {
this.items = items;
return this;
}

public Builder buttons(List<PnpTemplatedButton> buttons) {
this.buttons = buttons;
return this;
}

public PnpTemplatedMessageBody build() {
return new PnpTemplatedMessageBody(emphasizedItem, items, buttons);
}
}
}
Loading
Loading