Sha256: e3be848531929407ecbc34d9197a8ec0a4dc25a9a3f2090f556cd21da88bbcd9

Contents?: true

Size: 710 Bytes

Versions: 133

Compression:

Stored size: 710 Bytes

Contents

module Jets::Job::Dsl
  module IotEvent
    # The user must at least pass in an SQL statement
    def iot_event(props={})
      if props.is_a?(String) # SQL Statement
        props = {sql: props}
        topic_props = {topic_rule_payload: props}
      elsif props.key?(:topic_rule_payload) # full properties structure
        topic_props = props
      else # just the topic_rule_payload
        topic_props = {topic_rule_payload: props}
      end

      declare_iot_topic(topic_props)
    end

    def declare_iot_topic(props={})
      r = Jets::Resource::Iot::TopicRule.new(props)
      with_fresh_properties do
        resource(r.definition) # add associated resource immediately
      end
    end
  end
end

Version data entries

133 entries across 133 versions & 3 rubygems

Version Path
jets-4.0.12 lib/jets/job/dsl/iot_event.rb
jets-4.0.11 lib/jets/job/dsl/iot_event.rb
jets-4.0.10 lib/jets/job/dsl/iot_event.rb
jets-4.0.9 lib/jets/job/dsl/iot_event.rb
jets-4.0.8 lib/jets/job/dsl/iot_event.rb
jets-4.0.7 lib/jets/job/dsl/iot_event.rb
jets-4.0.6 lib/jets/job/dsl/iot_event.rb
jets-4.0.5 lib/jets/job/dsl/iot_event.rb
jets-4.0.4 lib/jets/job/dsl/iot_event.rb
jets-4.0.3 lib/jets/job/dsl/iot_event.rb
jets-4.0.2 lib/jets/job/dsl/iot_event.rb
jets-4.0.1 lib/jets/job/dsl/iot_event.rb
jets-4.0.0 lib/jets/job/dsl/iot_event.rb
jets-3.2.2 lib/jets/job/dsl/iot_event.rb
jets-3.2.1 lib/jets/job/dsl/iot_event.rb
jets.benforeva-3.0.17.pre.mount.pre.fix lib/jets/job/dsl/iot_event.rb
jets-3.2.0 lib/jets/job/dsl/iot_event.rb
jets-3.1.5 lib/jets/job/dsl/iot_event.rb
jets-3.1.4 lib/jets/job/dsl/iot_event.rb
jets-3.1.3 lib/jets/job/dsl/iot_event.rb