6 |
7 |
15 |
16 | @wrapper.main>
17 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | plugins {
18 | id("sdk.openapi")
19 | id("sdk.publish")
20 | }
21 |
22 | dependencies {
23 | testImplementation(libs.jsonassert)
24 | }
25 |
--------------------------------------------------------------------------------
/line-bot-webhook/src/main/java/com/linecorp/bot/webhook/model/UnknownSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.webhook.model;
18 |
19 | public record UnknownSource(String userId) implements Source {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/line-bot-webhook/src/main/java/com/linecorp/bot/webhook/model/UnknownModuleContent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.webhook.model;
18 |
19 | public record UnknownModuleContent() implements ModuleContent {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownRecipient.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownRecipient() implements Recipient {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownTemplate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownTemplate() implements Template {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/line-bot-webhook/src/main/java/com/linecorp/bot/webhook/model/UnknownMessageContent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.webhook.model;
18 |
19 | public record UnknownMessageContent(String id) implements MessageContent {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownAction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownAction(String label) implements Action {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownFlexComponent.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownFlexComponent() implements FlexComponent {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownFlexContainer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownFlexContainer() implements FlexContainer {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/line-bot-parser/src/main/java/com/linecorp/bot/parser/SignatureValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.parser;
18 |
19 | public interface SignatureValidator {
20 | boolean validateSignature(byte[] content, String headerSignature);
21 | }
22 |
--------------------------------------------------------------------------------
/line-bot-webhook/src/main/java/com/linecorp/bot/webhook/model/UnknownMentionee.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.webhook.model;
18 |
19 | public record UnknownMentionee(Integer index, Integer length, String userId) implements Mentionee {
20 | }
21 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/main/resources/templates/manage_audience/click.ftlh:
--------------------------------------------------------------------------------
1 | <#-- @ftlvariable name="requestId" type="java.lang.String" -->
2 | <#import "../__wrapper.ftlh" as wrapper>
3 | <@wrapper.main>
4 |
5 |
Create audience for click-based retargeting
6 |
7 |
19 |
20 | @wrapper.main>
21 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: "Feature Request"
5 | ---
6 |
7 | ## Feature Request
8 |
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownDemographicFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownDemographicFilter() implements DemographicFilter {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownFlexBoxBackground.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownFlexBoxBackground() implements FlexBoxBackground {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/http/HttpAuthenticator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.client.base.http;
18 |
19 | public interface HttpAuthenticator {
20 | HttpRequest authenticate(HttpResponse response);
21 | }
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownMessage.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownMessage(QuickReply quickReply, Sender sender) implements Message {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/generator/src/main/resources/line-java-codegen/licenseInfo.pebble:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | /**
18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19 | * https://openapi-generator.tech
20 | * Do not edit the class manually.
21 | */
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownImagemapAction.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownImagemapAction(ImagemapArea area) implements ImagemapAction {
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownRichMenuBatchOperation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messaging.model;
18 |
19 | public record UnknownRichMenuBatchOperation() implements RichMenuBatchOperation {
20 | }
21 |
--------------------------------------------------------------------------------
/line-bot-jackson/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | plugins {
18 | id("sdk.java-library")
19 | id("sdk.publish")
20 | }
21 |
22 | dependencies {
23 | api(libs.jackson.databind) // Provide configured ObjectMapper.
24 | implementation(libs.jackson.datatype.jsr310)
25 | }
26 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/main/resources/templates/manage_audience/imp.ftlh:
--------------------------------------------------------------------------------
1 | <#-- @ftlvariable name="audienceGroups" type="com.linecorp.bot.audience.model.GetAudienceGroupsResponse" -->
2 | <#import "../__wrapper.ftlh" as wrapper>
3 | <@wrapper.main>
4 |
5 |
Create audience for impression-based retargeting
6 |
7 |
18 |
19 | @wrapper.main>
20 |
--------------------------------------------------------------------------------
/samples/sample-spring-boot-echo/README.md:
--------------------------------------------------------------------------------
1 | # sample-spring-boot-echo
2 |
3 | sample-spring-boot-echo is a tiny sample bot application based on Spring Boot.
4 |
5 | ## Usage
6 |
7 | Run this sample bot using Gradle.
8 |
9 | ../gradlew bootRun -Dline.bot.channelToken=YOUR_CHANNEL_TOKEN \
10 | -Dline.bot.channelSecret=YOUR_CHANNEL_SECRET
11 |
12 | or if you finished create `src/main/resources/application.yml` file based on `src/main/resources/application-template.yml`. You can start configured web server just hitting
13 |
14 | ../gradlew bootRun
15 |
16 | You need to pass the following options.
17 |
18 | * line.bot.channelToken: Your Channel access token
19 | * line.bot.channelSecret: Your Channel secret
20 |
21 | For more information about configuration way, refer [Spring Boot Reference - 24. Externalized Configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html).
22 |
23 |
--------------------------------------------------------------------------------
/.github/workflows/label-issue.yml:
--------------------------------------------------------------------------------
1 | name: Label issue
2 |
3 | on:
4 | issues:
5 | types:
6 | - opened
7 | - reopened
8 | - closed
9 |
10 | jobs:
11 | label-issues:
12 | runs-on: ubuntu-latest
13 | permissions:
14 | issues: write
15 | steps:
16 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
17 |
18 | - name: Add label on issue open
19 | if: github.event.action == 'opened' || github.event.action == 'reopened'
20 | run: |
21 | gh issue edit ${{ github.event.issue.number }} \
22 | --add-label "untriaged" \
23 | env:
24 | GH_TOKEN: ${{ github.token }}
25 |
26 | - name: Remove label on issue close
27 | if: github.event.action == 'closed'
28 | run: |
29 | gh issue edit ${{ github.event.issue.number }} \
30 | --remove-label "untriaged"
31 | env:
32 | GH_TOKEN: ${{ github.token }}
33 |
--------------------------------------------------------------------------------
/samples/sample-spring-boot-echo-kotlin/README.md:
--------------------------------------------------------------------------------
1 | # sample-spring-boot-echo-kotlin
2 |
3 | sample-spring-boot-echo-kotlin is a tiny sample bot application based on Spring Boot.
4 |
5 | ## Usage
6 |
7 | Run this sample bot using Gradle.
8 |
9 | ../gradlew bootRun -Dline.bot.channelToken=YOUR_CHANNEL_TOKEN \
10 | -Dline.bot.channelSecret=YOUR_CHANNEL_SECRET
11 |
12 | or if you finished create `src/main/resources/application.yml` file based on `src/main/resources/application-template.yml`. You can start configured web server just hitting
13 |
14 | ../gradlew bootRun
15 |
16 | You need to pass the following options.
17 |
18 | * line.bot.channelToken: Your Channel access token
19 | * line.bot.channelSecret: Your Channel secret
20 |
21 | For more information about configuration way, refer [Spring Boot Reference - 24. Externalized Configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html).
22 |
--------------------------------------------------------------------------------
/samples/sample-spring-boot-kitchensink/README.md:
--------------------------------------------------------------------------------
1 | # sample-spring-boot-kitchensink
2 |
3 | ## What is this?
4 |
5 | This is a full-featured sample application for the LINE Messaging API.
6 |
7 | ## Usage
8 |
9 | Run this sample bot using Gradle.
10 |
11 | ../gradlew bootRun -Dline.bot.channelToken=YOUR_CHANNEL_TOKEN \
12 | -Dline.bot.channelSecret=YOUR_CHANNEL_SECRET
13 |
14 | or if you finished create `src/main/resources/application.yml` file based on `src/main/resources/application-template.yml`. You can start configured web server just hitting
15 |
16 | ../gradlew bootRun
17 |
18 | You need to pass the following options.
19 |
20 | * line.bot.channelToken: Your Channel access token
21 | * line.bot.channelSecret: Your Channel secret
22 |
23 | For more information about configuration way, refer [Spring Boot Reference - 24. Externalized Configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html).
24 |
--------------------------------------------------------------------------------
/clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/http/HttpInterceptor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.client.base.http;
18 |
19 | import java.io.IOException;
20 |
21 | public interface HttpInterceptor {
22 | HttpResponse intercept(HttpChain httpChain) throws IOException;
23 | }
24 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/main/resources/templates/bot/test_webhook.ftlh:
--------------------------------------------------------------------------------
1 | <#-- @ftlvariable name="response" type="com.linecorp.bot.messaging.model.TestWebhookEndpointResponse" -->
2 | <#import "../__wrapper.ftlh" as wrapper>
3 | <@wrapper.main>
4 |
5 |
Webhook testing result
6 |
7 |
8 |
9 |
Success
10 |
${response.success()!?c}
11 |
12 |
13 |
timestamp
14 |
${response.timestamp().toEpochSecond()!}
15 |
16 |
17 |
statusCode
18 |
${response.statusCode()}
19 |
20 |
21 |
Reason
22 |
${response.reason()!"-"}
23 |
24 |
25 |
Detail
26 |
${response.detail()!"-"}
27 |
28 |
29 |
30 | @wrapper.main>
31 |
--------------------------------------------------------------------------------
/line-bot-webhook/src/test/resources/callback/text-mention.json:
--------------------------------------------------------------------------------
1 | {
2 | "destination": "Uab012345678901234567890123456789",
3 | "events": [
4 | {
5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA",
6 | "type": "message",
7 | "timestamp": 1462629479859,
8 | "mode": "active",
9 | "source": {
10 | "type": "user",
11 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8"
12 | },
13 | "message": {
14 | "id": "325708",
15 | "type": "text",
16 | "text": "Hello, world @Brown and @Cony",
17 | "mention": {
18 | "mentionees": [
19 | {
20 | "index": 13,
21 | "length": 6,
22 | "userId": "U12345678901234567890123456780",
23 | "type": "user"
24 | },
25 | {
26 | "index": 24,
27 | "length": 5,
28 | "type": "all"
29 | }
30 | ]
31 | }
32 | }
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/ExceptionBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.client.base;
18 |
19 | import java.io.IOException;
20 |
21 | import okhttp3.Response;
22 |
23 | public interface ExceptionBuilder {
24 | IOException build(Response response) throws IOException;
25 | }
26 |
--------------------------------------------------------------------------------
/.github/workflows/pom-validation.yml:
--------------------------------------------------------------------------------
1 | name: pom validation
2 | on:
3 | push:
4 | pull_request:
5 | merge_group:
6 | workflow_dispatch:
7 |
8 | jobs:
9 | test:
10 | name: test (JDK ${{ matrix.java }})
11 | runs-on: ubuntu-latest
12 | timeout-minutes: 10
13 | permissions:
14 | contents: read
15 | strategy:
16 | fail-fast: false
17 | matrix:
18 | java: [ '17' ] # We want to test on LTSs.
19 | steps:
20 | - name: actions/setup-java@v3 (JDK ${{ matrix.java }})
21 | uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
22 | with:
23 | distribution: 'temurin'
24 | java-version: ${{ matrix.java }}
25 | architecture: x64
26 | - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
27 | with:
28 | submodules: true
29 | - run: |
30 | mkdir -p ~/.gradle
31 | echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
32 | - run: python3 tests/maven-pom-validation-test.py
33 |
34 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Build output
2 | target/
3 | build/
4 | out/
5 | /**/reports/
6 | /reports/
7 |
8 | # gradle
9 | /.gradle/
10 | /*/.gradle/
11 |
12 | # Mobile Tools for Java (J2ME)
13 | .mtj.tmp/
14 |
15 | # Package Files #
16 | *.jar
17 | *.war
18 | *.ear
19 |
20 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
21 | hs_err_pid*
22 |
23 | # IntelliJ
24 | .idea
25 | *.iml
26 | *.iws
27 | *.ipr
28 | *.ids
29 | *.orig
30 |
31 | # Eclipse
32 | *.pydevproject
33 | .project
34 | .metadata
35 | /bin/**
36 | /tmp/**
37 | /tmp/**/*
38 | *.tmp
39 | *.bak
40 | *.swp
41 | *~.nib
42 | local.properties
43 | .classpath
44 | .settings/**
45 | .loadpath
46 | /src/main/resources/rebel.xml
47 |
48 | # External tool builders
49 | .externalToolBuilders/**
50 |
51 | # Locally stored "Eclipse launch configurations"
52 | *.launch
53 |
54 | # CDT-specific
55 | .cproject
56 |
57 | # PDT-specific
58 | .buildpath
59 | integration_test_settings.yml
60 |
61 | # Mac
62 | .DS_Store
63 | bin/
64 |
65 | # github workflow
66 | pr_info.json
67 |
--------------------------------------------------------------------------------
/line-bot-parser/src/main/java/com/linecorp/bot/parser/WebhookParseException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.parser;
18 |
19 | public class WebhookParseException extends Exception {
20 | private static final long serialVersionUID = 3026745517844618607L;
21 |
22 | public WebhookParseException(String message) {
23 | super(message);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/line-bot-parser/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | plugins {
18 | id("sdk.java-library")
19 | id("sdk.publish")
20 | }
21 |
22 | dependencies {
23 | api(project(":line-bot-webhook"))
24 | api(project(":line-bot-jackson"))
25 |
26 | implementation(libs.jackson.databind)
27 | implementation(libs.slf4j.api)
28 |
29 | testImplementation(libs.bundles.tests)
30 | }
31 |
--------------------------------------------------------------------------------
/clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/Result.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.client.base;
18 |
19 | /**
20 | * Result of the API call.
21 | *
22 | * @param requestId X-line-request-id.
23 | * @param acceptedRequestId X-Line-Accepted-Request-Id(Optional)
24 | */
25 | public record Result(String requestId, String acceptedRequestId, T body) {
26 | }
27 |
--------------------------------------------------------------------------------
/spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/argument/ArgumentResolver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.spring.boot.handler.argument;
18 |
19 | import com.linecorp.bot.webhook.model.Event;
20 |
21 | public interface ArgumentResolver {
22 | boolean isSupported(Event event);
23 |
24 | Object resolve(String destination, Event event);
25 | }
26 |
--------------------------------------------------------------------------------
/renovate.json5:
--------------------------------------------------------------------------------
1 | {
2 | $schema: 'https://docs.renovatebot.com/renovate-schema.json',
3 | extends: [
4 | 'config:recommended',
5 | 'helpers:pinGitHubActionDigestsToSemver',
6 | ],
7 | timezone: 'Asia/Tokyo',
8 | automerge: true,
9 | platformAutomerge: true,
10 | 'git-submodules': {
11 | enabled: true,
12 | },
13 | labels: [
14 | 'dependency upgrade',
15 | ],
16 | minimumReleaseAge : "7 days",
17 | packageRules: [
18 | {
19 | labels: [
20 | 'dependency upgrade',
21 | 'line-openapi-update',
22 | ],
23 | // In many cases, we would like to update line-openapi by dispatching the GitHub workflow during working
24 | // hours, as there are code changes.
25 | // If that is forgotten, there's a possibility that line-openapi updates or code changes won't happen at
26 | // all, so we allow it to run at night just in case.
27 | schedule: [
28 | 'after 11pm',
29 | 'before 4am',
30 | ],
31 | matchPackageNames: [
32 | '/line-openapi/',
33 | ],
34 | },
35 | ],
36 | }
37 |
--------------------------------------------------------------------------------
/line-bot-webhook/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | plugins {
18 | id("sdk.java-library")
19 | id("sdk.publish")
20 | }
21 |
22 |
23 | dependencies {
24 | compileOnly(libs.jackson.annotations)
25 | compileOnly(libs.javax.annotation)
26 | compileOnly(libs.jakarta.annotation.api)
27 |
28 | testImplementation(libs.bundles.tests)
29 | testImplementation(libs.jackson.databind)
30 | testImplementation(libs.wiremock)
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/clients/line-liff-client/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/channel/ChannelTokenSupplier.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.client.base.channel;
18 |
19 | import java.util.function.Supplier;
20 |
21 | /**
22 | * Special {@link Supplier} for Channel Access Token.
23 | *
24 | *
You can implement it to return same channel tokens.
25 | * Or refresh tokens internally.
26 | */
27 | @FunctionalInterface
28 | public interface ChannelTokenSupplier extends Supplier {
29 | }
30 |
--------------------------------------------------------------------------------
/clients/line-bot-insight-client/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/clients/line-bot-module-client/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/clients/line-bot-shop-client/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/clients/line-bot-manage-audience-client/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/clients/line-bot-messaging-api-client/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/clients/line-bot-module-attach-client/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/clients/line-channel-access-token-client/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
--------------------------------------------------------------------------------
/spring-boot/line-bot-spring-boot-web/src/main/java/com/linecorp/bot/spring/boot/web/argument/annotation/LineBotMessages.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.spring.boot.web.argument.annotation;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | @Retention(RetentionPolicy.RUNTIME)
25 | @Target(ElementType.PARAMETER)
26 | public @interface LineBotMessages {
27 | }
28 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/main/java/com/linecorp/bot/messagingapidemoapp/controller/RootController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messagingapidemoapp.controller;
18 |
19 | import org.springframework.stereotype.Controller;
20 | import org.springframework.web.bind.annotation.GetMapping;
21 |
22 | @Controller
23 | public class RootController {
24 | public RootController() {
25 | }
26 |
27 | @GetMapping("/")
28 | public String index() {
29 | return "index";
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-boot/line-bot-spring-boot-web/src/main/java/com/linecorp/bot/spring/boot/web/argument/annotation/LineBotDestination.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.spring.boot.web.argument.annotation;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | @Retention(RetentionPolicy.RUNTIME)
25 | @Target(ElementType.PARAMETER)
26 | public @interface LineBotDestination {
27 | }
28 |
--------------------------------------------------------------------------------
/samples/sample-spring-boot-kitchensink/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | plugins {
18 | id("sdk.java-library")
19 | id("sdk.spring-boot")
20 | }
21 |
22 | dependencies {
23 | implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
24 |
25 | implementation(project(":spring-boot:line-bot-spring-boot-handler"))
26 | implementation("org.springframework.boot:spring-boot-starter-web")
27 |
28 | testImplementation("org.springframework.boot:spring-boot-starter-test")
29 | }
30 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/test/java/com/linecorp/bot/messagingapidemoapp/SampleManageAudienceApplicationTests.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messagingapidemoapp;
18 |
19 | import org.junit.jupiter.api.Test;
20 | import org.springframework.boot.test.context.SpringBootTest;
21 |
22 | @SpringBootTest(properties = {
23 | "line.bot.channel-token=DUMMY",
24 | "line.bot.channel-secret=DUMMY",
25 | })
26 | class SampleManageAudienceApplicationTests {
27 | @Test
28 | void contextLoads() {
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/main/java/com/linecorp/bot/messagingapidemoapp/SampleManageAudienceApplication.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.messagingapidemoapp;
18 |
19 | import org.springframework.boot.SpringApplication;
20 | import org.springframework.boot.autoconfigure.SpringBootApplication;
21 |
22 | @SpringBootApplication
23 | public class SampleManageAudienceApplication {
24 |
25 | public static void main(String[] args) {
26 | SpringApplication.run(SampleManageAudienceApplication.class, args);
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/.github/workflows/close-issue.yml:
--------------------------------------------------------------------------------
1 | # https://docs.github.com/en/actions/managing-issues-and-pull-requests/closing-inactive-issues
2 | # https://github.com/marketplace/actions/close-stale-issues
3 | name: Close inactive issues
4 | on:
5 | schedule:
6 | - cron: "30 1 * * *"
7 |
8 | jobs:
9 | close-issues:
10 | runs-on: ubuntu-latest
11 | permissions:
12 | issues: write
13 | pull-requests: write
14 | if: github.repository == 'line/line-bot-sdk-java'
15 | steps:
16 | - uses: actions/stale@997185467fa4f803885201cee163a9f38240193d # v10.1.1
17 | with:
18 | days-before-issue-stale: 14
19 | days-before-issue-close: 0
20 | stale-issue-label: "no-activity"
21 | close-issue-message: "This issue was closed because it has been inactive for 14 days."
22 | exempt-issue-labels: "bug,enhancement,keep,untriaged"
23 | days-before-pr-stale: -1
24 | days-before-pr-close: 14
25 | stale-pr-label: "no-activity"
26 | close-pr-message: "This pull request was closed because it has been inactive for 14 days. Please reopen if you still intend to submit this pull request."
27 | repo-token: ${{ secrets.GITHUB_TOKEN }}
28 |
--------------------------------------------------------------------------------
/spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/configuration/LineBotHandlerConfiguration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.spring.boot.handler.configuration;
18 |
19 | import org.springframework.context.annotation.Configuration;
20 | import org.springframework.context.annotation.Import;
21 |
22 | import com.linecorp.bot.spring.boot.handler.support.LineMessageHandlerSupport;
23 |
24 | @Configuration
25 | @Import(LineMessageHandlerSupport.class)
26 | public class LineBotHandlerConfiguration {
27 | }
28 |
--------------------------------------------------------------------------------
/clients/line-liff-client/src/main/java/com/linecorp/bot/liff/client/LiffClientException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.liff.client;
18 |
19 | import com.linecorp.bot.client.base.exception.AbstractLineClientException;
20 |
21 | import okhttp3.Response;
22 |
23 | /**
24 | * A general {@link Exception} for LIFF server API.
25 | */
26 | @SuppressWarnings("serial")
27 | public class LiffClientException extends AbstractLineClientException {
28 | public LiffClientException(Response response) {
29 | super(response, "");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/generator/src/main/resources/line-java-codegen/model/enum.pebble:
--------------------------------------------------------------------------------
1 | {# @pebvariable name="model" type="org.openapitools.codegen.CodegenModel" -#}
2 | import com.fasterxml.jackson.annotation.JsonProperty;
3 | import com.fasterxml.jackson.annotation.JsonValue;
4 |
5 | /**
6 | * {{ model.description | escape }}{% if not model.description %}Gets or Sets {{model.name}}{% endif %}
7 | */
8 | public enum {{model.classname}} {
9 | {% if model.allowableValues != null %}
10 | {% for enumVar in model.allowableValues.get("enumVars") -%}
11 | {% if enumVar.enumDescription %}
12 | /**
13 | * {{enumVar.enumDescription | escape }}
14 | */
15 | {% endif %}
16 | @JsonProperty({{enumVar.value}})
17 | {{enumVar.name}},
18 | {% endfor %}
19 | {% endif %}
20 | @JsonEnumDefaultValue
21 | UNDEFINED;
22 |
23 |
24 | @JsonValue
25 | public String toValue() {
26 | return switch (this) {
27 | {% if model.allowableValues != null %}
28 | {% for enumVar in model.allowableValues.get("enumVars") -%}
29 | case {{enumVar.name}} -> {{enumVar.value}};
30 | {% endfor %}
31 | {% endif %}
32 | default -> "UNDEFINED";
33 | };
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/main/resources/templates/message/__message_form.ftlh:
--------------------------------------------------------------------------------
1 | <#list [1,2,3,4,5] as msgno>
2 |
3 |
4 |
8 | Message in JSON
9 |
10 | #list>
11 |
12 |
13 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/samples/sample-spring-boot-echo/src/main/resources/application-template.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 LINE Corporation
3 | #
4 | # LINE Corporation licenses this file to you under the Apache License,
5 | # version 2.0 (the "License"); you may not use this file except in compliance
6 | # with the License. You may obtain a copy of the License at:
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations
14 | # under the License.
15 |
16 | This is a template for the configuration file.
17 | Make a copy called `application.yml` and change the values below.
18 |
19 | line.bot:
20 | channel-token: 'Put Your Channel Token Here.'
21 | channel-secret: 'Put Your Channel Secret Here.'
22 | handler.path: /callback
23 |
24 | # To remove Client wire logs. Please comment out following lines.
25 | # See: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html
26 | #
27 | #logging.level:
28 | # com.linecorp.bot.client.wire: INFO
29 |
--------------------------------------------------------------------------------
/generator/src/main/resources/line-java-codegen/macros/api_param.pebble:
--------------------------------------------------------------------------------
1 | {%- macro api_param(param, op) -%}
2 | {#- @pebvariable name="param" type="org.openapitools.codegen.CodegenParameter" -#}
3 | {#- @pebvariable name="op" type="org.openapitools.codegen.CodegenOperation" -#}
4 | {%- if param.isQueryParam %}
5 | @Query("{{param.baseName}}") {{ param.dataType }} {{ param.paramName }}
6 | {%- elseif param.isPathParam -%}
7 | @Path("{{param.baseName}}") {{param.dataType}} {{param.paramName}}
8 | {%- elseif param.isHeaderParam -%}
9 | @Header("{{param.baseName}}") {{param.dataType}} {{param.paramName}}
10 | {%- elseif param.isBodyParam -%}
11 | @Body {% if param.isFile %}UploadFile{% else %}{{ param.dataType }}{% endif %} {{param.paramName}}
12 | {%- elseif param.isFormParam -%}
13 | {%- if param.isFile -%}
14 | {% if op.isMultipart -%}
15 | @Part("{{param.baseName}}\"; filename=\"{{param.baseName}}")
16 | {%- else -%}
17 | @Field("{{param.baseName}}")
18 | {%- endif %} UploadFile {{param.paramName}}
19 | {%- else -%}
20 | {%- if op.isMultipart %}@Part{% else %}@Field{% endif %}("{{param.baseName}}") {{param.dataType}} {{param.paramName}}
21 | {%- endif %}
22 | {%- endif -%}
23 | {%- endmacro -%}
24 |
--------------------------------------------------------------------------------
/samples/sample-spring-boot-echo-kotlin/src/main/resources/application-template.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2018 LINE Corporation
3 | #
4 | # LINE Corporation licenses this file to you under the Apache License,
5 | # version 2.0 (the "License"); you may not use this file except in compliance
6 | # with the License. You may obtain a copy of the License at:
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations
14 | # under the License.
15 |
16 | This is a template for the configuration file.
17 | Make a copy called `application.yml` and change the values below.
18 |
19 | line.bot:
20 | channel-token: 'Put Your Channel Token Here.'
21 | channel-secret: 'Put Your Channel Secret Here.'
22 | handler.path: /callback
23 |
24 | # To remove Client wire logs. Please comment out following lines.
25 | # See: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html
26 | #
27 | #logging.level:
28 | # com.linecorp.bot.client.wire: INFO
29 |
--------------------------------------------------------------------------------
/samples/sample-spring-boot-kitchensink/src/main/resources/application-template.yml:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright 2016 LINE Corporation
3 | #
4 | # LINE Corporation licenses this file to you under the Apache License,
5 | # version 2.0 (the "License"); you may not use this file except in compliance
6 | # with the License. You may obtain a copy of the License at:
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | # License for the specific language governing permissions and limitations
14 | # under the License.
15 |
16 | This is a template for the configuration file.
17 | Make a copy called `application.yml` and change the values below.
18 |
19 | line.bot:
20 | channel-token: 'Put Your Channel Token Here.'
21 | channel-secret: 'Put Your Channel Secret Here.'
22 | handler.path: /callback
23 |
24 | # To remove Client wire logs. Please comment out following lines.
25 | # See: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html
26 | #
27 | #logging.level:
28 | # com.linecorp.bot.client.wire: INFO
29 |
--------------------------------------------------------------------------------
/clients/line-bot-module-client/src/main/java/com/linecorp/bot/module/client/LineModuleClientException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.module.client;
18 |
19 | import com.linecorp.bot.client.base.exception.AbstractLineClientException;
20 |
21 | import okhttp3.Response;
22 |
23 | /**
24 | * An API call exception for module API.
25 | */
26 | @SuppressWarnings("serial")
27 | public class LineModuleClientException extends AbstractLineClientException {
28 | public LineModuleClientException(Response response) {
29 | super(response, "An error occurred.");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/argument/LineBotDestinationArgumentResolver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.spring.boot.handler.argument;
18 |
19 | import com.linecorp.bot.webhook.model.Event;
20 |
21 | public class LineBotDestinationArgumentResolver implements ArgumentResolver {
22 | @Override
23 | public boolean isSupported(Event event) {
24 | return true;
25 | }
26 |
27 | @Override
28 | public Object resolve(String destination, Event event) {
29 | return destination;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/main/resources/templates/bot/info.ftlh:
--------------------------------------------------------------------------------
1 | <#-- @ftlvariable name="botInfo" type="com.linecorp.bot.messaging.model.BotInfoResponse" -->
2 | <#import "../__wrapper.ftlh" as wrapper>
3 | <@wrapper.main>
4 |
5 |
Bot information
6 |
7 |
8 |
9 |
userId
10 |
${botInfo.userId()}
11 |
12 |
13 |
basicId
14 |
${botInfo.basicId()}
15 |
16 |
17 |
premiumId
18 |
${botInfo.premiumId()!"-"}
19 |
20 |
21 |
displayName
22 |
${botInfo.displayName()}
23 |
24 |
25 |
pictureUrl
26 |
${botInfo.pictureUrl()}
27 |
28 |
29 |
30 |
chatMode
31 |
${botInfo.chatMode()}
32 |
33 |
34 |
markAsReadMode
35 |
${botInfo.markAsReadMode()}
36 |
37 |
38 |
39 | @wrapper.main>
40 |
--------------------------------------------------------------------------------
/samples/sample-spring-boot-echo/build.gradle.kts:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | plugins {
18 | id("sdk.java-library")
19 | id("sdk.spring-boot")
20 | }
21 |
22 | dependencies {
23 | implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES))
24 |
25 | implementation(project(":spring-boot:line-bot-spring-boot-handler"))
26 | implementation("org.springframework.boot:spring-boot-starter-web")
27 | implementation("org.springframework.boot:spring-boot-starter-actuator")
28 |
29 | testImplementation("org.springframework.boot:spring-boot-starter-test")
30 | }
31 |
--------------------------------------------------------------------------------
/samples/sample-manage-audience/src/main/resources/templates/manage_audience/add_audience.ftlh:
--------------------------------------------------------------------------------
1 | <#-- @ftlvariable name="audienceGroup" type="com.linecorp.bot.audience.model.GetAudienceDataResponse" -->
2 | <#-- @ftlvariable name="jobs" type="java.util.List" -->
3 | <#import "../__wrapper.ftlh" as wrapper>
4 | <@wrapper.main>
5 |
Add more audience into ${audienceGroup.description()}(ID: ${audienceGroup.audienceGroupId()})
6 |
7 |
19 |
20 | @wrapper.main>
21 |
--------------------------------------------------------------------------------
/clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/http/HttpMediaType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.client.base.http;
18 |
19 | import java.nio.charset.Charset;
20 |
21 | import okhttp3.MediaType;
22 |
23 | public class HttpMediaType {
24 | private final MediaType mediaType;
25 |
26 | public HttpMediaType(MediaType mediaType) {
27 | this.mediaType = mediaType;
28 | }
29 |
30 | public String type() {
31 | return this.mediaType.type();
32 | }
33 |
34 | public Charset charset() {
35 | return this.mediaType.charset();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/line-bot-integration-test/src/integrationTest/java/com/linecorp/bot/client/utils/ClientBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.client.utils;
18 |
19 | import java.net.URI;
20 |
21 | import com.linecorp.bot.client.base.ApiClientBuilder;
22 |
23 | public class ClientBuilder {
24 | public static T buildClient(IntegrationTestSettings settings, ApiClientBuilder builder) {
25 | return builder
26 | .apiEndPoint(URI.create(settings.apiEndpoint()))
27 | .failOnUnknownProperties(settings.failOnUnknownProperties())
28 | .build();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/clients/line-bot-module-attach-client/src/main/java/com/linecorp/bot/moduleattach/client/LineModuleAttachClientException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.moduleattach.client;
18 |
19 | import com.linecorp.bot.client.base.exception.AbstractLineClientException;
20 |
21 | import okhttp3.Response;
22 |
23 | /**
24 | * A general {@link Exception} for Module Attach API.
25 | */
26 | @SuppressWarnings("serial")
27 | public class LineModuleAttachClientException extends AbstractLineClientException {
28 | public LineModuleAttachClientException(Response response) {
29 | super(response, "");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/line-bot-webhook/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | # OpenAPI Generator Ignore
2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3 |
4 | # Use this file to prevent files from being overwritten by the generator.
5 | # The patterns follow closely to .gitignore or .dockerignore.
6 |
7 | # As an example, the C# client generator defines ApiClient.cs.
8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9 | #ApiClient.cs
10 |
11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12 | #foo/*/qux
13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14 |
15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16 | #foo/**/qux
17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18 |
19 | # You can also negate patterns with an exclamation (!).
20 | # For example, you can ignore all files in a docs folder with the file extension .md:
21 | #docs/*.md
22 | # Then explicitly reverse the ignore rule for a single file:
23 | #!docs/README.md
24 |
25 | src/main/java/com/linecorp/bot/webhook/client/DummyApi.java
26 | src/test/java/com/linecorp/bot/webhook/client/DummyApiTest.java
27 |
--------------------------------------------------------------------------------
/generator/src/main/resources/line-java-codegen/model/interface.pebble:
--------------------------------------------------------------------------------
1 | {# @pebvariable name="model" type="org.openapitools.codegen.CodegenModel" -#}
2 | /**
3 | * {{ model.description | escape }}{% if model.description == "" or model.description == null %}{{model.classname}}{% endif %}{% if model.isDeprecated %}
4 | * @deprecated{% endif %}
5 | */
6 | {%- if model.isDeprecated -%}
7 | @Deprecated
8 | {% endif %}
9 | @JsonSubTypes({
10 | {% for mm in model.discriminator.mappedModels %} @JsonSubTypes.Type(value = {{mm.modelName}}.class, name = "{{mm.mappingName}}"),
11 | {% endfor %}
12 | })
13 | @JsonTypeInfo(
14 | use = JsonTypeInfo.Id.NAME,
15 | include = JsonTypeInfo.As.PROPERTY,
16 | property = "{{model.discriminator.propertyName}}",
17 | defaultImpl = Unknown{{model.classname}}.class,
18 | visible = true
19 | )
20 | public interface {{model.classname}} {
21 | {% for var in model.vars -%}
22 | {% if model.discriminator.propertyName != var.name %}
23 | {% if var.description -%}
24 | /**
25 | * {{ var.description | escape }}
26 | */
27 | {% endif %}
28 | {{ var.dataType }} {{ var.name }}();
29 | {% endif %}
30 | {% endfor -%}
31 | {% if ["Source"] contains model.classname %}{% include "../body/model/" + model.classname + ".java" %}{% endif %}
32 | }
33 |
--------------------------------------------------------------------------------
/clients/line-liff-client/src/main/java/com/linecorp/bot/liff/client/LiffExceptionBuilder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2023 LINE Corporation
3 | *
4 | * LINE Corporation licenses this file to you under the Apache License,
5 | * version 2.0 (the "License"); you may not use this file except in compliance
6 | * with the License. You may obtain a copy of the License at:
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 | * License for the specific language governing permissions and limitations
14 | * under the License.
15 | */
16 |
17 | package com.linecorp.bot.liff.client;
18 |
19 | import java.io.IOException;
20 |
21 | import com.linecorp.bot.client.base.AbstractExceptionBuilder;
22 |
23 | import okhttp3.Response;
24 |
25 | public class LiffExceptionBuilder extends AbstractExceptionBuilder