├── system.properties ├── generator ├── .gitignore └── src │ └── main │ ├── resources │ ├── line-java-codegen │ │ ├── body │ │ │ ├── model │ │ │ │ ├── Source.java │ │ │ │ ├── TextMessage.java │ │ │ │ ├── FlexMessage.java │ │ │ │ ├── TemplateMessage.java │ │ │ │ ├── AudioMessage.java │ │ │ │ ├── StickerMessage.java │ │ │ │ ├── ImageMessage.java │ │ │ │ ├── LocationMessage.java │ │ │ │ ├── VideoMessage.java │ │ │ │ └── QuickReplyItem.java │ │ │ └── api │ │ │ │ └── LiffClient.java │ │ ├── macros │ │ │ ├── model_inner_enum.pebble │ │ │ └── api_param.pebble │ │ ├── licenseInfo.pebble │ │ ├── model │ │ │ ├── enum.pebble │ │ │ └── interface.pebble │ │ └── model.pebble │ └── META-INF │ │ └── services │ │ ├── org.openapitools.codegen.CodegenConfig │ │ └── org.openapitools.codegen.api.TemplatingEngineAdapter │ └── java │ └── com │ └── linecorp │ └── bot │ └── codegen │ └── pebble │ └── MyPebbleExtension.java ├── gradle.properties ├── line-bot-webhook ├── .openapi-generator │ └── VERSION ├── src │ ├── test │ │ └── resources │ │ │ └── callback │ │ │ ├── leave.json │ │ │ ├── unfollow.json │ │ │ ├── follow.json │ │ │ ├── join.json │ │ │ ├── unsend.json │ │ │ ├── video-play-complete.json │ │ │ ├── beacon.json │ │ │ ├── member_left.json │ │ │ ├── account_link.json │ │ │ ├── postback.json │ │ │ ├── text-user.json │ │ │ ├── text-group.json │ │ │ ├── beacon_with_dm.json │ │ │ ├── member_joined.json │ │ │ ├── file.json │ │ │ ├── sticker-keywords-remove.json │ │ │ ├── location.json │ │ │ ├── webhook-redelivery.json │ │ │ ├── sticker-keywords-array.json │ │ │ ├── image.json │ │ │ ├── sticker.json │ │ │ ├── video.json │ │ │ ├── text-emojis.json │ │ │ ├── sticker-with-text.json │ │ │ ├── unknown.json │ │ │ └── text-mention.json │ └── main │ │ └── java │ │ └── com │ │ └── linecorp │ │ └── bot │ │ └── webhook │ │ └── model │ │ ├── ReplyEvent.java │ │ ├── UnknownSource.java │ │ ├── UnknownModuleContent.java │ │ ├── UnknownMessageContent.java │ │ ├── UnknownMentionee.java │ │ ├── UnknownMembershipContent.java │ │ ├── ModuleContent.java │ │ └── EventMode.java ├── build.gradle.kts └── .openapi-generator-ignore ├── clients ├── line-liff-client │ ├── .openapi-generator │ │ ├── VERSION │ │ └── FILES │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── liff │ │ │ └── client │ │ │ ├── LiffClientException.java │ │ │ └── LiffExceptionBuilder.java │ ├── build.gradle.kts │ └── .openapi-generator-ignore ├── line-bot-insight-client │ ├── .openapi-generator │ │ ├── VERSION │ │ └── FILES │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── insight │ │ │ └── client │ │ │ └── InsightExceptionBuilder.java │ ├── build.gradle.kts │ └── .openapi-generator-ignore ├── line-bot-module-client │ ├── .openapi-generator │ │ ├── VERSION │ │ └── FILES │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── module │ │ │ └── client │ │ │ ├── LineModuleClientException.java │ │ │ └── LineModuleExceptionBuilder.java │ ├── build.gradle.kts │ └── .openapi-generator-ignore ├── line-bot-shop-client │ ├── .openapi-generator │ │ ├── VERSION │ │ └── FILES │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── shop │ │ │ └── client │ │ │ ├── ShopExceptionBuilder.java │ │ │ └── ShopClientException.java │ ├── build.gradle.kts │ └── .openapi-generator-ignore ├── line-bot-manage-audience-client │ ├── .openapi-generator │ │ └── VERSION │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── audience │ │ │ ├── client │ │ │ └── ManageAudienceExceptionBuilder.java │ │ │ └── model │ │ │ └── AudienceGroupJobType.java │ ├── build.gradle.kts │ └── .openapi-generator-ignore ├── line-bot-messaging-api-client │ ├── .openapi-generator │ │ └── VERSION │ ├── src │ │ ├── test │ │ │ ├── resources │ │ │ │ ├── flex │ │ │ │ │ └── reconstruction │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ ├── VideoContent.json │ │ │ │ │ │ └── LinearGradient.json │ │ │ │ └── logback-test.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── linecorp │ │ │ │ └── bot │ │ │ │ └── messaging │ │ │ │ └── model │ │ │ │ └── TextMessageTest.java │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── messaging │ │ │ ├── model │ │ │ ├── UnknownRecipient.java │ │ │ ├── UnknownTemplate.java │ │ │ ├── UnknownAction.java │ │ │ ├── UnknownFlexComponent.java │ │ │ ├── UnknownFlexContainer.java │ │ │ ├── UnknownDemographicFilter.java │ │ │ ├── UnknownFlexBoxBackground.java │ │ │ ├── UnknownMessage.java │ │ │ ├── UnknownImagemapAction.java │ │ │ ├── UnknownRichMenuBatchOperation.java │ │ │ ├── UnknownMentionTarget.java │ │ │ ├── FlexBoxBackground.java │ │ │ ├── UnknownSubstitutionObject.java │ │ │ ├── UnknownCouponRewardRequest.java │ │ │ ├── FlexContainer.java │ │ │ ├── UnknownCouponRewardResponse.java │ │ │ ├── MentionTarget.java │ │ │ ├── UnknownCashBackPriceInfoRequest.java │ │ │ ├── UnknownDiscountPriceInfoRequest.java │ │ │ ├── UnknownCashBackPriceInfoResponse.java │ │ │ ├── UnknownDiscountPriceInfoResponse.java │ │ │ ├── UnknownAcquisitionConditionRequest.java │ │ │ └── UnknownAcquisitionConditionResponse.java │ │ │ └── client │ │ │ └── MessagingApiExceptionBuilder.java │ ├── build.gradle.kts │ └── .openapi-generator-ignore ├── line-bot-module-attach-client │ ├── .openapi-generator │ │ ├── VERSION │ │ └── FILES │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── moduleattach │ │ │ └── client │ │ │ ├── LineModuleAttachClientException.java │ │ │ └── LineModuleAttachExceptionBuilder.java │ ├── build.gradle.kts │ └── .openapi-generator-ignore ├── line-channel-access-token-client │ ├── .openapi-generator │ │ ├── VERSION │ │ └── FILES │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── logback-test.xml │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── oauth │ │ │ └── client │ │ │ └── ChannelAccessTokenExceptionBuilder.java │ ├── build.gradle.kts │ └── .openapi-generator-ignore └── line-bot-client-base │ ├── src │ ├── test │ │ ├── resources │ │ │ └── logback-test.xml │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── client │ │ │ └── base │ │ │ └── channel │ │ │ └── FixedChannelTokenSupplierTest.java │ └── main │ │ └── java │ │ └── com │ │ └── linecorp │ │ └── bot │ │ └── client │ │ └── base │ │ ├── http │ │ ├── HttpAuthenticator.java │ │ ├── HttpInterceptor.java │ │ ├── HttpMediaType.java │ │ ├── HttpChain.java │ │ └── HttpResponseBody.java │ │ ├── ExceptionBuilder.java │ │ ├── Result.java │ │ ├── channel │ │ └── ChannelTokenSupplier.java │ │ └── LineClientJsonParseException.java │ └── build.gradle.kts ├── samples ├── sample-manage-audience │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── .gitignore │ │ │ └── templates │ │ │ │ ├── index.ftlh │ │ │ │ ├── message │ │ │ │ ├── broadcast │ │ │ │ │ ├── form.ftlh │ │ │ │ │ └── result.ftlh │ │ │ │ ├── push │ │ │ │ │ ├── result.ftlh │ │ │ │ │ └── form.ftlh │ │ │ │ ├── multicast │ │ │ │ │ ├── result.ftlh │ │ │ │ │ └── form.ftlh │ │ │ │ ├── __retargeting.ftlh │ │ │ │ ├── report │ │ │ │ │ └── quota.ftlh │ │ │ │ └── __message_form.ftlh │ │ │ │ ├── error.ftlh │ │ │ │ ├── manage_audience │ │ │ │ ├── update_description.ftlh │ │ │ │ ├── click.ftlh │ │ │ │ ├── imp.ftlh │ │ │ │ ├── add_audience.ftlh │ │ │ │ └── add_audience_by_file.ftlh │ │ │ │ └── bot │ │ │ │ ├── test_webhook.ftlh │ │ │ │ └── info.ftlh │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── messagingapidemoapp │ │ │ ├── controller │ │ │ └── RootController.java │ │ │ └── SampleManageAudienceApplication.java │ │ └── test │ │ └── java │ │ └── com │ │ └── linecorp │ │ └── bot │ │ └── messagingapidemoapp │ │ └── SampleManageAudienceApplicationTests.java ├── sample-spring-boot-echo │ ├── _assets │ │ ├── heroku.png │ │ ├── heroku-app-name.png │ │ ├── put-webhook-url.png │ │ └── line-bot-configuration.png │ ├── src │ │ ├── test │ │ │ └── resources │ │ │ │ └── application-test.yml │ │ └── main │ │ │ └── resources │ │ │ └── application-template.yml │ ├── README.md │ └── build.gradle.kts ├── sample-spring-boot-kitchensink │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── static │ │ │ │ │ ├── rich │ │ │ │ │ │ ├── 240 │ │ │ │ │ │ ├── 300 │ │ │ │ │ │ ├── 460 │ │ │ │ │ │ ├── 700 │ │ │ │ │ │ └── 1040 │ │ │ │ │ ├── icon │ │ │ │ │ │ └── cat.png │ │ │ │ │ ├── buttons │ │ │ │ │ │ └── 1040.jpg │ │ │ │ │ └── imagemap_video │ │ │ │ │ │ ├── 240 │ │ │ │ │ │ ├── 300 │ │ │ │ │ │ ├── 460 │ │ │ │ │ │ ├── 700 │ │ │ │ │ │ ├── 1040 │ │ │ │ │ │ ├── previewImage.jpg │ │ │ │ │ │ └── originalContent.mp4 │ │ │ │ └── application-template.yml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── bot │ │ │ │ └── spring │ │ │ │ └── KitchenSinkApplication.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── bot │ │ │ └── spring │ │ │ └── ExampleFlexMessageSupplierTest.java │ ├── README.md │ └── build.gradle.kts └── sample-spring-boot-echo-kotlin │ ├── README.md │ ├── src │ └── main │ │ └── resources │ │ └── application-template.yml │ └── build.gradle.kts ├── .gitmodules ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── codeStyles │ └── codeStyleConfig.xml └── copyright │ ├── profiles_settings.xml │ └── LINE.xml ├── spring-boot ├── line-bot-spring-boot-client │ └── src │ │ └── main │ │ └── resources │ │ └── META-INF │ │ └── spring │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports ├── line-bot-spring-boot-webmvc │ ├── src │ │ ├── main │ │ │ └── resources │ │ │ │ └── META-INF │ │ │ │ └── spring │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── test │ │ │ └── resources │ │ │ ├── logback-test.xml │ │ │ ├── callback-request-with-destination.json │ │ │ └── callback-request.json │ └── build.gradle.kts ├── line-bot-spring-boot-handler │ └── src │ │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── spring │ │ │ │ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports │ │ └── java │ │ │ └── com │ │ │ └── linecorp │ │ │ └── bot │ │ │ └── spring │ │ │ └── boot │ │ │ └── handler │ │ │ ├── argument │ │ │ ├── ArgumentResolver.java │ │ │ ├── LineBotDestinationArgumentResolver.java │ │ │ └── EventArgumentResolver.java │ │ │ ├── configuration │ │ │ └── LineBotHandlerConfiguration.java │ │ │ └── annotation │ │ │ └── LineMessageHandler.java │ │ └── test │ │ └── resources │ │ ├── logback-test.xml │ │ └── callback-request-with-destination.json └── line-bot-spring-boot-web │ └── src │ └── main │ └── java │ └── com │ └── linecorp │ └── bot │ └── spring │ └── boot │ └── web │ └── argument │ └── annotation │ ├── LineBotMessages.java │ └── LineBotDestination.java ├── .editorconfig ├── .github ├── dependabot.yml ├── release.yml ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── workflows │ ├── label-issue.yml │ ├── pom-validation.yml │ ├── close-issue.yml │ └── check-eol-newrelease.yml ├── line-bot-integration-test ├── README.md └── src │ └── integrationTest │ └── java │ └── com │ └── linecorp │ └── bot │ └── client │ └── utils │ └── ClientBuilder.java ├── line-bot-parser ├── src │ ├── test │ │ └── resources │ │ │ └── callback-request.json │ └── main │ │ └── java │ │ └── com │ │ └── linecorp │ │ └── bot │ │ └── parser │ │ ├── SignatureValidator.java │ │ ├── WebhookParseException.java │ │ ├── SkipSignatureVerificationSupplier.java │ │ └── FixedSkipSignatureVerificationSupplier.java └── build.gradle.kts ├── line-bot-jackson └── build.gradle.kts ├── .gitignore └── renovate.json5 /system.properties: -------------------------------------------------------------------------------- 1 | java.runtime.version=1.8 2 | -------------------------------------------------------------------------------- /generator/.gitignore: -------------------------------------------------------------------------------- 1 | /dependency-reduced-pom.xml 2 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.warning.mode=all 2 | -------------------------------------------------------------------------------- /line-bot-webhook/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /clients/line-liff-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /clients/line-bot-insight-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /clients/line-bot-module-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /clients/line-bot-shop-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /clients/line-bot-manage-audience-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /clients/line-bot-module-attach-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /clients/line-channel-access-token-client/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | unset 2 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/.gitignore: -------------------------------------------------------------------------------- 1 | /application.yml 2 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/Source.java: -------------------------------------------------------------------------------- 1 | String userId(); 2 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "line-openapi"] 2 | path = line-openapi 3 | url = https://github.com/line/line-openapi.git 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /generator/src/main/resources/META-INF/services/org.openapitools.codegen.CodegenConfig: -------------------------------------------------------------------------------- 1 | com.linecorp.bot.codegen.LineJavaCodegenGenerator 2 | -------------------------------------------------------------------------------- /generator/src/main/resources/META-INF/services/org.openapitools.codegen.api.TemplatingEngineAdapter: -------------------------------------------------------------------------------- 1 | com.linecorp.bot.codegen.pebble.PebbleTemplateAdapter 2 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-echo/_assets/heroku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-echo/_assets/heroku.png -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/TextMessage.java: -------------------------------------------------------------------------------- 1 | public TextMessage(String text) { 2 | this(null, null, text, null, null); 3 | } 4 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-echo/_assets/heroku-app-name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-echo/_assets/heroku-app-name.png -------------------------------------------------------------------------------- /samples/sample-spring-boot-echo/_assets/put-webhook-url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-echo/_assets/put-webhook-url.png -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/FlexMessage.java: -------------------------------------------------------------------------------- 1 | public FlexMessage(String altText, FlexContainer contents) { 2 | this(null, null, altText, contents); 3 | } 4 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/TemplateMessage.java: -------------------------------------------------------------------------------- 1 | public TemplateMessage(String altText, Template template) { 2 | this(null, null, altText, template); 3 | } 4 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-echo/_assets/line-bot-configuration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-echo/_assets/line-bot-configuration.png -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/AudioMessage.java: -------------------------------------------------------------------------------- 1 | public AudioMessage(URI originalContentUrl, Long duration) { 2 | this(null, null, originalContentUrl, duration); 3 | } 4 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/StickerMessage.java: -------------------------------------------------------------------------------- 1 | public StickerMessage(String packageId, String stickerId) { 2 | this(null, null, packageId, stickerId, null); 3 | } 4 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-echo/src/test/resources/application-test.yml: -------------------------------------------------------------------------------- 1 | line.bot: 2 | channelToken: 'test-channel-token' 3 | channelSecret: 'test-channel-secret' 4 | handler.path: /callback 5 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/1040: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/1040 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/240: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/240 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/300: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/300 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/460: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/460 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/700: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/rich/700 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/icon/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/icon/cat.png -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/test/resources/flex/reconstruction/README.md: -------------------------------------------------------------------------------- 1 | Flex reconstruction test resource 2 | ==== 3 | 4 | json files in this directly are used to json deserialize & serialize test. 5 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/ImageMessage.java: -------------------------------------------------------------------------------- 1 | public ImageMessage(URI originalContentUrl, URI previewImageUrl) { 2 | this(null, null, originalContentUrl, previewImageUrl); 3 | } 4 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-client/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.linecorp.bot.spring.boot.core.configuration.LineBotAutoConfiguration 2 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-webmvc/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.linecorp.bot.spring.boot.webmvc.configuration.LineBotWebMvcConfigurer 2 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/buttons/1040.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/buttons/1040.jpg -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-handler/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports: -------------------------------------------------------------------------------- 1 | com.linecorp.bot.spring.boot.handler.configuration.LineBotHandlerConfiguration 2 | -------------------------------------------------------------------------------- /clients/line-bot-module-attach-client/.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | src/main/java/com/linecorp/bot/moduleattach/client/LineModuleAttachClient.java 2 | src/main/java/com/linecorp/bot/moduleattach/model/AttachModuleResponse.java 3 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/1040: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/1040 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/240: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/240 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/300: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/300 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/460: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/460 -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/700: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/700 -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/LocationMessage.java: -------------------------------------------------------------------------------- 1 | public LocationMessage(String title, String address, Double latitude, Double longitude) { 2 | this(null, null, title, address, latitude, longitude); 3 | } 4 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/VideoMessage.java: -------------------------------------------------------------------------------- 1 | public VideoMessage(URI originalContentUrl, URI previewImageUrl, String trackingId) { 2 | this(null, null, originalContentUrl, previewImageUrl, trackingId); 3 | } 4 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/previewImage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/previewImage.jpg -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /clients/line-bot-shop-client/.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | src/main/java/com/linecorp/bot/shop/client/ShopClient.java 2 | src/main/java/com/linecorp/bot/shop/model/ErrorResponse.java 3 | src/main/java/com/linecorp/bot/shop/model/MissionStickerRequest.java 4 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/originalContent.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/line/line-bot-sdk-java/HEAD/samples/sample-spring-boot-kitchensink/src/main/resources/static/imagemap_video/originalContent.mp4 -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/index.ftlh: -------------------------------------------------------------------------------- 1 | <#-- @ftlvariable name="totalUsage" type="java.lang.Long" --> 2 | <#import "__wrapper.ftlh" as wrapper> 3 | <@wrapper.main> 4 | 5 |

Messaging API

6 | 7 | 8 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/model/QuickReplyItem.java: -------------------------------------------------------------------------------- 1 | public QuickReplyItem(Action action) { 2 | this(null, action, "action"); 3 | } 4 | public QuickReplyItem(URI imageUrl, Action action) { 5 | this(imageUrl, action, "action"); 6 | } 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/message/broadcast/form.ftlh: -------------------------------------------------------------------------------- 1 | <#import "../../__wrapper.ftlh" as wrapper> 2 | <@wrapper.main> 3 |

Send broadcast message

4 | 5 |
6 | <#include "../__message_form.ftlh"> 7 |
8 | 9 | 10 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/message/push/result.ftlh: -------------------------------------------------------------------------------- 1 | <#-- @ftlvariable name="requestId" type="java.lang.String" --> 2 | <#import "../../__wrapper.ftlh" as wrapper> 3 | <@wrapper.main> 4 |

Push result

5 | 6 |

Sent message: ${requestId}

7 | 8 | <#include "../__retargeting.ftlh"> 9 | 10 | 11 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/message/broadcast/result.ftlh: -------------------------------------------------------------------------------- 1 | <#-- @ftlvariable name="requestId" type="java.lang.String" --> 2 | <#import "../../__wrapper.ftlh" as wrapper> 3 | <@wrapper.main> 4 |

Broadcast result

5 | 6 |

Sent message: ${requestId}

7 | 8 | <#include "../__retargeting.ftlh"> 9 | 10 | 11 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/message/multicast/result.ftlh: -------------------------------------------------------------------------------- 1 | <#-- @ftlvariable name="requestId" type="java.lang.String" --> 2 | <#import "../../__wrapper.ftlh" as wrapper> 3 | <@wrapper.main> 4 |

Multicast result

5 | 6 |

Sent message: ${requestId}

7 | 8 | <#include "../__retargeting.ftlh"> 9 | 10 | 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root=true 2 | 3 | [*] 4 | charset=utf-8 5 | end_of_line=lf 6 | insert_final_newline=true 7 | trim_trailing_whitespace=true 8 | indent_style=space 9 | indent_size=4 10 | 11 | [*.java] 12 | continuation_indent_size=8 13 | wildcard_import_limit=0 14 | 15 | [*.{yaml,yml}] 16 | indent_size=2 17 | 18 | [*.json] 19 | indent_size=2 20 | 21 | [*.xml] 22 | indent_size=2 23 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/leave.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "type": "leave", 6 | "timestamp": 1462629479859, 7 | "mode": "active", 8 | "source": { 9 | "type": "group", 10 | "groupId": "cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/unfollow.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "type": "unfollow", 6 | "timestamp": 1462629479859, 7 | "mode": "active", 8 | "source": { 9 | "type": "user", 10 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8" 11 | } 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /clients/line-bot-module-client/.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | src/main/java/com/linecorp/bot/module/client/LineModuleClient.java 2 | src/main/java/com/linecorp/bot/module/model/AcquireChatControlRequest.java 3 | src/main/java/com/linecorp/bot/module/model/DetachModuleRequest.java 4 | src/main/java/com/linecorp/bot/module/model/GetModulesResponse.java 5 | src/main/java/com/linecorp/bot/module/model/ModuleBot.java 6 | -------------------------------------------------------------------------------- /clients/line-liff-client/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /clients/line-bot-client-base/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /clients/line-bot-module-client/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /clients/line-bot-shop-client/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /clients/line-bot-insight-client/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /clients/line-bot-manage-audience-client/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /clients/line-bot-module-attach-client/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /clients/line-channel-access-token-client/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-handler/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-webmvc/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/message/__retargeting.ftlh: -------------------------------------------------------------------------------- 1 | <#-- @ftlvariable name="requestId" type="java.lang.String" --> 2 |
3 | Create imp based audience 4 | group 5 | Create click based 6 | audience 7 | group 8 |
9 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/follow.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "follow", 7 | "timestamp": 1462629479859, 8 | "mode": "active", 9 | "source": { 10 | "type": "user", 11 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/join.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "join", 7 | "timestamp": 1462629479859, 8 | "mode": "active", 9 | "source": { 10 | "type": "group", 11 | "groupId": "cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 12 | } 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/unsend.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "type": "unsend", 6 | "timestamp": 1462629479859, 7 | "mode": "active", 8 | "source": { 9 | "type": "user", 10 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8" 11 | }, 12 | "unsend": { 13 | "messageId": "325708" 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: gradle 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "20:00" 8 | open-pull-requests-limit: 10 9 | ignore: 10 | - dependency-name: org.springframework.boot:spring-boot-gradle-plugin 11 | versions: 12 | - 2.4.2 13 | - 2.4.3 14 | - 2.4.4 15 | - dependency-name: gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin 16 | versions: 17 | - 4.6.1 18 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/video-play-complete.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "videoPlayComplete", 7 | "timestamp": 1462629479859, 8 | "mode": "active", 9 | "source": { 10 | "type": "user", 11 | "userId": "U4af4980629..." 12 | }, 13 | "videoPlayComplete": { 14 | "trackingId": "track_id" 15 | } 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/beacon.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "beacon", 7 | "timestamp": 1462629479859, 8 | "mode": "active", 9 | "source": { 10 | "type": "user", 11 | "userId": "U012345678901234567890123456789ab" 12 | }, 13 | "beacon": { 14 | "hwid": "374591320", 15 | "type": "enter" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/test/resources/flex/reconstruction/VideoContent.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "bubble", 3 | "size": "kilo", 4 | "hero": { 5 | "type": "video", 6 | "url": "https://example.com/video.mp4", 7 | "previewUrl": "https://example.com/video_preview.jpg", 8 | "altContent": { 9 | "type": "image", 10 | "size": "full", 11 | "aspectRatio": "20:13", 12 | "aspectMode": "cover", 13 | "url": "https://example.com/image.jpg" 14 | }, 15 | "aspectRatio": "20:13" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/error.ftlh: -------------------------------------------------------------------------------- 1 | <#-- @ftlvariable name="totalUsage" type="java.lang.Long" --> 2 | <#import "__wrapper.ftlh" as wrapper> 3 | <@wrapper.main> 4 | 5 |

ERRRORRRR

6 | 7 |
status: ${status!"-"}
8 |
error: ${error!"-"}
9 |
exception: ${exception!"-"}
10 |
message: ${message!"-"}
11 |
errors: ${errors!"-"}
12 |
trace: ${trace!"-"}
13 |
path: ${path!"-"}
14 | 15 | 16 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/member_left.json: -------------------------------------------------------------------------------- 1 | { 2 | "events": [ 3 | { 4 | "type": "memberLeft", 5 | "source": { 6 | "groupId": "C1234567890", 7 | "type": "group" 8 | }, 9 | "timestamp": 1553506027708, 10 | "mode": "active", 11 | "left": { 12 | "members": [ 13 | { 14 | "userId": "U111111", 15 | "type": "user" 16 | } 17 | ] 18 | } 19 | } 20 | ], 21 | "destination": "Uab012345678901234567890123456789" 22 | } 23 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/account_link.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "accountLink", 7 | "timestamp": 1462629479859, 8 | "mode": "active", 9 | "source": { 10 | "type": "user", 11 | "userId": "U012345678901234567890123456789ab" 12 | }, 13 | "link": { 14 | "result": "ok", 15 | "nonce": "xxxxxxxxxxxxxxx" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/postback.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "postback", 7 | "timestamp": 1462629479859, 8 | "mode": "active", 9 | "source": { 10 | "type": "user", 11 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8" 12 | }, 13 | "postback": { 14 | "data": "action=buyItem&itemId=123123&color=red", 15 | "params": { } 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/text-user.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" 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/text-group.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "message", 7 | "timestamp": 1462629479859, 8 | "mode": "standby", 9 | "source": { 10 | "type": "group", 11 | "groupId": "u206d25c2ea6bd87c17655609a1c37cb8" 12 | }, 13 | "message": { 14 | "id": "325708", 15 | "type": "text", 16 | "text": "Hello, world" 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/beacon_with_dm.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "type": "beacon", 6 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 7 | "source": { 8 | "userId": "U012345678901234567890123456789ab", 9 | "type": "user" 10 | }, 11 | "timestamp": 1492992000000, 12 | "mode": "active", 13 | "beacon": { 14 | "hwid": "374591320", 15 | "dm": "1234567890abcdef", 16 | "type": "enter" 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /line-bot-integration-test/README.md: -------------------------------------------------------------------------------- 1 | # line-bot-integration-test 2 | 3 | Integration test for `LINE Bot SDK for Java`. 4 | 5 | ## How do I run this component? 6 | 7 | By default, the integration test suite does nothing. You need to put the configuration file to run the integration test. 8 | If you want to run this test suite, put `src/test/resources/integration_test_settings.yml`. 9 | 10 | The YAML file is mapped to `com.linecorp.bot.client.utils.IntegrationTestSettings`. 11 | 12 | (It's bit hard to run all test cases since some test cases depend on the number of the targeted reaches). 13 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/member_joined.json: -------------------------------------------------------------------------------- 1 | { 2 | "events": [ 3 | { 4 | "type": "memberJoined", 5 | "replyToken": "REPLYTOKEN12345", 6 | "source": { 7 | "groupId": "C1234567890", 8 | "type": "group" 9 | }, 10 | "timestamp": 1553506027708, 11 | "mode": "active", 12 | "joined": { 13 | "members": [ 14 | { 15 | "userId": "U111111", 16 | "type": "user" 17 | } 18 | ] 19 | } 20 | } 21 | ], 22 | "destination": "Uab012345678901234567890123456789" 23 | } 24 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-webmvc/src/test/resources/callback-request-with-destination.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "U11111111111111111111111111111111", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "message", 7 | "timestamp": 1462629479859, 8 | "source": { 9 | "type": "user", 10 | "userId": "U206d25c2ea6bd87c17655609a1c37cb8" 11 | }, 12 | "message": { 13 | "id": "325708", 14 | "type": "text", 15 | "text": "Hello, world! with destination" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/file.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": "file", 16 | "fileName": "sample.pdf", 17 | "fileSize": 22016 18 | } 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-handler/src/test/resources/callback-request-with-destination.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "U11111111111111111111111111111111", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "message", 7 | "timestamp": 1462629479859, 8 | "source": { 9 | "type": "user", 10 | "userId": "U206d25c2ea6bd87c17655609a1c37cb8" 11 | }, 12 | "message": { 13 | "id": "325708", 14 | "type": "text", 15 | "text": "Hello, world! with destination" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/message/push/form.ftlh: -------------------------------------------------------------------------------- 1 | <#import "../../__wrapper.ftlh" as wrapper> 2 | <@wrapper.main> 3 |

Send push message

4 | 5 |
6 |
7 | 8 | 9 | The destination userID. 10 |
11 | <#include "../__message_form.ftlh"> 12 |
13 | 14 | 15 | -------------------------------------------------------------------------------- /clients/line-channel-access-token-client/.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | src/main/java/com/linecorp/bot/oauth/client/ChannelAccessTokenClient.java 2 | src/main/java/com/linecorp/bot/oauth/model/ChannelAccessTokenKeyIdsResponse.java 3 | src/main/java/com/linecorp/bot/oauth/model/ErrorResponse.java 4 | src/main/java/com/linecorp/bot/oauth/model/IssueChannelAccessTokenResponse.java 5 | src/main/java/com/linecorp/bot/oauth/model/IssueShortLivedChannelAccessTokenResponse.java 6 | src/main/java/com/linecorp/bot/oauth/model/IssueStatelessChannelAccessTokenResponse.java 7 | src/main/java/com/linecorp/bot/oauth/model/VerifyChannelAccessTokenResponse.java 8 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/macros/model_inner_enum.pebble: -------------------------------------------------------------------------------- 1 | {%- macro model_inner_enum(var) -%} 2 | {# @pebvariable name="var" type="org.openapitools.codegen.CodegenProperty" -#} 3 | /** 4 | * {{ var.description | escape }}{% if not var.description%}Gets or Sets {{var.name}}{% endif %} 5 | */ 6 | public enum {{var.datatypeWithEnum}} { 7 | {% if var.allowableValues != null -%} 8 | {% for enum in var.allowableValues.get("enumVars") -%} 9 | @JsonProperty({{ enum.value }}) 10 | {{enum.name}}, 11 | {% endfor %} 12 | {% endif %} 13 | @JsonEnumDefaultValue 14 | UNDEFINED; 15 | } 16 | {% endmacro -%} 17 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/sticker-keywords-remove.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": "sticker", 16 | "packageId": "1", 17 | "stickerId": "1", 18 | "stickerResourceType": "STATIC" 19 | } 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes 2 | changelog: 3 | categories: 4 | - title: Breaking Changes 5 | labels: 6 | - breaking-change 7 | - title: line-openapi updates 8 | labels: 9 | - line-openapi-update 10 | - title: New Features 11 | labels: 12 | - new-features 13 | - title: Bug fix 14 | labels: 15 | - bug-fix 16 | - title: Dependency updates 17 | labels: 18 | - dependency upgrade 19 | exclude: 20 | labels: 21 | - line-openapi-update 22 | - title: Other Changes 23 | labels: 24 | - "*" 25 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/location.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": "location", 16 | "title": "hello", 17 | "address": "〒150-0002 東京都渋谷区渋谷2丁目21−1", 18 | "latitude": 35.65910807942215, 19 | "longitude": 139.70372892916203 20 | } 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/webhook-redelivery.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" 17 | }, 18 | "webhookEventId": "01G2KZKG2DS765NMRH3GZFD8AP", 19 | "deliveryContext": { 20 | "isRedelivery": true 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/message/multicast/form.ftlh: -------------------------------------------------------------------------------- 1 | <#import "../../__wrapper.ftlh" as wrapper> 2 | <@wrapper.main> 3 |

Send push message

4 | 5 |
6 |
7 | 8 | 9 | The destination userID. Split with new line. Max: 10 | 150 user IDs 11 | 12 |
13 | <#include "../__message_form.ftlh"> 14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/sticker-keywords-array.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": "sticker", 16 | "packageId": "1", 17 | "stickerId": "1", 18 | "stickerResourceType": "STATIC", 19 | "keywords": [ 20 | "keyword" 21 | ] 22 | } 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/message/report/quota.ftlh: -------------------------------------------------------------------------------- 1 | <#-- @ftlvariable name="totalUsage" type="java.lang.Long" --> 2 | <#-- @ftlvariable name="quota" type="com.linecorp.bot.messaging.model.MessageQuotaResponse" --> 3 | <#import "../../__wrapper.ftlh" as wrapper> 4 | <@wrapper.main> 5 | 6 |

The target limit for additional messages

7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
Type${quota.type()}
Value${quota.value()}
17 | 18 |

The number of messages sent this month

19 | ${totalUsage} 20 | 21 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/image.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": "image", 16 | "contentProvider": { 17 | "type": "external", 18 | "originalContentUrl": "https://example.com/original.jpg", 19 | "previewImageUrl": "https://example.com/preview.jpg" 20 | } 21 | } 22 | } 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/sticker.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": "sticker", 16 | "packageId": "1", 17 | "stickerId": "1", 18 | "stickerResourceType": "STATIC", 19 | "keywords": [ 20 | "bed", 21 | "sleep", 22 | "bedtime" 23 | ] 24 | } 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /clients/line-liff-client/.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | src/main/java/com/linecorp/bot/liff/client/LiffClient.java 2 | src/main/java/com/linecorp/bot/liff/model/AddLiffAppRequest.java 3 | src/main/java/com/linecorp/bot/liff/model/AddLiffAppResponse.java 4 | src/main/java/com/linecorp/bot/liff/model/GetAllLiffAppsResponse.java 5 | src/main/java/com/linecorp/bot/liff/model/LiffApp.java 6 | src/main/java/com/linecorp/bot/liff/model/LiffBotPrompt.java 7 | src/main/java/com/linecorp/bot/liff/model/LiffFeatures.java 8 | src/main/java/com/linecorp/bot/liff/model/LiffScope.java 9 | src/main/java/com/linecorp/bot/liff/model/LiffView.java 10 | src/main/java/com/linecorp/bot/liff/model/UpdateLiffAppRequest.java 11 | src/main/java/com/linecorp/bot/liff/model/UpdateLiffView.java 12 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/video.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "message", 7 | "mode": "active", 8 | "timestamp": 1462629479859, 9 | "source": { 10 | "type": "user", 11 | "userId": "U4af4980629..." 12 | }, 13 | "message": { 14 | "id": "325708", 15 | "type": "video", 16 | "duration": 60000, 17 | "contentProvider": { 18 | "type": "external", 19 | "originalContentUrl": "https://example.com/original.mp4", 20 | "previewImageUrl": "https://example.com/preview.jpg" 21 | } 22 | } 23 | } 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-webmvc/src/test/resources/callback-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "events": [ 3 | { 4 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 5 | "type": "message", 6 | "timestamp": 1462629479859, 7 | "source": { 8 | "type": "user", 9 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8" 10 | }, 11 | "message": { 12 | "id": "325708", 13 | "type": "text", 14 | "text": "Hello, world" 15 | } 16 | }, 17 | { 18 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 19 | "type": "follow", 20 | "timestamp": 1462629479859, 21 | "source": { 22 | "type": "user", 23 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8" 24 | } 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/text-emojis.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", 17 | "emojis": [ 18 | { 19 | "index": 14, 20 | "length": 6, 21 | "productId": "5ac1bfd5040ab15980c9b435", 22 | "emojiId": "001" 23 | } 24 | ] 25 | } 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/sticker-with-text.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": "sticker", 16 | "packageId": "1", 17 | "stickerId": "1", 18 | "stickerResourceType": "MESSAGE", 19 | "keywords": [ 20 | "bed", 21 | "sleep", 22 | "bedtime" 23 | ], 24 | "text": "userEnteredText" 25 | } 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/body/api/LiffClient.java: -------------------------------------------------------------------------------- 1 | @Deprecated 2 | default CompletableFuture> liffV1AppsGet() { 3 | return getAllLIFFApps(); 4 | } 5 | 6 | @Deprecated 7 | default CompletableFuture> liffV1AppsLiffIdDelete(@Path("liffId") String liffId) { 8 | return deleteLIFFApp(liffId); 9 | } 10 | 11 | @Deprecated 12 | default CompletableFuture> liffV1AppsLiffIdPut( 13 | @Path("liffId") String liffId, 14 | @Body UpdateLiffAppRequest updateLiffAppRequest) { 15 | return updateLIFFApp(liffId, updateLiffAppRequest); 16 | } 17 | 18 | @Deprecated 19 | default CompletableFuture> liffV1AppsPost(@Body AddLiffAppRequest addLiffAppRequest) { 20 | return addLIFFApp(addLiffAppRequest); 21 | } 22 | -------------------------------------------------------------------------------- /clients/line-bot-insight-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 | -------------------------------------------------------------------------------- /clients/line-bot-shop-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 | -------------------------------------------------------------------------------- /line-bot-parser/src/test/resources/callback-request.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "U00000000000000000000000000000000", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "message", 7 | "timestamp": 1462629479859, 8 | "source": { 9 | "type": "user", 10 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8" 11 | }, 12 | "message": { 13 | "id": "325708", 14 | "type": "text", 15 | "text": "Hello, world" 16 | } 17 | }, 18 | { 19 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 20 | "type": "follow", 21 | "timestamp": 1462629479859, 22 | "source": { 23 | "type": "user", 24 | "userId": "u206d25c2ea6bd87c17655609a1c37cb8" 25 | } 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /clients/line-bot-module-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 | -------------------------------------------------------------------------------- /clients/line-liff-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 | 18 | plugins { 19 | id("sdk.openapi") 20 | id("sdk.publish") 21 | } 22 | 23 | -------------------------------------------------------------------------------- /clients/line-bot-module-attach-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 | 18 | plugins { 19 | id("sdk.openapi") 20 | id("sdk.publish") 21 | } 22 | 23 | -------------------------------------------------------------------------------- /clients/line-channel-access-token-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 | -------------------------------------------------------------------------------- /clients/line-bot-manage-audience-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 | 18 | plugins { 19 | id("sdk.openapi") 20 | id("sdk.publish") 21 | } 22 | 23 | -------------------------------------------------------------------------------- /.idea/copyright/LINE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /line-bot-webhook/src/test/resources/callback/unknown.json: -------------------------------------------------------------------------------- 1 | { 2 | "destination": "Uab012345678901234567890123456789", 3 | "events": [ 4 | { 5 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 6 | "type": "greatNewFeature", 7 | "timestamp": 1462629479859, 8 | "mode": "active", 9 | "source": { 10 | "type": "user", 11 | "userId": "U012345678901234567890123456789ab" 12 | } 13 | }, 14 | { 15 | "replyToken": "nHuyWiB7yP5Zw52FIkcQobQuGDXCTA", 16 | "type": "message", 17 | "timestamp": 1462629479859, 18 | "mode": "active", 19 | "source": { 20 | "type": "unknownunknownuknown" 21 | }, 22 | "message": { 23 | "id": "325708", 24 | "type": "unknownunknownuknown", 25 | "unknown": "blah blah" 26 | } 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/test/resources/flex/reconstruction/LinearGradient.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "bubble", 3 | "body": { 4 | "type": "box", 5 | "layout": "vertical", 6 | "contents": [ 7 | { 8 | "type": "box", 9 | "layout": "vertical", 10 | "contents": [], 11 | "position": "absolute", 12 | "height": "100%", 13 | "background": { 14 | "type": "linearGradient", 15 | "angle": "217deg", 16 | "startColor": "#FF000000", 17 | "endColor": "#00FF00" 18 | }, 19 | "width": "100%" 20 | } 21 | ], 22 | "paddingAll": "none", 23 | "height": "300px", 24 | "background": { 25 | "type": "linearGradient", 26 | "angle": "137deg", 27 | "startColor": "#0000FF", 28 | "endColor": "#FF00FF" 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /line-bot-webhook/src/main/java/com/linecorp/bot/webhook/model/ReplyEvent.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 interface ReplyEvent { 20 | String replyToken(); 21 | } 22 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/manage_audience/update_description.ftlh: -------------------------------------------------------------------------------- 1 | <#-- @ftlvariable name="audienceGroups" type="com.linecorp.bot.audience.model.GetAudienceGroupsResponse" --> 2 | <#import "../__wrapper.ftlh" as wrapper> 3 | <@wrapper.main> 4 | 5 |

Update description: ${audienceGroup.description()}(ID: ${audienceGroup.audienceGroupId()})

6 | 7 |
8 |
9 | 10 | 12 |
13 | 14 |
15 | 16 | 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 |
8 |
9 | 10 | 11 |
12 |
13 | 14 | 16 |
17 | 18 |
19 | 20 | 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 |
8 |
9 | 10 | 11 |
12 |
13 | 14 | 15 |
16 | 17 |
18 | 19 | 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 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
Success${response.success()!?c}
timestamp${response.timestamp().toEpochSecond()!}
statusCode${response.statusCode()}
Reason${response.reason()!"-"}
Detail${response.detail()!"-"}
29 | 30 | 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 | 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 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
userId${botInfo.userId()}
basicId${botInfo.basicId()}
premiumId${botInfo.premiumId()!"-"}
displayName${botInfo.displayName()}
pictureUrl${botInfo.pictureUrl()}
27 | pictureUrl
chatMode${botInfo.chatMode()}
markAsReadMode${botInfo.markAsReadMode()}
38 | 39 | 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 |
8 |
9 | 10 | 11 |
12 |
13 | 14 | 15 | UserID list or IFA list split by new line. 16 |
17 | 18 |
19 | 20 | 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 { 26 | public LiffExceptionBuilder() { 27 | super(Object.class); 28 | } 29 | 30 | @Override 31 | protected IOException buildException(Response response, Object errorBody) { 32 | return new LiffClientException(response); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/LineClientJsonParseException.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 com.linecorp.bot.client.base.exception.AbstractLineClientException; 22 | 23 | import okhttp3.Response; 24 | 25 | @SuppressWarnings("serial") 26 | public class LineClientJsonParseException extends AbstractLineClientException { 27 | public LineClientJsonParseException(Response response, IOException ioException) { 28 | super(response, "Cannot parse response body: " + ioException.getMessage(), ioException); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /samples/sample-manage-audience/src/main/resources/templates/manage_audience/add_audience_by_file.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 |
9 |
10 | 11 | 12 |
13 |
14 | 15 | 16 | UserID list or IFA list split by new line. 17 |
18 | 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/test/java/com/example/bot/spring/ExampleFlexMessageSupplierTest.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.example.bot.spring; 18 | 19 | import static org.assertj.core.api.Assertions.assertThat; 20 | 21 | import org.junit.jupiter.api.Test; 22 | 23 | import com.linecorp.bot.messaging.model.FlexMessage; 24 | 25 | class ExampleFlexMessageSupplierTest { 26 | 27 | @Test 28 | void get() { 29 | ExampleFlexMessageSupplier supplier = new ExampleFlexMessageSupplier(); 30 | FlexMessage flexMessage = supplier.get(); 31 | assertThat(flexMessage) 32 | .isInstanceOf(FlexMessage.class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /clients/line-bot-module-client/src/main/java/com/linecorp/bot/module/client/LineModuleExceptionBuilder.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 java.io.IOException; 20 | 21 | import com.linecorp.bot.client.base.AbstractExceptionBuilder; 22 | 23 | import okhttp3.Response; 24 | 25 | public class LineModuleExceptionBuilder extends AbstractExceptionBuilder { 26 | public LineModuleExceptionBuilder() { 27 | super(Object.class); 28 | } 29 | 30 | @Override 31 | protected IOException buildException(Response response, Object errorBody) { 32 | return new LineModuleClientException(response); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.github/workflows/check-eol-newrelease.yml: -------------------------------------------------------------------------------- 1 | name: "Check EoL & New Releases" 2 | 3 | on: 4 | schedule: 5 | # Every day at 22:00 UTC -> 07:00 JST 6 | - cron: '0 22 * * *' 7 | workflow_dispatch: 8 | 9 | jobs: 10 | check-eol-newrelease: 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: read 14 | issues: write 15 | if: github.repository == 'line/line-bot-sdk-java' 16 | steps: 17 | - name: Check out code 18 | uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 19 | 20 | - name: Run EoL & NewRelease check 21 | uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 22 | with: 23 | script: | 24 | const checkEolAndNewReleases = require('.github/scripts/check-eol-newrelease.cjs'); 25 | await checkEolAndNewReleases({ github, context, core }, { 26 | languageName: 'Java', 27 | eolJsonUrl: 'https://endoflife.date/api/eclipse-temurin.json', 28 | eolViewUrl: 'https://endoflife.date/eclipse-temurin', 29 | eolLookbackDays: 100, 30 | newReleaseThresholdDays: 100, 31 | ltsOnly: true, 32 | retryCount: 3, 33 | retryIntervalSec: 30 34 | }); 35 | github-token: ${{ secrets.GITHUB_TOKEN }} 36 | -------------------------------------------------------------------------------- /line-bot-parser/src/main/java/com/linecorp/bot/parser/SkipSignatureVerificationSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 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 | import java.util.function.BooleanSupplier; 20 | 21 | /** 22 | * Special {@link BooleanSupplier} for Skip Signature Verification. 23 | * 24 | *

You can implement it to return whether to skip signature verification. 25 | * 26 | *

If true is returned, webhook signature verification is skipped. 27 | * This may be helpful when you update the channel secret and want to skip the verification temporarily. 28 | */ 29 | @FunctionalInterface 30 | public interface SkipSignatureVerificationSupplier extends BooleanSupplier { 31 | } 32 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/test/java/com/linecorp/bot/messaging/model/TextMessageTest.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 | import static org.assertj.core.api.Assertions.assertThat; 20 | import static org.assertj.core.api.Assertions.assertThatThrownBy; 21 | 22 | import org.junit.jupiter.api.Test; 23 | 24 | class TextMessageTest { 25 | @Test 26 | public void testBuilder() { 27 | var builder = new TextMessage.Builder("Hello"); 28 | TextMessage textMessage = builder.build(); 29 | assertThat(textMessage.text()).isEqualTo("Hello"); 30 | assertThat(textMessage.quoteToken()).isNull(); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/http/HttpChain.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 | import okhttp3.Interceptor; 22 | 23 | public class HttpChain { 24 | private final Interceptor.Chain chain; 25 | 26 | public HttpChain(Interceptor.Chain chain) { 27 | this.chain = chain; 28 | } 29 | 30 | public HttpRequest request() { 31 | return new HttpRequest(chain.request()); 32 | } 33 | 34 | public HttpResponse proceed(HttpRequest request) throws IOException { 35 | return new HttpResponse(chain.proceed(request.toOkHttpRequest())); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /clients/line-bot-client-base/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 | implementation(project(":line-bot-jackson")) 24 | 25 | implementation(libs.okhttp3) 26 | implementation(libs.slf4j.api) 27 | implementation(libs.okhttp3.logging.interceptor) 28 | implementation(libs.bundles.retrofit2) 29 | 30 | compileOnly(libs.jackson.annotations) 31 | implementation(libs.jackson.datatype.jsr310) 32 | 33 | testImplementation(libs.wiremock) 34 | testImplementation(libs.bundles.tests) 35 | testImplementation(libs.socks.proxy.server) 36 | testImplementation(libs.littleproxy) 37 | } 38 | -------------------------------------------------------------------------------- /clients/line-bot-module-attach-client/src/main/java/com/linecorp/bot/moduleattach/client/LineModuleAttachExceptionBuilder.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 java.io.IOException; 20 | 21 | import com.linecorp.bot.client.base.AbstractExceptionBuilder; 22 | 23 | import okhttp3.Response; 24 | 25 | public class LineModuleAttachExceptionBuilder extends AbstractExceptionBuilder { 26 | public LineModuleAttachExceptionBuilder() { 27 | super(Object.class); 28 | } 29 | 30 | @Override 31 | protected IOException buildException(Response response, Object errorBody) { 32 | return new LineModuleAttachClientException(response); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /line-bot-parser/src/main/java/com/linecorp/bot/parser/FixedSkipSignatureVerificationSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 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 FixedSkipSignatureVerificationSupplier implements SkipSignatureVerificationSupplier { 20 | private final boolean fixedValue; 21 | 22 | public FixedSkipSignatureVerificationSupplier(boolean fixedValue) { 23 | this.fixedValue = fixedValue; 24 | } 25 | 26 | public static FixedSkipSignatureVerificationSupplier of(boolean fixedValue) { 27 | return new FixedSkipSignatureVerificationSupplier(fixedValue); 28 | } 29 | 30 | @Override 31 | public boolean getAsBoolean() { 32 | return fixedValue; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /clients/line-bot-shop-client/src/main/java/com/linecorp/bot/shop/client/ShopExceptionBuilder.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.shop.client; 18 | 19 | import java.io.IOException; 20 | 21 | import com.linecorp.bot.client.base.AbstractExceptionBuilder; 22 | import com.linecorp.bot.shop.model.ErrorResponse; 23 | 24 | import okhttp3.Response; 25 | 26 | public class ShopExceptionBuilder extends AbstractExceptionBuilder { 27 | public ShopExceptionBuilder() { 28 | super(ErrorResponse.class); 29 | } 30 | 31 | @Override 32 | protected IOException buildException(Response response, ErrorResponse errorBody) { 33 | return new ShopClientException(response, errorBody.message()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-kitchensink/src/main/java/com/example/bot/spring/KitchenSinkApplication.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.example.bot.spring; 18 | 19 | import java.io.IOException; 20 | import java.nio.file.Files; 21 | import java.nio.file.Path; 22 | 23 | import org.springframework.boot.SpringApplication; 24 | import org.springframework.boot.autoconfigure.SpringBootApplication; 25 | 26 | @SpringBootApplication 27 | public class KitchenSinkApplication { 28 | static Path downloadedContentDir; 29 | 30 | public static void main(String[] args) throws IOException { 31 | downloadedContentDir = Files.createTempDirectory("line-bot"); 32 | SpringApplication.run(KitchenSinkApplication.class, args); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /clients/line-bot-shop-client/src/main/java/com/linecorp/bot/shop/client/ShopClientException.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.shop.client; 18 | 19 | import com.linecorp.bot.client.base.exception.AbstractLineClientException; 20 | 21 | import okhttp3.Response; 22 | 23 | /** 24 | * An API call exception for shop API. 25 | */ 26 | @SuppressWarnings("serial") 27 | public class ShopClientException extends AbstractLineClientException { 28 | /** 29 | * An error summary. 30 | */ 31 | private final String error; 32 | 33 | public ShopClientException(Response response, String error) { 34 | super(response, "error='" + error); 35 | this.error = error; 36 | } 37 | 38 | public String getError() { 39 | return error; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /generator/src/main/resources/line-java-codegen/model.pebble: -------------------------------------------------------------------------------- 1 | {# @pebvariable name="models" type="java.util.ArrayList" -#} 2 | {# @pebvariable name="imports" type="java.util.List>" -#} 3 | {% include "./licenseInfo.pebble" %} 4 | 5 | package {{package}}; 6 | 7 | import java.time.Instant; 8 | 9 | import java.util.Objects; 10 | import java.util.Arrays; 11 | import java.util.Map; 12 | import java.util.HashMap; 13 | 14 | import com.fasterxml.jackson.annotation.JsonEnumDefaultValue; 15 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 16 | import com.fasterxml.jackson.annotation.JsonInclude; 17 | import com.fasterxml.jackson.annotation.JsonProperty; 18 | import com.fasterxml.jackson.annotation.JsonSubTypes; 19 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 20 | import com.fasterxml.jackson.annotation.JsonTypeName; 21 | 22 | {% for import in imports -%} 23 | import {{import.import}}; 24 | {% endfor %} 25 | 26 | {% for model in models -%} 27 | {%- if model.model.isEnum -%} 28 | {%- include "./model/enum.pebble" with {"model": model.model} -%} 29 | {%- else -%} 30 | {%- if model.model.discriminator != null -%} 31 | {%- include "./model/interface.pebble" with {"model": model.model} -%} 32 | {%- else -%} 33 | {%- include "./model/record.pebble" with {"model": model.model} -%} 34 | {%- endif -%} 35 | {%- endif -%} 36 | {%- endfor -%} 37 | -------------------------------------------------------------------------------- /clients/line-bot-insight-client/src/main/java/com/linecorp/bot/insight/client/InsightExceptionBuilder.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.insight.client; 18 | 19 | import java.io.IOException; 20 | 21 | import com.linecorp.bot.client.base.AbstractExceptionBuilder; 22 | import com.linecorp.bot.insight.model.ErrorResponse; 23 | 24 | import okhttp3.Response; 25 | 26 | public class InsightExceptionBuilder extends AbstractExceptionBuilder { 27 | public InsightExceptionBuilder() { 28 | super(ErrorResponse.class); 29 | } 30 | 31 | @Override 32 | protected IOException buildException(Response response, ErrorResponse errorBody) { 33 | return new InsightClientException( 34 | response, 35 | errorBody.message(), errorBody.details()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /clients/line-bot-insight-client/.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | src/main/java/com/linecorp/bot/insight/client/InsightClient.java 2 | src/main/java/com/linecorp/bot/insight/model/AgeTile.java 3 | src/main/java/com/linecorp/bot/insight/model/AppTypeTile.java 4 | src/main/java/com/linecorp/bot/insight/model/AreaTile.java 5 | src/main/java/com/linecorp/bot/insight/model/ErrorDetail.java 6 | src/main/java/com/linecorp/bot/insight/model/ErrorResponse.java 7 | src/main/java/com/linecorp/bot/insight/model/GenderTile.java 8 | src/main/java/com/linecorp/bot/insight/model/GetFriendsDemographicsResponse.java 9 | src/main/java/com/linecorp/bot/insight/model/GetMessageEventResponse.java 10 | src/main/java/com/linecorp/bot/insight/model/GetMessageEventResponseClick.java 11 | src/main/java/com/linecorp/bot/insight/model/GetMessageEventResponseMessage.java 12 | src/main/java/com/linecorp/bot/insight/model/GetMessageEventResponseOverview.java 13 | src/main/java/com/linecorp/bot/insight/model/GetNumberOfFollowersResponse.java 14 | src/main/java/com/linecorp/bot/insight/model/GetNumberOfMessageDeliveriesResponse.java 15 | src/main/java/com/linecorp/bot/insight/model/GetStatisticsPerUnitResponse.java 16 | src/main/java/com/linecorp/bot/insight/model/GetStatisticsPerUnitResponseClick.java 17 | src/main/java/com/linecorp/bot/insight/model/GetStatisticsPerUnitResponseMessage.java 18 | src/main/java/com/linecorp/bot/insight/model/GetStatisticsPerUnitResponseOverview.java 19 | src/main/java/com/linecorp/bot/insight/model/SubscriptionPeriodTile.java 20 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/annotation/LineMessageHandler.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.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 | import org.springframework.stereotype.Component; 25 | 26 | /** 27 | * Indicates that an annotated class has a LINE Messaging Event Handler method. 28 | * 29 | *

This annotation serves as a specialization of {@link Component @Component}, 30 | * allowing for implementation classes to be autodetected through classpath scanning. 31 | */ 32 | @Target(ElementType.TYPE) 33 | @Component 34 | @Retention(RetentionPolicy.RUNTIME) 35 | public @interface LineMessageHandler {} 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report Template 3 | about: Use this template to report bugs in the line-bot-sdk-java 4 | title: 'Bug Report' 5 | --- 6 | 7 | 14 | 15 | ## System Information 16 | - OS: [e.g. Ubuntu] 17 | - JDK Version [e.g. openjdk 1.8.0_211] 18 | - line-bot-sdk-java version(s) [e.g. 2.6.1] 19 | 20 | ## Expected Behavior 21 | 22 | 23 | ## Current Behavior 24 | 25 | 26 | ## Steps to Reproduce 27 | 29 | 1. 30 | 2. 31 | 3. 32 | 33 | ## Logs 34 | 35 | 36 | ## Additional Context (Optional) 37 | 39 | -------------------------------------------------------------------------------- /clients/line-bot-manage-audience-client/src/main/java/com/linecorp/bot/audience/client/ManageAudienceExceptionBuilder.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.audience.client; 18 | 19 | import java.io.IOException; 20 | 21 | import com.linecorp.bot.audience.model.ErrorResponse; 22 | import com.linecorp.bot.client.base.AbstractExceptionBuilder; 23 | 24 | import okhttp3.Response; 25 | 26 | public class ManageAudienceExceptionBuilder extends AbstractExceptionBuilder { 27 | public ManageAudienceExceptionBuilder() { 28 | super(ErrorResponse.class); 29 | } 30 | 31 | @Override 32 | protected IOException buildException(Response response, ErrorResponse errorBody) { 33 | return new ManageAudienceClientException( 34 | response, 35 | errorBody.message(), errorBody.details()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /samples/sample-spring-boot-echo-kotlin/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.kotlin.gradle.dsl.JvmTarget 2 | 3 | /* 4 | * Copyright 2023 LINE Corporation 5 | * 6 | * LINE Corporation licenses this file to you under the Apache License, 7 | * version 2.0 (the "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at: 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 15 | * License for the specific language governing permissions and limitations 16 | * under the License. 17 | */ 18 | 19 | plugins { 20 | id("sdk.java-library") 21 | id("sdk.spring-boot") 22 | kotlin("jvm") version "2.2.21" 23 | kotlin("plugin.spring") version "2.2.21" 24 | } 25 | 26 | dependencies { 27 | implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)) 28 | 29 | implementation(project(":spring-boot:line-bot-spring-boot-handler")) 30 | implementation("org.springframework.boot:spring-boot-starter-web") 31 | implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") 32 | } 33 | 34 | tasks.withType { 35 | compilerOptions { 36 | jvmTarget.set(JvmTarget.fromTarget("17")) 37 | javaParameters.set(true) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /line-bot-webhook/src/main/java/com/linecorp/bot/webhook/model/UnknownMembershipContent.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.webhook.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownMembershipContent */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownMembershipContent() implements MembershipContent { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownMembershipContent build() { 38 | return new UnknownMembershipContent(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownMentionTarget.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownMentionTarget */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownMentionTarget() implements MentionTarget { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownMentionTarget build() { 38 | return new UnknownMentionTarget(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/client/MessagingApiExceptionBuilder.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.client; 18 | 19 | import java.io.IOException; 20 | 21 | import com.linecorp.bot.client.base.AbstractExceptionBuilder; 22 | import com.linecorp.bot.messaging.model.ErrorResponse; 23 | 24 | import okhttp3.Response; 25 | 26 | public class MessagingApiExceptionBuilder extends AbstractExceptionBuilder { 27 | public MessagingApiExceptionBuilder() { 28 | super(ErrorResponse.class); 29 | } 30 | 31 | @Override 32 | protected IOException buildException(Response response, ErrorResponse errorBody) { 33 | return new MessagingApiClientException( 34 | response, 35 | errorBody.message(), errorBody.details(), errorBody.sentMessages()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/FlexBoxBackground.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonSubTypes; 26 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 27 | 28 | /** FlexBoxBackground */ 29 | @JsonSubTypes({ 30 | @JsonSubTypes.Type(value = FlexBoxLinearGradient.class, name = "linearGradient"), 31 | }) 32 | @JsonTypeInfo( 33 | use = JsonTypeInfo.Id.NAME, 34 | include = JsonTypeInfo.As.PROPERTY, 35 | property = "type", 36 | defaultImpl = UnknownFlexBoxBackground.class, 37 | visible = true) 38 | public interface FlexBoxBackground {} 39 | -------------------------------------------------------------------------------- /clients/line-channel-access-token-client/src/main/java/com/linecorp/bot/oauth/client/ChannelAccessTokenExceptionBuilder.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.oauth.client; 18 | 19 | import java.io.IOException; 20 | 21 | import com.linecorp.bot.client.base.AbstractExceptionBuilder; 22 | import com.linecorp.bot.oauth.model.ErrorResponse; 23 | 24 | import okhttp3.Response; 25 | 26 | public class ChannelAccessTokenExceptionBuilder extends AbstractExceptionBuilder { 27 | public ChannelAccessTokenExceptionBuilder() { 28 | super(ErrorResponse.class); 29 | } 30 | 31 | @Override 32 | protected IOException buildException(Response response, ErrorResponse errorBody) { 33 | return new ChannelAccessTokenClientException( 34 | response, 35 | errorBody.error(), errorBody.errorDescription()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /clients/line-bot-manage-audience-client/src/main/java/com/linecorp/bot/audience/model/AudienceGroupJobType.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.audience.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonEnumDefaultValue; 26 | import com.fasterxml.jackson.annotation.JsonProperty; 27 | import com.fasterxml.jackson.annotation.JsonValue; 28 | 29 | /** Job Type */ 30 | public enum AudienceGroupJobType { 31 | @JsonProperty("DIFF_ADD") 32 | DIFF_ADD, 33 | 34 | @JsonEnumDefaultValue 35 | UNDEFINED; 36 | 37 | @JsonValue 38 | public String toValue() { 39 | return switch (this) { 40 | case DIFF_ADD -> "DIFF_ADD"; 41 | 42 | default -> "UNDEFINED"; 43 | }; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownSubstitutionObject.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownSubstitutionObject */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownSubstitutionObject() implements SubstitutionObject { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownSubstitutionObject build() { 38 | return new UnknownSubstitutionObject(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownCouponRewardRequest.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownCouponRewardRequest */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownCouponRewardRequest() implements CouponRewardRequest { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownCouponRewardRequest build() { 38 | return new UnknownCouponRewardRequest(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/FlexContainer.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonSubTypes; 26 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 27 | 28 | /** FlexContainer */ 29 | @JsonSubTypes({ 30 | @JsonSubTypes.Type(value = FlexBubble.class, name = "bubble"), 31 | @JsonSubTypes.Type(value = FlexCarousel.class, name = "carousel"), 32 | }) 33 | @JsonTypeInfo( 34 | use = JsonTypeInfo.Id.NAME, 35 | include = JsonTypeInfo.As.PROPERTY, 36 | property = "type", 37 | defaultImpl = UnknownFlexContainer.class, 38 | visible = true) 39 | public interface FlexContainer {} 40 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownCouponRewardResponse.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownCouponRewardResponse */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownCouponRewardResponse() implements CouponRewardResponse { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownCouponRewardResponse build() { 38 | return new UnknownCouponRewardResponse(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /line-bot-webhook/src/main/java/com/linecorp/bot/webhook/model/ModuleContent.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.webhook.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonSubTypes; 26 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 27 | 28 | /** ModuleContent */ 29 | @JsonSubTypes({ 30 | @JsonSubTypes.Type(value = AttachedModuleContent.class, name = "attached"), 31 | @JsonSubTypes.Type(value = DetachedModuleContent.class, name = "detached"), 32 | }) 33 | @JsonTypeInfo( 34 | use = JsonTypeInfo.Id.NAME, 35 | include = JsonTypeInfo.As.PROPERTY, 36 | property = "type", 37 | defaultImpl = UnknownModuleContent.class, 38 | visible = true) 39 | public interface ModuleContent {} 40 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/MentionTarget.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonSubTypes; 26 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 27 | 28 | /** MentionTarget */ 29 | @JsonSubTypes({ 30 | @JsonSubTypes.Type(value = AllMentionTarget.class, name = "all"), 31 | @JsonSubTypes.Type(value = UserMentionTarget.class, name = "user"), 32 | }) 33 | @JsonTypeInfo( 34 | use = JsonTypeInfo.Id.NAME, 35 | include = JsonTypeInfo.As.PROPERTY, 36 | property = "type", 37 | defaultImpl = UnknownMentionTarget.class, 38 | visible = true) 39 | public interface MentionTarget {} 40 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-webmvc/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 | implementation(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)) 24 | annotationProcessor(platform(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)) 25 | 26 | api(project(":spring-boot:line-bot-spring-boot-web")) 27 | 28 | implementation("org.springframework.boot:spring-boot-autoconfigure") 29 | implementation("org.springframework.boot:spring-boot-starter-web") 30 | 31 | testImplementation(libs.wiremock) 32 | testImplementation("org.springframework.boot:spring-boot-starter-test") // MockHttpServletRequest 33 | testImplementation("org.springframework.boot:spring-boot-starter-logging") 34 | testRuntimeOnly("org.junit.platform:junit-platform-launcher") 35 | } 36 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownCashBackPriceInfoRequest.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownCashBackPriceInfoRequest */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownCashBackPriceInfoRequest() implements CashBackPriceInfoRequest { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownCashBackPriceInfoRequest build() { 38 | return new UnknownCashBackPriceInfoRequest(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownDiscountPriceInfoRequest.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownDiscountPriceInfoRequest */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownDiscountPriceInfoRequest() implements DiscountPriceInfoRequest { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownDiscountPriceInfoRequest build() { 38 | return new UnknownDiscountPriceInfoRequest(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownCashBackPriceInfoResponse.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownCashBackPriceInfoResponse */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownCashBackPriceInfoResponse() implements CashBackPriceInfoResponse { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownCashBackPriceInfoResponse build() { 38 | return new UnknownCashBackPriceInfoResponse(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownDiscountPriceInfoResponse.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownDiscountPriceInfoResponse */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownDiscountPriceInfoResponse() implements DiscountPriceInfoResponse { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownDiscountPriceInfoResponse build() { 38 | return new UnknownDiscountPriceInfoResponse(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /line-bot-webhook/src/main/java/com/linecorp/bot/webhook/model/EventMode.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.webhook.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonEnumDefaultValue; 26 | import com.fasterxml.jackson.annotation.JsonProperty; 27 | import com.fasterxml.jackson.annotation.JsonValue; 28 | 29 | /** Channel state. */ 30 | public enum EventMode { 31 | @JsonProperty("active") 32 | ACTIVE, 33 | 34 | @JsonProperty("standby") 35 | STANDBY, 36 | 37 | @JsonEnumDefaultValue 38 | UNDEFINED; 39 | 40 | @JsonValue 41 | public String toValue() { 42 | return switch (this) { 43 | case ACTIVE -> "active"; 44 | case STANDBY -> "standby"; 45 | 46 | default -> "UNDEFINED"; 47 | }; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownAcquisitionConditionRequest.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownAcquisitionConditionRequest */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownAcquisitionConditionRequest() implements AcquisitionConditionRequest { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownAcquisitionConditionRequest build() { 38 | return new UnknownAcquisitionConditionRequest(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-client-base/src/main/java/com/linecorp/bot/client/base/http/HttpResponseBody.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 | import java.util.Objects; 21 | 22 | import okhttp3.ResponseBody; 23 | import okio.Buffer; 24 | import okio.BufferedSource; 25 | 26 | public class HttpResponseBody { 27 | private final ResponseBody body; 28 | 29 | public HttpResponseBody(ResponseBody body) { 30 | this.body = Objects.requireNonNull(body); 31 | } 32 | 33 | public HttpMediaType contentType() { 34 | return new HttpMediaType(this.body.contentType()); 35 | } 36 | 37 | public byte[] readByteArray() throws IOException { 38 | BufferedSource source = this.body.source(); 39 | source.request(Long.MAX_VALUE); // Buffer the entire body. 40 | Buffer buffer = source.getBuffer(); 41 | return buffer.clone().readByteArray(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /generator/src/main/java/com/linecorp/bot/codegen/pebble/MyPebbleExtension.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.codegen.pebble; 18 | import com.linecorp.bot.codegen.pebble.function.EndpointFunction; 19 | import com.linecorp.bot.codegen.pebble.function.JavaTypeFunction; 20 | import com.linecorp.bot.codegen.pebble.function.RequiredVarsFunction; 21 | import io.pebbletemplates.pebble.extension.AbstractExtension; 22 | import io.pebbletemplates.pebble.extension.Function; 23 | 24 | import java.util.HashMap; 25 | import java.util.Map; 26 | 27 | 28 | public class MyPebbleExtension extends AbstractExtension { 29 | @Override 30 | public Map getFunctions() { 31 | HashMap map = new HashMap<>(); 32 | map.put("endpoint", new EndpointFunction()); 33 | map.put("javatype", new JavaTypeFunction()); 34 | map.put("requiredVars", new RequiredVarsFunction()); 35 | return map; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/model/UnknownAcquisitionConditionResponse.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 | /** 18 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 19 | * https://openapi-generator.tech Do not edit the class manually. 20 | */ 21 | package com.linecorp.bot.messaging.model; 22 | 23 | 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude; 26 | import com.fasterxml.jackson.annotation.JsonInclude.Include; 27 | 28 | /** UnknownAcquisitionConditionResponse */ 29 | @JsonInclude(Include.NON_NULL) 30 | @javax.annotation.Generated(value = "") 31 | public record UnknownAcquisitionConditionResponse() implements AcquisitionConditionResponse { 32 | 33 | public static class Builder { 34 | 35 | public Builder() {} 36 | 37 | public UnknownAcquisitionConditionResponse build() { 38 | return new UnknownAcquisitionConditionResponse(); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /clients/line-bot-client-base/src/test/java/com/linecorp/bot/client/base/channel/FixedChannelTokenSupplierTest.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 static org.assertj.core.api.Assertions.assertThat; 20 | import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; 21 | 22 | import org.junit.jupiter.api.Test; 23 | 24 | public class FixedChannelTokenSupplierTest { 25 | @Test 26 | public void constructedInstanceAlwaysNonNullTest() { 27 | assertThatThrownBy( 28 | () -> FixedChannelTokenSupplier.of(null) 29 | ).isInstanceOf(NullPointerException.class); 30 | } 31 | 32 | @Test 33 | public void getTest() { 34 | ChannelTokenSupplier target = FixedChannelTokenSupplier.of("FIXED_TOKEN"); 35 | 36 | // DO 37 | String result = target.get(); 38 | 39 | // Verify 40 | assertThat(result).isEqualTo("FIXED_TOKEN"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-boot/line-bot-spring-boot-handler/src/main/java/com/linecorp/bot/spring/boot/handler/argument/EventArgumentResolver.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 java.lang.reflect.Type; 20 | 21 | import com.linecorp.bot.webhook.model.Event; 22 | 23 | public class EventArgumentResolver implements ArgumentResolver { 24 | private final Class klass; 25 | 26 | public EventArgumentResolver(Type type) { 27 | this.klass = (Class) type; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "EventArgumentResolver{" 33 | + "klass=" + klass 34 | + '}'; 35 | } 36 | 37 | @Override 38 | public boolean isSupported(Event event) { 39 | return klass.isAssignableFrom(event.getClass()); 40 | } 41 | 42 | @Override 43 | public Object resolve(String destination, Event event) { 44 | return event; 45 | } 46 | } 47 | --------------------------------------------------------------------------------