yammer-client 0.1.2 → 0.1.3
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.
- data.tar.gz.sig +0 -0
- data/.travis.yml +1 -0
- data/CHANGELOG.md +22 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +3 -4
- data/README.md +11 -10
- data/file.txt +1 -0
- data/lib/yammer.rb +7 -11
- data/lib/yammer/api.rb +2 -1
- data/lib/yammer/api/autocomplete.rb +1 -1
- data/lib/yammer/api/group.rb +5 -5
- data/lib/yammer/api/group_membership.rb +2 -2
- data/lib/yammer/api/message.rb +13 -13
- data/lib/yammer/api/network.rb +1 -1
- data/lib/yammer/api/notification.rb +1 -1
- data/lib/yammer/api/pending_attachment.rb +48 -0
- data/lib/yammer/api/search.rb +1 -1
- data/lib/yammer/api/topic.rb +1 -1
- data/lib/yammer/api/user.rb +17 -17
- data/lib/yammer/api_handler.rb +15 -0
- data/lib/yammer/{response.rb → api_response.rb} +6 -6
- data/lib/yammer/base.rb +19 -11
- data/lib/yammer/client.rb +27 -42
- data/lib/yammer/configurable.rb +14 -8
- data/lib/yammer/group.rb +1 -1
- data/lib/yammer/group_membership.rb +1 -1
- data/lib/yammer/http_adapter.rb +74 -0
- data/lib/yammer/message.rb +1 -1
- data/lib/yammer/thread.rb +1 -1
- data/lib/yammer/user.rb +6 -6
- data/lib/yammer/version.rb +1 -1
- data/spec/api/autocomplete_spec.rb +1 -2
- data/spec/api/group_membership_spec.rb +1 -2
- data/spec/api/group_spec.rb +1 -2
- data/spec/api/message_spec.rb +1 -2
- data/spec/api/network_spec.rb +1 -2
- data/spec/api/notification_spec.rb +3 -4
- data/spec/api/pending_attachment_spec.rb +37 -0
- data/spec/api/search_spec.rb +1 -2
- data/spec/api/thread_spec.rb +1 -2
- data/spec/api/topic_spec.rb +1 -2
- data/spec/api/user_spec.rb +15 -2
- data/spec/{response_spec.rb → api_response.rb} +9 -8
- data/spec/client_spec.rb +203 -66
- data/spec/fixtures/users_followed.json +1 -0
- data/spec/fixtures/users_following.json +1 -0
- data/spec/http_adapter_spec.rb +90 -0
- data/spec/mocks/attachment.txt +1 -0
- data/spec/model/base_spec.rb +26 -5
- data/spec/model/group_membership_spec.rb +11 -0
- data/spec/model/group_spec.rb +10 -0
- data/spec/model/message_spec.rb +10 -0
- data/spec/model/thread_spec.rb +6 -0
- data/spec/model/user_spec.rb +53 -0
- data/spec/spec_helper.rb +8 -0
- data/yammer.gemspec +3 -1
- metadata +35 -10
- metadata.gz.sig +0 -0
- data/lib/yammer/http_connection.rb +0 -184
- data/lib/yammer/model.rb +0 -6
- data/spec/connection_spec.rb +0 -306
data.tar.gz.sig
CHANGED
Binary file
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
0.1.3
|
2
|
+
====================================
|
3
|
+
- Added Support for pending attachments
|
4
|
+
- More tests coverage
|
5
|
+
- Cleaned up Client class
|
6
|
+
- Switched to RestClient for HTTP requests
|
7
|
+
- Made changes to model base to get more stability
|
8
|
+
|
9
|
+
0.1.2
|
10
|
+
====================================
|
11
|
+
|
12
|
+
- Made object model more stable
|
13
|
+
- Updated README
|
14
|
+
- Cleaned up tests
|
15
|
+
|
16
|
+
0.1.1
|
17
|
+
====================================
|
18
|
+
- Support for more endpoints
|
19
|
+
|
20
|
+
0.1.0
|
21
|
+
====================================
|
22
|
+
Initial commit
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
yammer-client (0.1.
|
4
|
+
yammer-client (0.1.3)
|
5
5
|
addressable (~> 2.3.3)
|
6
6
|
multi_json (~> 1.3)
|
7
7
|
oauth2-client (~> 1.1.2)
|
8
8
|
oj (~> 2.0.10)
|
9
|
+
rest-client (~> 1.6.7)
|
9
10
|
|
10
11
|
GEM
|
11
12
|
remote: https://rubygems.org/
|
@@ -21,14 +22,13 @@ GEM
|
|
21
22
|
thor
|
22
23
|
crack (0.3.2)
|
23
24
|
diff-lcs (1.2.1)
|
24
|
-
json (1.7.5)
|
25
25
|
mime-types (1.21)
|
26
26
|
multi_json (1.6.1)
|
27
27
|
oauth2-client (1.1.2)
|
28
28
|
addressable
|
29
29
|
bcrypt-ruby (~> 3.0.0)
|
30
30
|
oj (2.0.10)
|
31
|
-
rake (10.0.
|
31
|
+
rake (10.0.4)
|
32
32
|
rest-client (1.6.7)
|
33
33
|
mime-types (>= 1.16)
|
34
34
|
rspec (2.13.0)
|
@@ -53,7 +53,6 @@ PLATFORMS
|
|
53
53
|
|
54
54
|
DEPENDENCIES
|
55
55
|
coveralls
|
56
|
-
json
|
57
56
|
rake
|
58
57
|
rspec (>= 2.11)
|
59
58
|
simplecov
|
data/README.md
CHANGED
@@ -89,7 +89,7 @@ To view the current state of the client use the `options` method
|
|
89
89
|
require 'yammer'
|
90
90
|
|
91
91
|
Yammer.options
|
92
|
-
#> {:site_url=>"https://www.yammer.com", :client_id=>nil, :client_secret=>nil, :access_token=>nil, :http_adapter=>Yammer::
|
92
|
+
#> {:site_url=>"https://www.yammer.com", :client_id=>nil, :client_secret=>nil, :access_token=>nil, :http_adapter=>Yammer::Connection, :connection_options=>{:max_redirects=>5, :use_ssl=>true}}
|
93
93
|
```
|
94
94
|
|
95
95
|
You may change this configuration by using the `configure` method
|
@@ -107,7 +107,7 @@ At this point, your new settings will take effect
|
|
107
107
|
|
108
108
|
```ruby
|
109
109
|
Yammer.options
|
110
|
-
#> {:site_url=>"https://www.yammer.com", :client_id=>'[client_id]', :client_secret=>'[client_secret]', :access_token=>'[access_token]', :http_adapter=>Yammer::
|
110
|
+
#> {:site_url=>"https://www.yammer.com", :client_id=>'[client_id]', :client_secret=>'[client_secret]', :access_token=>'[access_token]', :http_adapter=>Yammer::Connection, :connection_options=>{ :max_redirects=>5, :use_ssl=>true }}
|
111
111
|
```
|
112
112
|
|
113
113
|
## Usage
|
@@ -135,21 +135,21 @@ yamr = Yammer::Client.new(
|
|
135
135
|
|
136
136
|
```ruby
|
137
137
|
yamr.get_user_by_email('user@example.com')
|
138
|
-
#<Yammer::
|
138
|
+
#<Yammer::ApiResponse:0x007fb949434ec8 @headers=#<Net::HTTPOK 200 OK readbody=true>, @body="[JSON Response]", @code=200>
|
139
139
|
```
|
140
140
|
|
141
141
|
*find a user by user id*
|
142
142
|
|
143
143
|
```ruby
|
144
144
|
yamr.get_user('1588')
|
145
|
-
#<Yammer::
|
145
|
+
#<Yammer::ApiResponse:0x007fb949434ec8 @headers=#<Net::HTTPOK 200 OK readbody=true>, @body="[JSON Response]", @code=200>
|
146
146
|
```
|
147
147
|
|
148
148
|
*get the current user*
|
149
149
|
|
150
150
|
```ruby
|
151
151
|
yamr.current_user
|
152
|
-
#<Yammer::
|
152
|
+
#<Yammer::ApiResponse:0x007fb949434ec8 @headers=#<Net::HTTPOK 200 OK readbody=true>, @body="[JSON Response]", @code=200>
|
153
153
|
```
|
154
154
|
|
155
155
|
|
@@ -159,21 +159,21 @@ yamr.current_user
|
|
159
159
|
|
160
160
|
```ruby
|
161
161
|
yamr.create_message(:body => 'status update')
|
162
|
-
#<Yammer::
|
162
|
+
#<Yammer::ApiResponse:0x007fb949434ec8 @headers=#<Net::HTTPOK 200 OK readbody=true>, @body="[JSON Response]", @code=200>
|
163
163
|
```
|
164
164
|
|
165
165
|
*send a private message to another Yammer user*
|
166
166
|
|
167
167
|
```ruby
|
168
168
|
yamr.create_message(:body => 'private message', :direct_to_id => 24)
|
169
|
-
#<Yammer::
|
169
|
+
#<Yammer::ApiResponse:0x007fb949434ec8 @headers=#<Net::HTTPOK 200 OK readbody=true>, @body="[JSON Response]", @code=200>
|
170
170
|
```
|
171
171
|
|
172
172
|
*send a message with an Open Graph Object as an attachment*
|
173
173
|
|
174
174
|
```ruby
|
175
175
|
yamr.create_message(:body => 'here is my open graph object', og_url: "https://www.yammer.com/example/graph/31415926")
|
176
|
-
#<Yammer::
|
176
|
+
#<Yammer::ApiResponse:0x007fb949434ec8 @headers=#<Net::HTTPOK 200 OK readbody=true>, @body="[JSON Response]", @code=200>
|
177
177
|
```
|
178
178
|
|
179
179
|
|
@@ -183,7 +183,7 @@ yamr.create_message(:body => 'here is my open graph object', og_url: "https://ww
|
|
183
183
|
|
184
184
|
```ruby
|
185
185
|
yamr.search(:search => 'thekev', :model_types => 'users;groups')
|
186
|
-
#<Yammer::
|
186
|
+
#<Yammer::ApiResponse:0x007fb949434ec8 @headers=#<Net::HTTPOK 200 OK readbody=true>, @body="[JSON Response]", @code=200>
|
187
187
|
```
|
188
188
|
|
189
189
|
**Thread**
|
@@ -192,7 +192,7 @@ yamr.search(:search => 'thekev', :model_types => 'users;groups')
|
|
192
192
|
|
193
193
|
```ruby
|
194
194
|
yamr.get_thread(42)
|
195
|
-
#<Yammer::
|
195
|
+
#<Yammer::ApiResponse:0x007fb949434ec8 @headers=#<Net::HTTPOK 200 OK readbody=true>, @body="[JSON Response]", @code=200>
|
196
196
|
```
|
197
197
|
|
198
198
|
|
@@ -259,6 +259,7 @@ version:
|
|
259
259
|
* Ruby 1.8.7
|
260
260
|
* Ruby 1.9.2
|
261
261
|
* Ruby 1.9.3
|
262
|
+
* Ruby 2.0.0
|
262
263
|
|
263
264
|
This library may inadvertently work (or seem to work) on other Ruby
|
264
265
|
implementations, however support will only be provided for the versions listed
|
data/file.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
will code for food and money
|
data/lib/yammer.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'yammer/version'
|
2
2
|
require 'yammer/error'
|
3
|
-
require 'yammer/http_connection'
|
4
3
|
require 'yammer/configurable'
|
5
|
-
require 'yammer/
|
4
|
+
require 'yammer/api'
|
5
|
+
require 'yammer/http_adapter'
|
6
6
|
require 'yammer/client'
|
7
|
+
require 'yammer/api_handler'
|
8
|
+
require 'yammer/api_response'
|
7
9
|
require 'yammer/identity_map'
|
8
10
|
require 'yammer/base'
|
9
11
|
require 'yammer/user'
|
@@ -11,23 +13,17 @@ require 'yammer/group'
|
|
11
13
|
require 'yammer/group_membership'
|
12
14
|
require 'yammer/message'
|
13
15
|
require 'yammer/thread'
|
14
|
-
require 'yammer/api'
|
15
16
|
|
16
17
|
module Yammer
|
17
18
|
class << self
|
18
19
|
include Configurable
|
19
|
-
|
20
|
-
def client
|
21
|
-
@client = Yammer::Client.new
|
22
|
-
end
|
20
|
+
include ApiHandler
|
23
21
|
|
24
22
|
private
|
25
|
-
|
26
23
|
def method_missing(method_name, *args, &block)
|
27
|
-
return super unless
|
28
|
-
|
24
|
+
return super unless api_handler.respond_to?(method_name)
|
25
|
+
api_handler.send(method_name, *args, &block)
|
29
26
|
end
|
30
27
|
end
|
31
28
|
end
|
32
|
-
|
33
29
|
Yammer.reset!
|
data/lib/yammer/api.rb
CHANGED
@@ -7,7 +7,7 @@ module Yammer
|
|
7
7
|
# @rate_limited Yes
|
8
8
|
# @authentication authenticated user context
|
9
9
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
10
|
-
# @return [Yammer::
|
10
|
+
# @return [Yammer::ApiResponse]
|
11
11
|
# @param [Hash] opts the options to fetch a thread with
|
12
12
|
# @option opts [String] :prefix
|
13
13
|
# @option opts [String] :models
|
data/lib/yammer/api/group.rb
CHANGED
@@ -6,7 +6,7 @@ module Yammer
|
|
6
6
|
# @rate_limited Yes
|
7
7
|
# @authentication Requires user context
|
8
8
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
9
|
-
# @return [Yammer::
|
9
|
+
# @return [Yammer::ApiResponse]
|
10
10
|
# @param [Hash] opts the opts to fetch a thread with
|
11
11
|
# @option opts [Integer] :page
|
12
12
|
# @option opts [String] :sort_by sort groups by created_on, creator, name default order is by number of messages
|
@@ -21,7 +21,7 @@ module Yammer
|
|
21
21
|
# @rate_limited Yes
|
22
22
|
# @authentication Requires user context
|
23
23
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
24
|
-
# @return [Yammer::
|
24
|
+
# @return [Yammer::ApiResponse]
|
25
25
|
# @param id [Integer] the group ID
|
26
26
|
# @example Fetch data for the thread
|
27
27
|
# Yammer.get_group(74)
|
@@ -33,7 +33,7 @@ module Yammer
|
|
33
33
|
# @rate_limited Yes
|
34
34
|
# @authentication Requires user context
|
35
35
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
36
|
-
# @return [Yammer::
|
36
|
+
# @return [Yammer::ApiResponse]
|
37
37
|
# @param [Hash] opts the opts to fetch a thread with
|
38
38
|
# @option opts [String] :name
|
39
39
|
# @option opts [String] :description
|
@@ -49,7 +49,7 @@ module Yammer
|
|
49
49
|
# @rate_limited Yes
|
50
50
|
# @authentication Requires user context
|
51
51
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
52
|
-
# @return [Yammer::
|
52
|
+
# @return [Yammer::ApiResponse]
|
53
53
|
# @param id [Integer] the group ID
|
54
54
|
# @param [Hash] opts
|
55
55
|
# @option opts [String] :name
|
@@ -66,7 +66,7 @@ module Yammer
|
|
66
66
|
# @rate_limited Yes
|
67
67
|
# @authentication Requires user context
|
68
68
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
69
|
-
# @return [Yammer::
|
69
|
+
# @return [Yammer::ApiResponse]
|
70
70
|
# @param id [Integer] the group ID
|
71
71
|
# @example Fetch data for the thread
|
72
72
|
# Yammer.groups_for_user(74)
|
@@ -7,7 +7,7 @@ module Yammer
|
|
7
7
|
# @rate_limited Yes
|
8
8
|
# @authentication Requires user context
|
9
9
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
10
|
-
# @return [Yammer::
|
10
|
+
# @return [Yammer::ApiResponse]
|
11
11
|
# @param id [Integer] the group membership ID
|
12
12
|
# @example Fetch data for the thread
|
13
13
|
# Yammer.get_group_membership(7)
|
@@ -20,7 +20,7 @@ module Yammer
|
|
20
20
|
# @rate_limited Yes
|
21
21
|
# @authentication Requires user context
|
22
22
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
23
|
-
# @return [Yammer::
|
23
|
+
# @return [Yammer::ApiResponse]
|
24
24
|
# @param id [Integer] the group ID
|
25
25
|
# @example Fetch data for the thread
|
26
26
|
# Yammer.create_group_membership(74)
|
data/lib/yammer/api/message.rb
CHANGED
@@ -7,7 +7,7 @@ module Yammer
|
|
7
7
|
# @rate_limited Yes
|
8
8
|
# @authentication Requires user context
|
9
9
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
10
|
-
# @return [Yammer::
|
10
|
+
# @return [Yammer::ApiResponse]
|
11
11
|
# @param [Hash] opts the options to fetch a thread with
|
12
12
|
# @option opts [Integer] :newer_than
|
13
13
|
# @example Fetch data for the thread
|
@@ -21,7 +21,7 @@ module Yammer
|
|
21
21
|
# @rate_limited Yes
|
22
22
|
# @authentication Requires user context
|
23
23
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
24
|
-
# @return [Yammer::
|
24
|
+
# @return [Yammer::ApiResponse]
|
25
25
|
# @param id [Integer] the thread ID
|
26
26
|
# @param [Hash] opts the options to fetch a thread with
|
27
27
|
# @option opts [Integer] :newer_than
|
@@ -36,7 +36,7 @@ module Yammer
|
|
36
36
|
# @rate_limited Yes
|
37
37
|
# @authentication Requires user context
|
38
38
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
39
|
-
# @return [Yammer::
|
39
|
+
# @return [Yammer::ApiResponse]
|
40
40
|
# @param id [Integer] the thread ID
|
41
41
|
# @param [Hash] opts the options to fetch a thread with
|
42
42
|
# @option opts [Integer] :newer_than
|
@@ -51,7 +51,7 @@ module Yammer
|
|
51
51
|
# @rate_limited Yes
|
52
52
|
# @authentication Requires user context
|
53
53
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
54
|
-
# @return [Yammer::
|
54
|
+
# @return [Yammer::ApiResponse]
|
55
55
|
# @param [Hash] opts the options to fetch a thread with
|
56
56
|
# @option opts [Integer] :newer_than
|
57
57
|
# @example Fetch data for the thread
|
@@ -65,7 +65,7 @@ module Yammer
|
|
65
65
|
# @rate_limited Yes
|
66
66
|
# @authentication Requires user context
|
67
67
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
68
|
-
# @return [Yammer::
|
68
|
+
# @return [Yammer::ApiResponse]
|
69
69
|
# @param [Hash] opts the options to fetch a thread with
|
70
70
|
# @option opts [Integer] :newer_than
|
71
71
|
# @example Fetch data for the thread
|
@@ -79,7 +79,7 @@ module Yammer
|
|
79
79
|
# @rate_limited Yes
|
80
80
|
# @authentication Requires user context
|
81
81
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
82
|
-
# @return [Yammer::
|
82
|
+
# @return [Yammer::ApiResponse]
|
83
83
|
# @param [Hash] opts the options to fetch a thread with
|
84
84
|
# @option opts [Integer] :newer_than
|
85
85
|
# @example Fetch data for the thread
|
@@ -93,7 +93,7 @@ module Yammer
|
|
93
93
|
# @rate_limited Yes
|
94
94
|
# @authentication Requires user context
|
95
95
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
96
|
-
# @return [Yammer::
|
96
|
+
# @return [Yammer::ApiResponse]
|
97
97
|
# @param [Hash] opts the options to fetch a thread with
|
98
98
|
# @option opts [Integer] :newer_than
|
99
99
|
# @example Fetch data for the thread
|
@@ -107,7 +107,7 @@ module Yammer
|
|
107
107
|
# @rate_limited Yes
|
108
108
|
# @authentication Requires user context
|
109
109
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
110
|
-
# @return [Yammer::
|
110
|
+
# @return [Yammer::ApiResponse]
|
111
111
|
# @param [Hash] opts the options to fetch a thread with
|
112
112
|
# @option opts [Integer] :newer_than
|
113
113
|
# @example Fetch data for the thread
|
@@ -121,7 +121,7 @@ module Yammer
|
|
121
121
|
# @rate_limited Yes
|
122
122
|
# @authentication Requires user context
|
123
123
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
124
|
-
# @return [Yammer::
|
124
|
+
# @return [Yammer::ApiResponse]
|
125
125
|
# @param id [Integer] the thread ID
|
126
126
|
# @param [Hash] opts the options to fetch a thread with
|
127
127
|
# @option opts [Integer] :newer_than
|
@@ -136,7 +136,7 @@ module Yammer
|
|
136
136
|
# @rate_limited Yes
|
137
137
|
# @authentication Requires user context
|
138
138
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
139
|
-
# @return [Yammer::
|
139
|
+
# @return [Yammer::ApiResponse]
|
140
140
|
# @param id [Integer] the thread ID
|
141
141
|
# @param [Hash] opts the options to fetch a thread with
|
142
142
|
# @option opts [Integer] :newer_than
|
@@ -151,7 +151,7 @@ module Yammer
|
|
151
151
|
# @rate_limited Yes
|
152
152
|
# @authentication Requires user context
|
153
153
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
154
|
-
# @return [Yammer::
|
154
|
+
# @return [Yammer::ApiResponse]
|
155
155
|
# @param id [Integer] the thread ID
|
156
156
|
# @param [Hash] opts the options to fetch a thread with
|
157
157
|
# @option opts [Integer] :newer_than
|
@@ -166,7 +166,7 @@ module Yammer
|
|
166
166
|
# @rate_limited Yes
|
167
167
|
# @authentication Requires user context
|
168
168
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
169
|
-
# @return [Yammer::
|
169
|
+
# @return [Yammer::ApiResponse]
|
170
170
|
# @param id [Integer] the thread ID
|
171
171
|
# @param [Hash] opts the options to fetch a thread with
|
172
172
|
# @option opts [Integer] :newer_than
|
@@ -181,7 +181,7 @@ module Yammer
|
|
181
181
|
# @rate_limited Yes
|
182
182
|
# @authentication Requires user context
|
183
183
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
184
|
-
# @return [Yammer::
|
184
|
+
# @return [Yammer::ApiResponse]
|
185
185
|
# @param id [Integer] the thread ID
|
186
186
|
# @param [Hash] opts the options to fetch a thread with
|
187
187
|
# @option opts [Integer] :newer_than
|
data/lib/yammer/api/network.rb
CHANGED
@@ -7,7 +7,7 @@ module Yammer
|
|
7
7
|
# @rate_limited Yes
|
8
8
|
# @authentication authenticated user context
|
9
9
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
10
|
-
# @return [Yammer::
|
10
|
+
# @return [Yammer::ApiResponse]
|
11
11
|
# @param [Hash] opts the options to fetch a thread with
|
12
12
|
# @option opts [Boolean] :include_suspended
|
13
13
|
# @option opts [Boolean] :exclude_own_messages_from_unseen
|
@@ -7,7 +7,7 @@ module Yammer
|
|
7
7
|
# @rate_limited Yes
|
8
8
|
# @authentication authenticated user context
|
9
9
|
# @raise [Yammer::Error::Unauthorized] Error raised when supplied user credentials are not valid.
|
10
|
-
# @return [Yammer::
|
10
|
+
# @return [Yammer::ApiResponse]
|
11
11
|
# @example Fetch notifications for authenticated user
|
12
12
|
# Yammer.notifications
|
13
13
|
def notifications
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Yammer
|
2
|
+
module Api
|
3
|
+
module PendingAttachment
|
4
|
+
|
5
|
+
# Create a new pending attachment owned by authenticated user
|
6
|
+
# @see https://developer.yammer.com/restapi/#rest-messages
|
7
|
+
# @api_path /api/v1/pending_attachments
|
8
|
+
# @rate_limited Yes
|
9
|
+
# @authentication User context
|
10
|
+
# @raise [Yammer::Error::Unauthorized Yammer::Error::Forbidden] Error when supplied user credentials are not valid
|
11
|
+
# when user network does not allow attachments
|
12
|
+
# @return [Yammer::ApiResponse]
|
13
|
+
# @example Fetch existing pending attachment
|
14
|
+
# Yammer.get_pending_attachment(62)
|
15
|
+
def get_pending_attachment(id)
|
16
|
+
get("/api/v1/pending_attachments/#{id}")
|
17
|
+
end
|
18
|
+
|
19
|
+
# Delete a pending attachment owned by the authenticated user
|
20
|
+
# @see https://developer.yammer.com/restapi/#rest-messages
|
21
|
+
# @api_path /api/v1/pending_attachments
|
22
|
+
# @rate_limited Yes
|
23
|
+
# @authentication User context
|
24
|
+
# @raise [Yammer::Error::Unauthorized Yammer::Error::NotFound] Error raised when supplied user credentials are not valid
|
25
|
+
# when attachment cannot be found
|
26
|
+
# @return [Yammer::ApiResponse]
|
27
|
+
# @example Delete existing pending attachment
|
28
|
+
# Yammer.delete_pending_attachment(34)
|
29
|
+
def delete_pending_attachment(id)
|
30
|
+
delete("/api/v1/pending_attachments/#{id}")
|
31
|
+
end
|
32
|
+
|
33
|
+
# Fetch a pending attachment owned by authenticated user
|
34
|
+
# @see https://developer.yammer.com/restapi/#rest-messages
|
35
|
+
# @api_path /api/v1/pending_attachments
|
36
|
+
# @rate_limited Yes
|
37
|
+
# @authentication User context
|
38
|
+
# @raise [Yammer::Error::Unauthorized Yammer::Error::NotFound] Error raised when supplied user credentials are not valid
|
39
|
+
# when attachment cannot be found
|
40
|
+
# @return [Yammer::ApiResponse]
|
41
|
+
# @example Create new pending attachment
|
42
|
+
# Yammer.create_pending_attachment
|
43
|
+
def create_pending_attachment(attachment)
|
44
|
+
post("/api/v1/pending_attachments", :attachment => attachment)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|