---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    funktion.fabric8.io/kind: Connector
  name: slack
data:
  deployment.yml: |
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        funktion.fabric8.io/kind: Subscription
        connector: slack
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            funktion.fabric8.io/kind: Subscription
            connector: slack
        spec:
          containers:
          - image: funktion/connector-slack:${project.version}
            name: connector
  schema.yml: |
    ---
    component:
      kind: component
      scheme: slack
      syntax: slack:channel
      title: Slack
      description: The slack component allows you to send messages to Slack.
      label: social
      deprecated: false
      async: false
      producerOnly: true
      javaType: org.apache.camel.component.slack.SlackComponent
      groupId: org.apache.camel
      artifactId: camel-slack
      version: 2.18.3
    componentProperties:
      webhookUrl:
        kind: property
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The incoming webhook URL
        order: 0
    properties:
      channel:
        kind: path
        group: producer
        required: true
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The channel name (syntax name) or slackuser (syntax userName) to send a message directly to an user.
        order: 0
      iconEmoji:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: Use a Slack emoji as an avatar
        order: 1
      iconUrl:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The avatar that the component will use when sending message to a channel or user.
        order: 2
      username:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: This is the username that the bot will have when sending messages to a channel or user.
        order: 3
      webhookUrl:
        kind: parameter
        group: producer
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: The incoming webhook URL
        order: 4
      synchronous:
        kind: parameter
        group: advanced
        label: advanced
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
        order: 5
  documentation.adoc: |+
    [[Slack-SlackComponent]]
    Slack Component
    ~~~~~~~~~~~~~~~

    *Available as of Camel 2.16*

    The *slack* component allows you to connect to an instance
    of http://www.slack.com/[Slack] and delivers a message contained in the
    message body via a pre
    established https://api.slack.com/incoming-webhooks[Slack incoming
    webhook].

    Maven users will need to add the following dependency to their `pom.xml`
    for this component:

    [source,xml]
    ------------------------------------------------------------
    <dependency>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-slack</artifactId>
        <version>x.x.x</version>
        <!-- use the same version as your Camel core version -->
    </dependency>
    ------------------------------------------------------------

    [[Slack-URIformat]]
    URI format
    ^^^^^^^^^^

    To send a message to a channel.

    [source,java]
    ------------------------
    slack:#channel[?options]
    ------------------------

    To send a direct message to a slackuser.

    [source,java]
    -------------------------
    slack:@username[?options]
    -------------------------

    [[Slack-Options]]
    Options
    ^^^^^^^



    // component options: START
    The Slack component supports 1 options which are listed below.



    {% raw %}
    [width="100%",cols="2,1m,7",options="header"]
    |=======================================================================
    | Name | Java Type | Description
    | webhookUrl | String | The incoming webhook URL
    |=======================================================================
    {% endraw %}
    // component options: END




    // endpoint options: START
    The Slack component supports 6 endpoint options which are listed below:

    {% raw %}
    [width="100%",cols="2,1,1m,1m,5",options="header"]
    |=======================================================================
    | Name | Group | Default | Java Type | Description
    | channel | producer |  | String | *Required* The channel name (syntax name) or slackuser (syntax userName) to send a message directly to an user.
    | iconEmoji | producer |  | String | Use a Slack emoji as an avatar
    | iconUrl | producer |  | String | The avatar that the component will use when sending message to a channel or user.
    | username | producer |  | String | This is the username that the bot will have when sending messages to a channel or user.
    | webhookUrl | producer |  | String | The incoming webhook URL
    | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
    |=======================================================================
    {% endraw %}
    // endpoint options: END


    [[Slack-SlackComponent.1]]
    SlackComponent
    ^^^^^^^^^^^^^^

    The SlackComponent with XML must be configured as a Spring or Blueprint
    bean that contains the incoming webhook url for the integration as a
    parameter.

    [source,xml]
    -----------------------------------------------------------------------------------------------------------------------
    <bean id="slack" class="org.apache.camel.component.slack.SlackComponent">
        <property name="webhookUrl" value="https://hooks.slack.com/services/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"/>
    </bean>
    -----------------------------------------------------------------------------------------------------------------------

    For Java you can configure this using Java code.

    [[Slack-Example]]
    Example
    ^^^^^^^

    A CamelContext with Blueprint could be as:

    [source,xml]
    ---------------------------------------------------------------------------------------------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">

        <bean id="slack" class="org.apache.camel.component.slack.SlackComponent">
            <property name="webhookUrl" value="https://hooks.slack.com/services/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"/>
        </bean>

        <camelContext xmlns="http://camel.apache.org/schema/blueprint">
            <route>
                <from uri="direct:test"/>
                <to uri="slack:#channel?iconEmoji=:camel:&amp;username=CamelTest"/>
            </route>
        </camelContext>

    </blueprint>
    ---------------------------------------------------------------------------------------------------------------------------

    [[Slack-SeeAlso]]
    See Also
    ^^^^^^^^

    * link:configuring-camel.html[Configuring Camel]
    * link:component.html[Component]
    * link:endpoint.html[Endpoint]
    * link:getting-started.html[Getting Started]

