frontapp 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b7ef8cbd97c8e2e8ea8e9688e0bfabdc7f6a5c9
4
- data.tar.gz: a527bdfcd864d6d2bd086d6c0e4c063f7d21e46b
3
+ metadata.gz: 39e2a2ed37f421a9e27a5d093b6b8edfabefe858
4
+ data.tar.gz: 11239032440cc8d9d85fc008944180325ed8c0f0
5
5
  SHA512:
6
- metadata.gz: 6a4ff932cc6d255323210d38cb9fe1a40d56af5101920d3f03299412efa50417e16b3ea3cc00237f36ec4875b95f3aeb8fa00686228ce49a3f91700f04805e97
7
- data.tar.gz: 88a1cf071c6e3e202e18efb24660d36d301b8fdd5ac6cd5323342f9c56466a9e33173bd13b1eccd4f9389c75c1c82e7238915835bf1fc23ede98f2577c535d16
6
+ metadata.gz: 4dcb5247a8e1efc3b367fe0f71852eb4c1676a7544446f640abe791d6c0b5b33c0f5ae26208d9f320ac9b95bd015b9f0ea2d08928952485f19eb1cf010b7f40e
7
+ data.tar.gz: 026dad6c0c6fd6ad2f5cfab7cf943f8dcf17174704f3f9b261e8ce4256eb41aeb3141c53017f53ad672bc1400233d39fb5f47031d642183a8e8cf18f02cb0ffe
@@ -15,6 +15,7 @@ require_relative 'client/tags.rb'
15
15
  require_relative 'client/teammates.rb'
16
16
  require_relative 'client/teams.rb'
17
17
  require_relative 'client/topics.rb'
18
+ require_relative 'client/links.rb'
18
19
  require_relative 'client/exports.rb'
19
20
  require_relative 'error'
20
21
  require_relative 'version'
@@ -36,6 +37,7 @@ module Frontapp
36
37
  include Frontapp::Client::Teammates
37
38
  include Frontapp::Client::Teams
38
39
  include Frontapp::Client::Topics
40
+ include Frontapp::Client::Links
39
41
  include Frontapp::Client::Exports
40
42
 
41
43
  def initialize(options={})
@@ -70,6 +70,29 @@ module Frontapp
70
70
  def get_conversation_messages(conversation_id)
71
71
  list("conversations/#{conversation_id}/messages")
72
72
  end
73
+
74
+ # Parameters
75
+ # Name Type Description
76
+ # ----------------------------------------------
77
+ # conversation_id string The conversation Id
78
+ # link_ids array (optional) Link IDs to add Either link_ids or link_external_urls must be specified but not both
79
+ # link_external_urls array (optional) Link external urls to add. Creates links if necessary. Either link_ids or link_external_urls must be specified but not both
80
+ # ----------------------------------------------
81
+ def add_conversation_links!(conversation_id, params = {})
82
+ cleaned = params.permit(:link_ids, :link_external_urls)
83
+ create_without_response("conversations/#{conversation_id}/links", cleaned)
84
+ end
85
+
86
+ # Parameters
87
+ # Name Type Description
88
+ # ----------------------------------------------
89
+ # conversation_id string The conversation Id
90
+ # link_ids array of strings link IDs to remove
91
+ # ----------------------------------------------
92
+ def remove_conversation_links!(conversation_id, params = {})
93
+ cleaned = params.permit(:link_ids)
94
+ delete("conversations/#{conversation_id}/links", cleaned)
95
+ end
73
96
  end
74
97
  end
75
- end
98
+ end
@@ -0,0 +1,64 @@
1
+ module Frontapp
2
+ class Client
3
+ module Links
4
+
5
+ def links(params = {})
6
+ cleaned = params.permit({ q: [:statuses] })
7
+ list("links", cleaned)
8
+ end
9
+
10
+ # Parameters
11
+ # Name Type Description
12
+ # -------------------------------
13
+ # link_id string Id of the requested link
14
+ # -------------------------------
15
+ def get_link(link_id)
16
+ get("links/#{link_id}")
17
+ end
18
+
19
+ # Allowed attributes:
20
+ # Name Type Description
21
+ # ------------------------------------
22
+ # name string (optional) Name of the link. If none is specified, the external_url is used as a default
23
+ # external_url string Underlying identifying link/url of the link
24
+ # ------------------------------------
25
+ def create_link!(params = {})
26
+ cleaned = params.permit(:name, :external_url)
27
+ create("links", cleaned)
28
+ end
29
+
30
+ # Parameters
31
+ # Name Type Description
32
+ # -----------------------------
33
+ # link_id string Id of the requested link
34
+ # -----------------------------
35
+ #
36
+ # Allowed attributes:
37
+ # Name Type Description
38
+ # ------------------------------------
39
+ # name string New name of the link
40
+ # ------------------------------------
41
+ def update_link!(link_id, params = {})
42
+ cleaned = params.permit(:name)
43
+ update("links/#{link_id}", cleaned)
44
+ end
45
+
46
+ # Parameters
47
+ # Name Type Description
48
+ # -----------------------------
49
+ # link_id string Id of the requested link
50
+ # -----------------------------
51
+ #
52
+ # Allowed params:
53
+ # Name Type Description
54
+ # ------------------------------------------
55
+ # q object (optional) Search query.
56
+ # q.statuses array (optional) List of the statuses of the conversations you want to list
57
+ # ------------------------------------------
58
+ def get_link_conversations(link_id, params = {})
59
+ cleaned = params.permit({ q: [:statuses] })
60
+ list("links/#{link_id}/conversations", cleaned)
61
+ end
62
+ end
63
+ end
64
+ end
@@ -15,9 +15,10 @@ module Frontapp
15
15
  # q.statuses array (optional) List of the statuses of the conversations you want to list
16
16
  # ------------------------------------------
17
17
  def get_topic_conversations(topic_id, params = {})
18
- cleaned = params.permit({ q: [:statuses] })
19
- list("topics/#{topic_id}/conversations", cleaned)
18
+ warn "[DEPRECATION] `Topics` is deprecated. Please use `Links` instead."
19
+
20
+ get_link_conversations(topic_id, params)
20
21
  end
21
22
  end
22
23
  end
23
- end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Frontapp
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frontapp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niels van der Zanden
@@ -83,6 +83,7 @@ files:
83
83
  - lib/frontapp/client/events.rb
84
84
  - lib/frontapp/client/exports.rb
85
85
  - lib/frontapp/client/inboxes.rb
86
+ - lib/frontapp/client/links.rb
86
87
  - lib/frontapp/client/messages.rb
87
88
  - lib/frontapp/client/rules.rb
88
89
  - lib/frontapp/client/tags.rb