# ---------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ---------------------------------------------------------------------------
apiVersion: camel.apache.org/v1alpha1
kind: Kamelet
metadata:
  name: file-watch-source
  annotations:
    camel.apache.org/kamelet.support.level: "Stable"
    camel.apache.org/catalog.version: "3.21.0"
    camel.apache.org/kamelet.icon: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJDYXBhXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzY4LjU1MyAzNjguNTUzIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAzNjguNTUzIDM2OC41NTM7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxnPg0KCQk8cGF0aCBkPSJNMjM5LjY4LDBINDIuNjk1djM2OC41NTNoMjgzLjE2NFY4Ni44MTFMMjM5LjY4LDB6IE0yNDQuMDU3LDI1L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kamelet.group: "File Watch"
    camel.apache.org/kamelet.namespace: "File"
  labels:
    camel.apache.org/kamelet.type: "source"
spec:
  definition:
    title: "File Watch Source"
    description: |-
      Receive events related to a file or folder. It may require a volume mounting on Kubernetes.
    required:
      - filePath
      - events
    type: object
    properties:
      filePath:
        title: Path to Watch
        description: Path of file or folder to watch
        type: string
      events:
        title: Events
        description: The type of events to consume
        type: string
        default: "CREATE,MODIFY,DELETE"
  dependencies:
    - "camel:file-watch"
    - "camel:kamelet"
  template:
    from:
      uri: "file-watch:{{filePath}}"
      parameters:
        events: "{{events}}"
      steps:
      - to: "kamelet:sink"