desk_api_v2 0.0.2 → 0.0.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.
- checksums.yaml +8 -8
- data/desk_api_v2.gemspec +1 -1
- data/lib/desk.rb +4 -0
- data/lib/desk/api/companies.rb +0 -1
- data/lib/desk/api/custom_fields.rb +19 -0
- data/lib/desk/api/customers.rb +0 -3
- data/lib/desk/api/facebook_users.rb +19 -0
- data/lib/desk/api/filters.rb +23 -0
- data/lib/desk/api/inbound_mailboxes.rb +19 -0
- data/lib/desk/client.rb +24 -0
- data/lib/desk/custom_field.rb +7 -0
- data/lib/desk/facebook_user.rb +7 -0
- data/lib/desk/inbound_mailbox.rb +7 -0
- data/spec/desk/api/companies_spec.rb +3 -3
- data/spec/desk/api/custom_fields_spec.rb +32 -0
- data/spec/desk/api/customers_spec.rb +0 -11
- data/spec/desk/api/facebook_users_spec.rb +32 -0
- data/spec/desk/api/filters_spec.rb +44 -0
- data/spec/desk/api/inbound_mailboxes_spec.rb +31 -0
- data/spec/fixtures/custom_field.json +15 -0
- data/spec/fixtures/custom_fields.json +58 -0
- data/spec/fixtures/facebook_user.json +16 -0
- data/spec/fixtures/facebook_users.json +55 -0
- data/spec/fixtures/filter.json +15 -0
- data/spec/fixtures/filters.json +53 -0
- data/spec/fixtures/inbound_mailbox.json +24 -0
- data/spec/fixtures/inbound_mailboxes.json +71 -0
- metadata +21 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjgyM2NiMzY1OTc4ZDdkNDEzMTM3NTViZjUyMTNkOWM3NzYwMWJmMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODQ0ZTM4ZWQyMDU1ZmExYTUwNDJlNDEyNWE4OTQyMTYzZWEwOWY5Ng==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MzgzYjgzMmY1NjgyNjMwODcyODA1YjY1NGEzMWMxMDEzODc3NjQzODc1ZDJl
|
10
|
+
YmNjZGJmZTc2OWJlNjUzNDExYjkzMGYyNDljN2M2MTg3NjNmYmJhMmYzODc4
|
11
|
+
OGY2ZjI2MjFkZTE1YTlmMmMyNjZhODg4YjI2ZWNkYTVkODhiMmU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmViODZkZTk4MGQzZGY0YTYwN2I1OGVhMjIyZjQzZDBmMDFlNGJhZWY4OTVk
|
14
|
+
ZTgxODhmODMwZWM2MTM1MTM3NjhmY2JjZTBkNTE5NTEwNmExYjEyOTYwOGNi
|
15
|
+
ZjY1YTQxYmI3NjdlY2FkZGZiNjJlZmRhMzhhN2Q1YzNlZGY2ZTk=
|
data/desk_api_v2.gemspec
CHANGED
data/lib/desk.rb
CHANGED
data/lib/desk/api/companies.rb
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'desk/api/modules/listable'
|
2
|
+
require 'desk/custom_field'
|
3
|
+
|
4
|
+
module Desk
|
5
|
+
module Api
|
6
|
+
class CustomFields
|
7
|
+
|
8
|
+
include Desk::Api::Listable
|
9
|
+
|
10
|
+
attr_reader :connection, :endpoint, :return_class
|
11
|
+
|
12
|
+
def initialize(connection)
|
13
|
+
@connection = connection
|
14
|
+
@endpoint = "custom_fields"
|
15
|
+
@return_class = Desk::CustomField
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/desk/api/customers.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
require 'active_support/core_ext/hash'
|
2
1
|
require 'desk/api/modules/listable'
|
3
2
|
require 'desk/api/modules/creatable'
|
4
3
|
require 'desk/api/modules/searchable'
|
5
|
-
require 'desk/api/modules/deletable'
|
6
4
|
require 'desk/customer'
|
7
5
|
|
8
6
|
module Desk
|
@@ -12,7 +10,6 @@ module Desk
|
|
12
10
|
include Desk::Api::Listable
|
13
11
|
include Desk::Api::Creatable
|
14
12
|
include Desk::Api::Searchable
|
15
|
-
include Desk::Api::Deletable
|
16
13
|
|
17
14
|
VALID_SEARCH_PARAMS = [:first_name, :last_name, :full_name, :email, :since_created_at,
|
18
15
|
:max_created_at, :external_id, :since_updated_at, :max_updated_at,
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'desk/api/modules/listable'
|
2
|
+
require 'desk/facebook_user'
|
3
|
+
|
4
|
+
module Desk
|
5
|
+
module Api
|
6
|
+
class FacebookUsers
|
7
|
+
|
8
|
+
include Desk::Api::Listable
|
9
|
+
|
10
|
+
attr_reader :connection, :endpoint, :return_class
|
11
|
+
|
12
|
+
def initialize(connection)
|
13
|
+
@connection = connection
|
14
|
+
@endpoint = "facebook_users"
|
15
|
+
@return_class = Desk::FacebookUser
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'desk/api/modules/listable'
|
2
|
+
require 'desk/filter'
|
3
|
+
|
4
|
+
module Desk
|
5
|
+
module Api
|
6
|
+
class Filters
|
7
|
+
|
8
|
+
include Desk::Api::Listable
|
9
|
+
|
10
|
+
attr_reader :connection, :endpoint, :return_class
|
11
|
+
|
12
|
+
def initialize(connection)
|
13
|
+
@connection = connection
|
14
|
+
@endpoint = "filters"
|
15
|
+
@return_class = Desk::Filter
|
16
|
+
end
|
17
|
+
|
18
|
+
def cases(id)
|
19
|
+
Desk::Collection.new(connection.get("filters/#{id}/cases"), Desk::Case)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'desk/api/modules/listable'
|
2
|
+
require 'desk/inbound_mailbox'
|
3
|
+
|
4
|
+
module Desk
|
5
|
+
module Api
|
6
|
+
class InboundMailboxes
|
7
|
+
|
8
|
+
include Desk::Api::Listable
|
9
|
+
|
10
|
+
attr_reader :connection, :endpoint, :return_class
|
11
|
+
|
12
|
+
def initialize(connection)
|
13
|
+
@connection = connection
|
14
|
+
@endpoint = "inbound_mailbox"
|
15
|
+
@return_class = Desk::InboundMailbox
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/desk/client.rb
CHANGED
@@ -7,6 +7,10 @@ require 'desk/api/topics'
|
|
7
7
|
require 'desk/api/groups'
|
8
8
|
require 'desk/api/brands'
|
9
9
|
require 'desk/api/companies'
|
10
|
+
require 'desk/api/custom_fields'
|
11
|
+
require 'desk/api/facebook_users'
|
12
|
+
require 'desk/api/filters'
|
13
|
+
require 'desk/api/inbound_mailboxes'
|
10
14
|
|
11
15
|
module Desk
|
12
16
|
class Client
|
@@ -39,6 +43,26 @@ module Desk
|
|
39
43
|
Desk::Api::Brands.new(connection)
|
40
44
|
end
|
41
45
|
|
46
|
+
def custom_fields
|
47
|
+
Desk::Api::CustomFields.new(connection)
|
48
|
+
end
|
49
|
+
|
50
|
+
def facebook_users
|
51
|
+
Desk::Api::FacebookUsers.new(connection)
|
52
|
+
end
|
53
|
+
|
54
|
+
def filters
|
55
|
+
Desk::Api::Filters.new(connection)
|
56
|
+
end
|
57
|
+
|
58
|
+
def groups
|
59
|
+
Desk::Api::Groups.new(connection)
|
60
|
+
end
|
61
|
+
|
62
|
+
def inbound_mailboxes
|
63
|
+
Desk::Api::InboundMailboxes.new(connection)
|
64
|
+
end
|
65
|
+
|
42
66
|
private
|
43
67
|
|
44
68
|
def connection
|
@@ -10,7 +10,7 @@ class CompaniesSpec
|
|
10
10
|
|
11
11
|
describe "#all" do
|
12
12
|
|
13
|
-
it "will return an array of
|
13
|
+
it "will return an array of companies" do
|
14
14
|
assert_returns_array_of(Desk::Company, endpoint: "companies", fixture: companies_fixture) { subject.all }
|
15
15
|
end
|
16
16
|
end
|
@@ -27,7 +27,7 @@ class CompaniesSpec
|
|
27
27
|
@connection.expect(:post, company_fixture, ["companies", company_create_fixture])
|
28
28
|
end
|
29
29
|
|
30
|
-
it "will connect to the
|
30
|
+
it "will connect to the company creation endpoint" do
|
31
31
|
subject.create(company_create_fixture)
|
32
32
|
|
33
33
|
@connection.verify
|
@@ -39,7 +39,7 @@ class CompaniesSpec
|
|
39
39
|
@connection.expect(:patch, company_fixture, ["companies/1234", company_update_fixture])
|
40
40
|
end
|
41
41
|
|
42
|
-
it "will connect to the
|
42
|
+
it "will connect to the company update endpoint" do
|
43
43
|
subject.update(1234, company_update_fixture)
|
44
44
|
|
45
45
|
@connection.verify
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'json'
|
2
|
+
require_relative '../../spec_helper'
|
3
|
+
|
4
|
+
class CustomFieldsSpec
|
5
|
+
describe Desk::Api::CustomFields do
|
6
|
+
|
7
|
+
before { @connection = Minitest::Mock.new }
|
8
|
+
|
9
|
+
subject { Desk::Api::CustomFields.new(@connection) }
|
10
|
+
|
11
|
+
describe "#all" do
|
12
|
+
|
13
|
+
it "will return an array of custom fields" do
|
14
|
+
assert_returns_array_of(Desk::CustomField, endpoint: "custom_fields", fixture: custom_fields_fixture) { subject.all }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#show" do
|
19
|
+
it "will return a single custom field object" do
|
20
|
+
assert_returns_one_of(Desk::CustomField, endpoint: "custom_fields/1234", fixture: custom_field_fixture) { subject.show(1234) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def custom_fields_fixture
|
25
|
+
JSON.load(fixture("custom_fields.json"))
|
26
|
+
end
|
27
|
+
|
28
|
+
def custom_field_fixture
|
29
|
+
JSON.load(fixture("custom_field.json"))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -94,17 +94,6 @@ describe Desk::Api::Customers do
|
|
94
94
|
end
|
95
95
|
end
|
96
96
|
|
97
|
-
describe "#delete" do
|
98
|
-
|
99
|
-
before { @connection.expect(:delete, true, ["customers/1234"]) }
|
100
|
-
|
101
|
-
it "will connect to the customer delete endpoint" do
|
102
|
-
subject.delete(1234)
|
103
|
-
|
104
|
-
@connection.verify
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
97
|
describe "#search" do
|
109
98
|
|
110
99
|
it "will connect to the customer search endpoint" do
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'json'
|
2
|
+
require_relative '../../spec_helper'
|
3
|
+
|
4
|
+
class FacebookUsersSpec
|
5
|
+
describe Desk::Api::FacebookUsers do
|
6
|
+
|
7
|
+
before { @connection = Minitest::Mock.new }
|
8
|
+
|
9
|
+
subject { Desk::Api::FacebookUsers.new(@connection) }
|
10
|
+
|
11
|
+
describe "#all" do
|
12
|
+
|
13
|
+
it "will return an array of facebook users" do
|
14
|
+
assert_returns_array_of(Desk::FacebookUser, endpoint: "facebook_users", fixture: facebook_users_fixture) { subject.all }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#show" do
|
19
|
+
it "will return a single facebook user object" do
|
20
|
+
assert_returns_one_of(Desk::FacebookUser, endpoint: "facebook_users/1234", fixture: facebook_user_fixture) { subject.show(1234) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def facebook_users_fixture
|
25
|
+
JSON.load(fixture("facebook_users.json"))
|
26
|
+
end
|
27
|
+
|
28
|
+
def facebook_user_fixture
|
29
|
+
JSON.load(fixture("facebook_user.json"))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'json'
|
2
|
+
require_relative '../../spec_helper'
|
3
|
+
|
4
|
+
class FiltersSpec
|
5
|
+
describe Desk::Api::Filters do
|
6
|
+
|
7
|
+
before { @connection = Minitest::Mock.new }
|
8
|
+
|
9
|
+
subject { Desk::Api::Filters.new(@connection) }
|
10
|
+
|
11
|
+
describe "#all" do
|
12
|
+
|
13
|
+
it "will return an array of filters" do
|
14
|
+
assert_returns_array_of(Desk::Filter, endpoint: "filters", fixture: filters_fixture) { subject.all }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "#show" do
|
19
|
+
it "will return a single filter object" do
|
20
|
+
assert_returns_one_of(Desk::Filter, endpoint: "filters/1234", fixture: filter_fixture) { subject.show(1234) }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "#cases" do
|
25
|
+
before { @connection.expect(:get, cases_fixture, ["filters/1234/cases"]) }
|
26
|
+
|
27
|
+
it "will return an array of cases" do
|
28
|
+
assert_returns_array_of(Desk::Case, endpoint: "filters/1234/cases", fixture: cases_fixture) { subject.cases(1234) }
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def filters_fixture
|
33
|
+
JSON.load(fixture("filters.json"))
|
34
|
+
end
|
35
|
+
|
36
|
+
def filter_fixture
|
37
|
+
JSON.load(fixture("filter.json"))
|
38
|
+
end
|
39
|
+
|
40
|
+
def cases_fixture
|
41
|
+
JSON.load(fixture("cases.json"))
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'json'
|
2
|
+
require_relative '../../spec_helper'
|
3
|
+
|
4
|
+
class InboundMailboxesSpec
|
5
|
+
describe Desk::Api::InboundMailboxes do
|
6
|
+
|
7
|
+
before { @connection = Minitest::Mock.new }
|
8
|
+
|
9
|
+
subject { Desk::Api::InboundMailboxes.new(@connection) }
|
10
|
+
|
11
|
+
describe "#all" do
|
12
|
+
it "will return an array of inbound mailboxes" do
|
13
|
+
assert_returns_array_of(Desk::InboundMailbox, endpoint: "inbound_mailbox", fixture: inbound_mailboxes_fixture) { subject.all }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe "#show" do
|
18
|
+
it "will return a single inbound mailbox object" do
|
19
|
+
assert_returns_one_of(Desk::InboundMailbox, endpoint: "inbound_mailbox/1234", fixture: inbound_mailbox_fixture) { subject.show(1234) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def inbound_mailboxes_fixture
|
24
|
+
JSON.load(fixture("inbound_mailboxes.json"))
|
25
|
+
end
|
26
|
+
|
27
|
+
def inbound_mailbox_fixture
|
28
|
+
JSON.load(fixture("inbound_mailbox.json"))
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
{
|
2
|
+
"total_entries": 2,
|
3
|
+
"_links": {
|
4
|
+
"self": {
|
5
|
+
"href": "/api/v2/custom_fields?page=1&per_page=50",
|
6
|
+
"class": "page"
|
7
|
+
},
|
8
|
+
"first": {
|
9
|
+
"href": "/api/v2/custom_fields?page=1&per_page=50",
|
10
|
+
"class": "page"
|
11
|
+
},
|
12
|
+
"last": {
|
13
|
+
"href": "/api/v2/custom_fields?page=1&per_page=50",
|
14
|
+
"class": "page"
|
15
|
+
},
|
16
|
+
"next": null,
|
17
|
+
"previous": null
|
18
|
+
},
|
19
|
+
"_embedded": {
|
20
|
+
"entries": [
|
21
|
+
{
|
22
|
+
"name": "frequent_buyer",
|
23
|
+
"label": "Frequent Buyer",
|
24
|
+
"type": "customer",
|
25
|
+
"active": true,
|
26
|
+
"data": {
|
27
|
+
"type": "boolean"
|
28
|
+
},
|
29
|
+
"_links": {
|
30
|
+
"self": {
|
31
|
+
"href": "/api/v2/custom_fields/1",
|
32
|
+
"class": "custom_field"
|
33
|
+
}
|
34
|
+
}
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"name": "last_agent",
|
38
|
+
"label": "Last Agent to Update",
|
39
|
+
"type": "ticket",
|
40
|
+
"active": false,
|
41
|
+
"data": {
|
42
|
+
"type": "list",
|
43
|
+
"choices": [
|
44
|
+
"Marianne",
|
45
|
+
"Elinor",
|
46
|
+
"Margaret"
|
47
|
+
]
|
48
|
+
},
|
49
|
+
"_links": {
|
50
|
+
"self": {
|
51
|
+
"href": "/api/v2/custom_fields/2",
|
52
|
+
"class": "custom_field"
|
53
|
+
}
|
54
|
+
}
|
55
|
+
}
|
56
|
+
]
|
57
|
+
}
|
58
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
{
|
2
|
+
"image_url": "https://graph.facebook.com/zuck/picture?type=square",
|
3
|
+
"profile_url": "https://www.facebook.com/zuck",
|
4
|
+
"created_at": "2014-01-11T21:20:53Z",
|
5
|
+
"updated_at": "2014-01-16T21:20:53Z",
|
6
|
+
"_links": {
|
7
|
+
"self": {
|
8
|
+
"href": "/api/v2/facebook_users/1",
|
9
|
+
"class": "facebook_user"
|
10
|
+
},
|
11
|
+
"customer": {
|
12
|
+
"href": "/api/v2/customers/1",
|
13
|
+
"class": "customer"
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
{
|
2
|
+
"total_entries": 2,
|
3
|
+
"_links": {
|
4
|
+
"self": {
|
5
|
+
"href": "/api/v2/facebook_users?page=1&per_page=50",
|
6
|
+
"class": "page"
|
7
|
+
},
|
8
|
+
"first": {
|
9
|
+
"href": "/api/v2/facebook_users?page=1&per_page=50",
|
10
|
+
"class": "page"
|
11
|
+
},
|
12
|
+
"last": {
|
13
|
+
"href": "/api/v2/facebook_users?page=1&per_page=50",
|
14
|
+
"class": "page"
|
15
|
+
},
|
16
|
+
"next": null,
|
17
|
+
"previous": null
|
18
|
+
},
|
19
|
+
"_embedded": {
|
20
|
+
"entries": [
|
21
|
+
{
|
22
|
+
"image_url": "https://graph.facebook.com/zuck/picture?type=square",
|
23
|
+
"profile_url": "https://www.facebook.com/zuck",
|
24
|
+
"created_at": "2014-01-11T21:20:53Z",
|
25
|
+
"updated_at": "2014-01-16T21:20:53Z",
|
26
|
+
"_links": {
|
27
|
+
"self": {
|
28
|
+
"href": "/api/v2/facebook_users/1",
|
29
|
+
"class": "facebook_user"
|
30
|
+
},
|
31
|
+
"customer": {
|
32
|
+
"href": "/api/v2/customers/1",
|
33
|
+
"class": "customer"
|
34
|
+
}
|
35
|
+
}
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"image_url": "https://example.com/facebook_user_image",
|
39
|
+
"profile_url": "https://example.com/facebook_profile",
|
40
|
+
"created_at": "2014-01-11T21:20:53Z",
|
41
|
+
"updated_at": "2014-01-16T21:20:53Z",
|
42
|
+
"_links": {
|
43
|
+
"self": {
|
44
|
+
"href": "/api/v2/facebook_users/2",
|
45
|
+
"class": "facebook_user"
|
46
|
+
},
|
47
|
+
"customer": {
|
48
|
+
"href": "/api/v2/customers/2",
|
49
|
+
"class": "customer"
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
]
|
54
|
+
}
|
55
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
{
|
2
|
+
"total_entries": 2,
|
3
|
+
"_links": {
|
4
|
+
"self": {
|
5
|
+
"href": "/api/v2/filters?page=1&per_page=50",
|
6
|
+
"class": "page"
|
7
|
+
},
|
8
|
+
"first": {
|
9
|
+
"href": "/api/v2/filters?page=1&per_page=50",
|
10
|
+
"class": "page"
|
11
|
+
},
|
12
|
+
"last": {
|
13
|
+
"href": "/api/v2/filters?page=1&per_page=50",
|
14
|
+
"class": "page"
|
15
|
+
},
|
16
|
+
"next": null,
|
17
|
+
"previous": null
|
18
|
+
},
|
19
|
+
"_embedded": {
|
20
|
+
"entries": [
|
21
|
+
{
|
22
|
+
"name": "My Active Cases",
|
23
|
+
"sort_field": "priority",
|
24
|
+
"sort_direction": "desc",
|
25
|
+
"position": 1,
|
26
|
+
"active": true,
|
27
|
+
"_links": {
|
28
|
+
"self": {
|
29
|
+
"href": "/api/v2/filters/1",
|
30
|
+
"class": "filter"
|
31
|
+
},
|
32
|
+
"group": null,
|
33
|
+
"user": null
|
34
|
+
}
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"name": "Spam Cases",
|
38
|
+
"sort_field": "priority",
|
39
|
+
"sort_direction": "desc",
|
40
|
+
"position": 2,
|
41
|
+
"active": true,
|
42
|
+
"_links": {
|
43
|
+
"self": {
|
44
|
+
"href": "/api/v2/filters/2",
|
45
|
+
"class": "filter"
|
46
|
+
},
|
47
|
+
"group": null,
|
48
|
+
"user": null
|
49
|
+
}
|
50
|
+
}
|
51
|
+
]
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
{
|
2
|
+
"name": "Support Mailbox",
|
3
|
+
"enabled": true,
|
4
|
+
"type": "imaps",
|
5
|
+
"hostname": "mail.example.com",
|
6
|
+
"port": 993,
|
7
|
+
"email": "support@example.com",
|
8
|
+
"last_checked_at": "2014-01-21T21:10:53Z",
|
9
|
+
"created_at": "2014-01-21T21:10:53Z",
|
10
|
+
"updated_at": "2014-01-21T21:10:53Z",
|
11
|
+
"last_error": null,
|
12
|
+
"inbound_address_filter": null,
|
13
|
+
"outbound_address_filter": null,
|
14
|
+
"_links": {
|
15
|
+
"self": {
|
16
|
+
"href": "/api/v2/mailboxes/inbound/1",
|
17
|
+
"class": "inbound_mailbox"
|
18
|
+
},
|
19
|
+
"default_group": {
|
20
|
+
"href": "/api/v2/groups/1",
|
21
|
+
"class": "group"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
{
|
2
|
+
"total_entries": 2,
|
3
|
+
"_links": {
|
4
|
+
"self": {
|
5
|
+
"href": "/api/v2/inbound_mailboxes?page=1&per_page=50",
|
6
|
+
"class": "page"
|
7
|
+
},
|
8
|
+
"first": {
|
9
|
+
"href": "/api/v2/inbound_mailboxes?page=1&per_page=50",
|
10
|
+
"class": "page"
|
11
|
+
},
|
12
|
+
"last": {
|
13
|
+
"href": "/api/v2/inbound_mailboxes?page=1&per_page=50",
|
14
|
+
"class": "page"
|
15
|
+
},
|
16
|
+
"next": null,
|
17
|
+
"previous": null
|
18
|
+
},
|
19
|
+
"_embedded": {
|
20
|
+
"entries": [
|
21
|
+
{
|
22
|
+
"name": "Support Mailbox",
|
23
|
+
"enabled": true,
|
24
|
+
"type": "imaps",
|
25
|
+
"hostname": "mail.example.com",
|
26
|
+
"port": 993,
|
27
|
+
"email": "support@example.com",
|
28
|
+
"last_checked_at": "2014-01-21T21:10:53Z",
|
29
|
+
"created_at": "2014-01-21T21:10:53Z",
|
30
|
+
"updated_at": "2014-01-21T21:10:53Z",
|
31
|
+
"last_error": null,
|
32
|
+
"inbound_address_filter": null,
|
33
|
+
"outbound_address_filter": null,
|
34
|
+
"_links": {
|
35
|
+
"self": {
|
36
|
+
"href": "/api/v2/mailboxes/inbound/1",
|
37
|
+
"class": "inbound_mailbox"
|
38
|
+
},
|
39
|
+
"default_group": {
|
40
|
+
"href": "/api/v2/groups/1",
|
41
|
+
"class": "group"
|
42
|
+
}
|
43
|
+
}
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"name": "Another inbound mailbox",
|
47
|
+
"enabled": true,
|
48
|
+
"type": "imaps",
|
49
|
+
"hostname": "mail.example.com",
|
50
|
+
"port": 993,
|
51
|
+
"email": "another_support@example.com",
|
52
|
+
"last_checked_at": "2014-01-21T21:10:53Z",
|
53
|
+
"created_at": "2014-01-21T21:10:53Z",
|
54
|
+
"updated_at": "2014-01-21T21:10:53Z",
|
55
|
+
"last_error": null,
|
56
|
+
"inbound_address_filter": null,
|
57
|
+
"outbound_address_filter": null,
|
58
|
+
"_links": {
|
59
|
+
"self": {
|
60
|
+
"href": "/api/v2/mailboxes/inbound/2",
|
61
|
+
"class": "inbound_mailbox"
|
62
|
+
},
|
63
|
+
"default_group": {
|
64
|
+
"href": "/api/v2/groups/1",
|
65
|
+
"class": "group"
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
]
|
70
|
+
}
|
71
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: desk_api_v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Powers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday_middleware
|
@@ -141,8 +141,12 @@ files:
|
|
141
141
|
- lib/desk/api/brands.rb
|
142
142
|
- lib/desk/api/cases.rb
|
143
143
|
- lib/desk/api/companies.rb
|
144
|
+
- lib/desk/api/custom_fields.rb
|
144
145
|
- lib/desk/api/customers.rb
|
146
|
+
- lib/desk/api/facebook_users.rb
|
147
|
+
- lib/desk/api/filters.rb
|
145
148
|
- lib/desk/api/groups.rb
|
149
|
+
- lib/desk/api/inbound_mailboxes.rb
|
146
150
|
- lib/desk/api/modules/creatable.rb
|
147
151
|
- lib/desk/api/modules/deletable.rb
|
148
152
|
- lib/desk/api/modules/listable.rb
|
@@ -156,11 +160,14 @@ files:
|
|
156
160
|
- lib/desk/collection.rb
|
157
161
|
- lib/desk/company.rb
|
158
162
|
- lib/desk/connection.rb
|
163
|
+
- lib/desk/custom_field.rb
|
159
164
|
- lib/desk/customer.rb
|
160
165
|
- lib/desk/entity.rb
|
161
166
|
- lib/desk/error.rb
|
167
|
+
- lib/desk/facebook_user.rb
|
162
168
|
- lib/desk/filter.rb
|
163
169
|
- lib/desk/group.rb
|
170
|
+
- lib/desk/inbound_mailbox.rb
|
164
171
|
- lib/desk/message.rb
|
165
172
|
- lib/desk/response/error_handling.rb
|
166
173
|
- lib/desk/topic.rb
|
@@ -171,8 +178,12 @@ files:
|
|
171
178
|
- spec/desk/api/brands_spec.rb
|
172
179
|
- spec/desk/api/cases_spec.rb
|
173
180
|
- spec/desk/api/companies_spec.rb
|
181
|
+
- spec/desk/api/custom_fields_spec.rb
|
174
182
|
- spec/desk/api/customers_spec.rb
|
183
|
+
- spec/desk/api/facebook_users_spec.rb
|
184
|
+
- spec/desk/api/filters_spec.rb
|
175
185
|
- spec/desk/api/groups_spec.rb
|
186
|
+
- spec/desk/api/inbound_mailboxes_spec.rb
|
176
187
|
- spec/desk/api/topics_spec.rb
|
177
188
|
- spec/desk/api/translations_spec.rb
|
178
189
|
- spec/desk/collection_spec.rb
|
@@ -187,12 +198,20 @@ files:
|
|
187
198
|
- spec/fixtures/company.json
|
188
199
|
- spec/fixtures/company_create.json
|
189
200
|
- spec/fixtures/company_update.json
|
201
|
+
- spec/fixtures/custom_field.json
|
202
|
+
- spec/fixtures/custom_fields.json
|
190
203
|
- spec/fixtures/customer.json
|
191
204
|
- spec/fixtures/customers.json
|
205
|
+
- spec/fixtures/facebook_user.json
|
206
|
+
- spec/fixtures/facebook_users.json
|
207
|
+
- spec/fixtures/filter.json
|
208
|
+
- spec/fixtures/filters.json
|
192
209
|
- spec/fixtures/group.json
|
193
210
|
- spec/fixtures/group_filters.json
|
194
211
|
- spec/fixtures/group_users.json
|
195
212
|
- spec/fixtures/groups.json
|
213
|
+
- spec/fixtures/inbound_mailbox.json
|
214
|
+
- spec/fixtures/inbound_mailboxes.json
|
196
215
|
- spec/fixtures/message.json
|
197
216
|
- spec/fixtures/topic.json
|
198
217
|
- spec/fixtures/topics.json
|