This is an automated email from the ASF dual-hosted git repository. acosentino pushed a commit to branch gmail in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git
commit f6952670a7e44fca6fa521cba7fd2169970718bf Author: Andrea Cosentino <anco...@gmail.com> AuthorDate: Wed Mar 10 08:47:09 2021 +0100 Added Google Mail source kamelet --- .../images/kamelets/google-mail-stream-source.svg | 7 +++ docs/modules/ROOT/nav.adoc | 1 + .../ROOT/pages/google-mail-stream-source.adoc | 73 ++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/docs/modules/ROOT/assets/images/kamelets/google-mail-stream-source.svg b/docs/modules/ROOT/assets/images/kamelets/google-mail-stream-source.svg new file mode 100644 index 0000000..40b7175 --- /dev/null +++ b/docs/modules/ROOT/assets/images/kamelets/google-mail-stream-source.svg @@ -0,0 +1,7 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="52 42 88 66"> +<path fill="#4285f4" d="M58 108h14V74L52 59v43c0 3.32 2.69 6 6 6"/> +<path fill="#34a853" d="M120 108h14c3.32 0 6-2.69 6-6V59l-20 15"/> +<path fill="#fbbc04" d="M120 48v26l20-15v-8c0-7.42-8.47-11.65-14.4-7.2"/> +<path fill="#ea4335" d="M72 74V48l24 18 24-18v26L96 92"/> +<path fill="#c5221f" d="M52 51v8l20 15V48l-5.6-4.2c-5.94-4.45-14.4-.22-14.4 7.2"/> +</svg> \ No newline at end of file diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc index 360f971..7bb7bd9 100644 --- a/docs/modules/ROOT/nav.adoc +++ b/docs/modules/ROOT/nav.adoc @@ -5,6 +5,7 @@ * xref:ROOT:bitcoin-source.adoc[image:kamelets/bitcoin-source.svg[] Bitcoin Source] * xref:ROOT:ftp-source.adoc[image:kamelets/ftp-source.svg[] FTP Source] * xref:ROOT:ftps-source.adoc[image:kamelets/ftps-source.svg[] FTPS Source] +* xref:ROOT:google-mail-stream-source.adoc[image:kamelets/google-mail-stream-source.svg[] Google Mail Stream Source] * xref:ROOT:http-source.adoc[image:kamelets/http-source.svg[] HTTP Source] * xref:ROOT:jira-source.adoc[image:kamelets/jira-source.svg[] Jira Source] * xref:ROOT:kafka-source.adoc[image:kamelets/kafka-source.svg[] Kafka Source] diff --git a/docs/modules/ROOT/pages/google-mail-stream-source.adoc b/docs/modules/ROOT/pages/google-mail-stream-source.adoc new file mode 100644 index 0000000..5d9a372 --- /dev/null +++ b/docs/modules/ROOT/pages/google-mail-stream-source.adoc @@ -0,0 +1,73 @@ +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT += image:kamelets/google-mail-stream-source.svg[] Google Mail Stream Source + +*Provided by: "Apache Software Foundation"* + +Receive data from Google Mail. + +== Configuration Options + +The following table summarizes the configuration options available for the `google-mail-stream-source` Kamelet: +[width="100%",cols="2,^2,3,^2,^2,^3",options="header"] +|=== +| Property| Name| Description| Type| Default| Example +| *accessToken {empty}* *| Access Token| OAuth 2 access token for google mail application. This typically expires after an hour so refreshToken is recommended for long term usage.| string| | +| *applicationName {empty}* *| Application name| Google Mail application name| string| | +| *clientId {empty}* *| Client Id| Client ID of the gmail application| string| | +| *clientSecret {empty}* *| Client Secret| Client Secret of the gmail application| string| | +| *index {empty}* *| Index| An index for the google mail endpoint| string| | +| *refreshToken {empty}* *| Refresh Token| OAuth 2 refresh token for google mail application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.| string| | +| labels| Gmail labels| Comma separated list of labels to take into account| string| | `"inbox"` +| markAsRead| Mark as read| Mark the message as read once it has been consumed| boolean| `false`| +| query| Gmail query| The query to execute on gmail box| string| `"is:unread"`| `"is:unread -category:(promotions OR social)"` +|=== + +NOTE: Fields marked with ({empty}*) are mandatory. + +== Usage + +This section summarizes how the `google-mail-stream-source` can be used in various contexts. + +=== Knative Source + +The `google-mail-stream-source` Kamelet can be used as Knative source by binding it to a Knative object. + +.google-mail-stream-source-binding.yaml +[source,yaml] +---- +apiVersion: camel.apache.org/v1alpha1 +kind: KameletBinding +metadata: + name: google-mail-stream-source-binding +spec: + source: + ref: + kind: Kamelet + apiVersion: camel.apache.org/v1alpha1 + name: google-mail-stream-source + properties: + accessToken: "The Access Token" + applicationName: "The Application name" + clientId: "The Client Id" + clientSecret: "The Client Secret" + index: "The Index" + refreshToken: "The Refresh Token" + sink: + ref: + kind: InMemoryChannel + apiVersion: messaging.knative.dev/v1 + name: mychannel + +---- + +Make sure you have xref:latest@camel-k::installation/installation.adoc[Camel K installed] into the Kubernetes cluster you're connected to. + +Save the `google-mail-stream-source-binding.yaml` file into your hard drive, then configure it according to your needs. + +You can run the source using the following command: + +[source,shell] +---- +kubectl apply -f google-mail-stream-source-binding.yaml +---- +// THIS FILE IS AUTOMATICALLY GENERATED: DO NOT EDIT