slack-block-kit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/Gemfile +4 -0
  6. data/README.md +62 -0
  7. data/Rakefile +6 -0
  8. data/bin/console +27 -0
  9. data/bin/setup +8 -0
  10. data/examples/slack_template_00.rb +46 -0
  11. data/examples/slack_template_01.rb +22 -0
  12. data/examples/slack_template_02.rb +28 -0
  13. data/examples/slack_template_03.rb +57 -0
  14. data/examples/slack_template_04.rb +29 -0
  15. data/examples/slack_template_05.rb +12 -0
  16. data/examples/slack_template_06.rb +53 -0
  17. data/examples/slack_template_07.rb +74 -0
  18. data/examples/slack_template_08.rb +77 -0
  19. data/examples/slack_template_09.rb +53 -0
  20. data/lib/slack-block-kit.rb +1 -0
  21. data/lib/slack/block_kit.rb +38 -0
  22. data/lib/slack/block_kit/block.rb +41 -0
  23. data/lib/slack/block_kit/block/actions_block.rb +35 -0
  24. data/lib/slack/block_kit/block/context_block.rb +30 -0
  25. data/lib/slack/block_kit/block/divider_block.rb +17 -0
  26. data/lib/slack/block_kit/block/image_block.rb +44 -0
  27. data/lib/slack/block_kit/block/section_block.rb +55 -0
  28. data/lib/slack/block_kit/composition_objects/confirmation_dialog.rb +59 -0
  29. data/lib/slack/block_kit/composition_objects/filter.rb +38 -0
  30. data/lib/slack/block_kit/composition_objects/option.rb +57 -0
  31. data/lib/slack/block_kit/composition_objects/option_group.rb +34 -0
  32. data/lib/slack/block_kit/composition_objects/text.rb +61 -0
  33. data/lib/slack/block_kit/element.rb +41 -0
  34. data/lib/slack/block_kit/element/button_element.rb +48 -0
  35. data/lib/slack/block_kit/element/channels_select_element.rb +31 -0
  36. data/lib/slack/block_kit/element/conversations_select_element.rb +43 -0
  37. data/lib/slack/block_kit/element/date_picker_element.rb +56 -0
  38. data/lib/slack/block_kit/element/external_select_element.rb +38 -0
  39. data/lib/slack/block_kit/element/image_element.rb +26 -0
  40. data/lib/slack/block_kit/element/multi_channels_select_element.rb +38 -0
  41. data/lib/slack/block_kit/element/multi_conversations_select_element.rb +38 -0
  42. data/lib/slack/block_kit/element/multi_external_select_element.rb +38 -0
  43. data/lib/slack/block_kit/element/multi_static_select_element.rb +38 -0
  44. data/lib/slack/block_kit/element/multi_users_select_element.rb +39 -0
  45. data/lib/slack/block_kit/element/overflow_element.rb +42 -0
  46. data/lib/slack/block_kit/element/select_element.rb +45 -0
  47. data/lib/slack/block_kit/element/static_select_element.rb +46 -0
  48. data/lib/slack/block_kit/element/users_select_element.rb +24 -0
  49. data/lib/slack/block_kit/execution_context.rb +64 -0
  50. data/lib/slack/block_kit/refinements/hash_compact.rb +15 -0
  51. data/lib/slack/block_kit/type_restricted_array.rb +21 -0
  52. data/lib/slack/block_kit/version.rb +5 -0
  53. data/slack-block-kit.gemspec +29 -0
  54. metadata +166 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d1213cb50f260ad0e5a04217689cd89616631253fb1f7eb5a6542a967431085f
4
+ data.tar.gz: cd396560c416619a1bb64f4dc73b068db0a3e7b9f2c8b8ce1a8fa22279214a9a
5
+ SHA512:
6
+ metadata.gz: 3171e4609ee091076a8b038ac83f10d48c0fb1293de1a3e9bb9c3dd1bd1116ea2721db9218b71544ef8f5aaf650a903effc3c0cef51b3ceab1d5feab65a1bc8f
7
+ data.tar.gz: 3464ea2809cd0d64ae80c013e98bf0b4e7ab605c127cc2a8fb2bc0405a4455c63929668a25cd7aafd1953d133f8bcd5bf69e249f0cf159dbcb84e56dcd2ec95a
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ *.swp
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.3
7
+ before_install: gem install bundler -v 2.0.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in slack-block-kit.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,62 @@
1
+ # Slack::BlockKit
2
+
3
+ This is a helper for producing Blocks you'd expect in BlockKit.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'slack-block-kit'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install slack-block-kit
20
+
21
+ ## Usage
22
+
23
+ Require the gem using:
24
+
25
+ ```ruby
26
+ require 'slack-block-kit'
27
+ ```
28
+
29
+ Include the execution context DSL:
30
+
31
+ ```ruby
32
+ include Slack::BlockKit::ExecutionContext
33
+ ```
34
+
35
+ Then you can construct your blocks as you want:
36
+
37
+ ```ruby
38
+ require 'slack-ruby-client'
39
+
40
+ client = Slack::Web::Client.new
41
+
42
+ blocks = [
43
+ SectionBlock[text: Text[mrkdwn: "Hello, #{Bold['World!']}"]]
44
+ ]
45
+
46
+ client.chat_postMessage(
47
+ channel: '#general'
48
+ blocks: blocks.map(&:to_h)
49
+ )
50
+ ```
51
+
52
+ The current examples that Slack's BlockKit Builder provides have been reproduced under [examples](examples/).
53
+
54
+ ## Development
55
+
56
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
57
+
58
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
59
+
60
+ ## Contributing
61
+
62
+ Bug reports and pull requests are welcome on GitHub at https://github.com/saraid/slack-block-kit.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "slack-block-kit"
5
+
6
+ include Slack::BlockKit::ExecutionContext
7
+
8
+ def pbpaste
9
+ require 'json'
10
+ puts JSON.pretty_generate eval(`pbpaste`).map(&:to_h).yield_self { |h| { blocks: h } }
11
+ end
12
+
13
+ def to_json(array)
14
+ require 'json'
15
+ puts JSON.pretty_generate Array(array).map(&:to_h).yield_self { |h| { blocks: h } }
16
+ end
17
+
18
+ # You can add fixtures and/or initialization code here to make experimenting
19
+ # with your gem easier. You can also use a different console, if you like.
20
+
21
+ # (If you use this, don't forget to add pry to your Gemfile!)
22
+ # require "pry"
23
+ # Pry.start
24
+
25
+ require "irb"
26
+ require "irb/completion"
27
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,46 @@
1
+ [ SectionBlock[text: Text[mrkdwn: [
2
+ "Hello, Assistant to the Regional Manager Dwight! #{Bold['Michael Scott']} wants to know where you'd like to take the Paper Company investors to dinner tonight.",
3
+ nil,
4
+ " #{Bold['Please select a restaurant:']}"
5
+ ]]],
6
+ DividerBlock[],
7
+ SectionBlock[
8
+ text: Text[mrkdwn: [
9
+ Bold['Farmhouse Thai Cuisine'],
10
+ ':star::star::star::star: 1528 reviews',
11
+ ' They do have some vegan options, like the roti and curry, plus they have a ton of salad stuff and noodles can be ordered without meat!! They have something for everyone here'
12
+ ]],
13
+ accessory: ImageElement[
14
+ image_url: "https://s3-media3.fl.yelpcdn.com/bphoto/c7ed05m9lC2EmA3Aruue7A/o.jpg",
15
+ alt_text: "alt text for image"
16
+ ]
17
+ ],
18
+ SectionBlock[
19
+ text: Text[mrkdwn: [
20
+ Bold['Kin Khao'],
21
+ ':star::star::star::star: 1638 reviews',
22
+ ' The sticky rice also goes wonderfully with the caramelized pork belly, which is absolutely melt-in-your-mouth and so soft.'
23
+ ]],
24
+ accessory: ImageElement[
25
+ image_url: "https://s3-media2.fl.yelpcdn.com/bphoto/korel-1YjNtFtJlMTaC26A/o.jpg",
26
+ alt_text: "alt text for image"
27
+ ]
28
+ ],
29
+ SectionBlock[
30
+ text: Text[mrkdwn: [
31
+ Bold['Ler Ros'],
32
+ ':star::star::star::star: 2082 reviews',
33
+ ' I would really recommend the Yum Koh Moo Yang - Spicy lime dressing and roasted quick marinated pork shoulder, basil leaves, chili & rice powder.'
34
+ ]],
35
+ accessory: ImageElement[
36
+ image_url: "https://s3-media2.fl.yelpcdn.com/bphoto/DawwNigKJ2ckPeDeDM7jAg/o.jpg",
37
+ alt_text: "alt text for image"
38
+ ]
39
+ ],
40
+ DividerBlock[],
41
+ ActionsBlock[elements: [
42
+ ButtonElement[text: Text[plain_text: 'Farmhouse', emoji: true], value: 'click_me_123'],
43
+ ButtonElement[text: Text[plain_text: 'Kin Khao', emoji: true], value: 'click_me_123'],
44
+ ButtonElement[text: Text[plain_text: 'Ler Ros', emoji: true], value: 'click_me_123']
45
+ ]]
46
+ ]
@@ -0,0 +1,22 @@
1
+ [ SectionBlock[text: Text[mrkdwn: [
2
+ "You have a new request:",
3
+ Bold[Link['fakeLink.toEmployeeProfile.com', 'Fred Enriquez - New device request']]
4
+ ]]],
5
+ SectionBlock[fields: [
6
+ Text[mrkdwn: [Bold['Type:'], 'Computer (laptop)']],
7
+ Text[mrkdwn: [Bold['When:'], 'Submitted Aut 10']],
8
+ Text[mrkdwn: [Bold['Last Update:'], 'Mar 10, 2015 (3 years, 5 months)']],
9
+ Text[mrkdwn: [Bold['Reason:'], "All vowel keys aren't working."]],
10
+ Text[mrkdwn: [Bold['Specs:'], '"Cheetah Pro 15" - Fast, really fast"']]
11
+ ]],
12
+ ActionsBlock[elements: [
13
+ ButtonElement[
14
+ text: Text[plain_text: 'Approve', emoji: true],
15
+ style: 'primary', value: 'click_me_123'
16
+ ],
17
+ ButtonElement[
18
+ text: Text[plain_text: 'Deny', emoji: true],
19
+ style: 'danger', value: 'click_me_123'
20
+ ]
21
+ ]]
22
+ ]
@@ -0,0 +1,28 @@
1
+ [ SectionBlock[text: Text[mrkdwn: [
2
+ "You have a new request:",
3
+ Bold[Link['google.com', 'Fred Enriquez - Time Off request']]
4
+ ]]],
5
+ SectionBlock[
6
+ text: Text[mrkdwn: [
7
+ Bold['Type:'], 'Paid time off',
8
+ Bold['When:'], 'Aug 10-Aug 13',
9
+ "#{Bold['Hours:']} 16.0 (2 days)",
10
+ "#{Bold['Remaining balance:']} 32.0 hours (4 days)",
11
+ "#{Bold['Comments:']} \"Family in town, going camping!\""
12
+ ]],
13
+ accessory: ImageElement[
14
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/approvalsNewDevice.png",
15
+ alt_text: "computer thumbnail"
16
+ ]
17
+ ],
18
+ ActionsBlock[elements: [
19
+ ButtonElement[
20
+ text: Text[plain_text: 'Approve', emoji: true],
21
+ style: 'primary', value: 'click_me_123'
22
+ ],
23
+ ButtonElement[
24
+ text: Text[plain_text: 'Deny', emoji: true],
25
+ style: 'danger', value: 'click_me_123'
26
+ ]
27
+ ]]
28
+ ]
@@ -0,0 +1,57 @@
1
+ [ SectionBlock[
2
+ text: Text[plain_text: 'Looks like you have a scheduling conflict with this event:', emoji: true]
3
+ ],
4
+ DividerBlock[],
5
+ SectionBlock[
6
+ text: Text[mrkdwn: [
7
+ Bold[Link['fakeLink.toUserProfiles.com', 'Iris / Zelda 1-1']],
8
+ "Tuesday, January 21 4:00-4:30pm",
9
+ "Building 2 - Havarti Cheese (3)",
10
+ "2 guests"
11
+ ]],
12
+ accessory: ImageElement[
13
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/notifications.png",
14
+ alt_text: "calendar thumbnail"
15
+ ]
16
+ ],
17
+ ContextBlock[elements: [
18
+ ImageElement[
19
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/notificationsWarningIcon.png",
20
+ alt_text: "notifications warning icon"
21
+ ],
22
+ Text[mrkdwn: Bold["Conflicts with Team Huddle: 4:15-4:30pm"]]
23
+ ]],
24
+ DividerBlock[],
25
+ SectionBlock[text: Text[mrkdwn: Bold['Propose a new time:']]],
26
+ SectionBlock[
27
+ text: Text[mrkdwn: [
28
+ Bold['Today - 4:30-5pm'],
29
+ "Everyone is available: @iris, @zelda"
30
+ ]],
31
+ accessory: ButtonElement[
32
+ text: Text[plain_text: "Choose", emoji: true],
33
+ value: "click_me_123"
34
+ ]
35
+ ],
36
+ SectionBlock[
37
+ text: Text[mrkdwn: [
38
+ Bold['Tomorrow - 4-4:30pm'],
39
+ "Everyone is available: @iris, @zelda"
40
+ ]],
41
+ accessory: ButtonElement[
42
+ text: Text[plain_text: "Choose", emoji: true],
43
+ value: "click_me_123"
44
+ ]
45
+ ],
46
+ SectionBlock[
47
+ text: Text[mrkdwn: [
48
+ Bold['Tomorrow - 6-6:30pm'],
49
+ "Some people aren't available: @iris, #{Strike['@zelda']}"
50
+ ]],
51
+ accessory: ButtonElement[
52
+ text: Text[plain_text: "Choose", emoji: true],
53
+ value: "click_me_123"
54
+ ]
55
+ ],
56
+ SectionBlock[text: Text[mrkdwn: Bold[Link['fakelink.ToMoreTimes.com', 'Show more times']]]]
57
+ ]
@@ -0,0 +1,29 @@
1
+ [ SectionBlock[text: Text[mrkdwn: [
2
+ "Hey there :wave: I'm TaskBot. I'm here to help you create and manage tasks in Slack.",
3
+ "There are two ways to quickly create tasks:"
4
+ ]]],
5
+ SectionBlock[text: Text[mrkdwn: [
6
+ "#{Bold[":one: Use the #{Code['/task']} command"]}. Type #{Code['/task']} followed by a short description of your tasks and I'll ask for a due date (if applicable). Try it out by using the #{Code['/task']} command in this channel."
7
+ ]]],
8
+ SectionBlock[text: Text[mrkdwn: [
9
+ "#{Bold[":two: Use the #{Italic['Create a Task']} action."]} If you want to create a task from a message, select #{Code['Create a Task']} in a message's context menu. Try it out by selecting the #{Italic['Create a Task']} action for this message (shown below)."
10
+ ]]],
11
+ ImageBlock[
12
+ title: Text[plain_text: "image1", emoji: true],
13
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/onboardingComplex.jpg",
14
+ alt_text: "image1"
15
+ ],
16
+ SectionBlock[
17
+ text: Text[mrkdwn: ":heavy_plus_sign: To start tracking your team's tasks, #{Bold['add me to a channel']} and I'll introduce myself. I'm usually added to a team or project channel. Type #{Code['/invite @TaskBot']} from the channel or pick a channel on the right."],
18
+ accessory: ConversationsSelectElement[
19
+ placeholder: Text[plain_text: 'Select a channel...', emoji: true]
20
+ ]
21
+ ],
22
+ DividerBlock[],
23
+ ContextBlock[elements: [
24
+ Text[mrkdwn: [
25
+ ":eyes: View all tasks with #{Code['/task list']}",
26
+ ":question: Get help at any time with #{Code['/task help']} or type #{Bold['help']} in a DM with me"
27
+ ]]
28
+ ]]
29
+ ]
@@ -0,0 +1,12 @@
1
+ [ SectionBlock[text: Text[mrkdwn: 'Hi David :wave:']],
2
+ SectionBlock[text: Text[mrkdwn: "Great to see you here! App helps you to stay up-to-date with your meetings and events right here within Slack. These are just a few things which you will be able to do:"]],
3
+ SectionBlock[text: Text[mrkdwn: [
4
+ "• Schedule meetings ",
5
+ " • Manage and update attendees ",
6
+ " • Get notified about changes of your meetings"
7
+ ]]],
8
+ SectionBlock[text: Text[mrkdwn: "But before you can do all these amazing things, we need you to connect your calendar to App. Simply click the button below:"]],
9
+ ActionsBlock[elements: [
10
+ ButtonElement[text: Text[plain_text: 'Connect account', emoji: true], value: 'click_me_123']
11
+ ]]
12
+ ]
@@ -0,0 +1,53 @@
1
+ [ SectionBlock[text: Text[mrkdwn: "#{Bold['Where should we order lunch from?']} Poll by #{Link['fakeLink.toUser.com', 'Mark']}"]],
2
+ DividerBlock[],
3
+ SectionBlock[
4
+ text: Text[mrkdwn: [
5
+ ":sushi: #{Bold['Ace Wasabi Rock-n-Roll Sushi Bar']}",
6
+ "The best landlocked sushi restaurant."
7
+ ]],
8
+ accessory: ButtonElement[text: Text[plain_text: 'Vote', emoji: true], value: 'click_me_123']
9
+ ],
10
+ ContextBlock[elements: [
11
+ ImageElement[
12
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/profile_1.png",
13
+ alt_text: "Michael Scott"
14
+ ],
15
+ ImageElement[
16
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/profile_2.png",
17
+ alt_text: "Dwight Schrute"
18
+ ],
19
+ ImageElement[
20
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/profile_3.png",
21
+ alt_text: "Pam Beasely"
22
+ ],
23
+ Text[plain_text: "3 votes", emoji: true]
24
+ ]],
25
+ SectionBlock[
26
+ text: Text[mrkdwn: [
27
+ ":hamburger: #{Bold['Super Hungryman Hamburgers']}",
28
+ "Only for the hungriest of the hungry."
29
+ ]],
30
+ accessory: ButtonElement[text: Text[plain_text: 'Vote', emoji: true], value: 'click_me_123']
31
+ ],
32
+ ContextBlock[elements: [
33
+ ImageElement[
34
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/profile_4.png",
35
+ alt_text: "Angela"
36
+ ],
37
+ ImageElement[
38
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/profile_2.png",
39
+ alt_text: "Dwight Schrute"
40
+ ],
41
+ Text[plain_text: "2 votes", emoji: true]
42
+ ]],
43
+ SectionBlock[
44
+ text: Text[mrkdwn: [
45
+ ":ramen: #{Bold['Kagawa-Ya Udon Noodle Shop']}",
46
+ "Do you like to shop for noodles? We have noodles."
47
+ ]],
48
+ accessory: ButtonElement[text: Text[plain_text: 'Vote', emoji: true], value: "click_me_123"]
49
+ ],
50
+ ContextBlock[elements: [Text[mrkdwn: 'No votes']]],
51
+ DividerBlock[],
52
+ ActionsBlock[elements: [ButtonElement[text: Text[plain_text: 'Add a suggestion', emoji: true], value: 'click_me_123']]]
53
+ ]
@@ -0,0 +1,74 @@
1
+ [ SectionBlock[
2
+ text: Text[mrkdwn: "We found #{Bold['205 Hotels']} in New Orleans, LA from #{Bold['12/14 to 12/17']}"],
3
+ accessory: OverflowElement[options: [
4
+ Option[text: Text[plain_text: 'Option One', emoji: true], value: 'value-0'],
5
+ Option[text: Text[plain_text: 'Option Two', emoji: true], value: 'value-1'],
6
+ Option[text: Text[plain_text: 'Option Three', emoji: true], value: 'value-2'],
7
+ Option[text: Text[plain_text: 'Option Four', emoji: true], value: 'value-3'],
8
+ ]]
9
+ ],
10
+ DividerBlock[],
11
+ SectionBlock[
12
+ text: Text[mrkdwn: [
13
+ Bold[Link['fakeLink.toHotelPage.com', 'Windsor Court Hotel']],
14
+ '★★★★★',
15
+ '$340 per night',
16
+ 'Rated: 9.4 - Excellent'
17
+ ]],
18
+ accessory: ImageElement[
19
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/tripAgent_1.png",
20
+ alt_text: "Windsor Court Hotel thumbnail"
21
+ ]
22
+ ],
23
+ ContextBlock[elements: [
24
+ ImageElement[
25
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/tripAgentLocationMarker.png",
26
+ alt_text: "Location Pin Icon"
27
+ ],
28
+ Text[plain_text: "Location: Central Business District", emoji: true]
29
+ ]],
30
+ DividerBlock[],
31
+ SectionBlock[
32
+ text: Text[mrkdwn: [
33
+ Bold[Link['fakeLink.toHotelPage.com', 'The Ritz-Carlton New Orleans']],
34
+ '★★★★★',
35
+ '$340 per night',
36
+ 'Rated: 9.1 - Excellent'
37
+ ]],
38
+ accessory: ImageElement[
39
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/tripAgent_2.png",
40
+ alt_text: "Ritz-Carlton New Orleans thumbnail"
41
+ ]
42
+ ],
43
+ ContextBlock[elements: [
44
+ ImageElement[
45
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/tripAgentLocationMarker.png",
46
+ alt_text: "Location Pin Icon"
47
+ ],
48
+ Text[plain_text: "Location: French Quarter", emoji: true]
49
+ ]],
50
+ DividerBlock[],
51
+ SectionBlock[
52
+ text: Text[mrkdwn: [
53
+ Bold[Link['fakeLink.toHotelPage.com', 'Omni Royal Orleans Hotel']],
54
+ '★★★★★',
55
+ '$419 per night',
56
+ 'Rated: 8.8 - Excellent'
57
+ ]],
58
+ accessory: ImageElement[
59
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/tripAgent_3.png",
60
+ alt_text: "Omni Royal Orleans Hotel thumbnail"
61
+ ]
62
+ ],
63
+ ContextBlock[elements: [
64
+ ImageElement[
65
+ image_url: "https://api.slack.com/img/blocks/bkb_template_images/tripAgentLocationMarker.png",
66
+ alt_text: "Location Pin Icon"
67
+ ],
68
+ Text[plain_text: "Location: French Quarter", emoji: true]
69
+ ]],
70
+ DividerBlock[],
71
+ ActionsBlock[elements: [
72
+ ButtonElement[text: Text[plain_text: 'Next 2 Results', emoji: true], value: 'click_me_123']
73
+ ]]
74
+ ]