postfixman 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/postfixman/api.rb +37 -12
- data/lib/postfixman/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49635b4d7244d9a92916d9cddfbd8484b5dafefa
|
4
|
+
data.tar.gz: a928952702629981a36fcf1dee98df7f4fb831ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 203db3482927785e7665d4b30580e46bb0c8b5f99b5f9de804195e6764ae72e0bd7454a2efe90603151ba28c697373d765c07ca70c51cbff2abd82e59e7be3ae
|
7
|
+
data.tar.gz: 81d0bdb23f6c70ad7f61a95b5358587b1c7aec4787cb77468fb92f3996bd3e01f537f6a526b36c96273c1ec0649d60430ab29562f72af02beb601e86f404bf4b
|
data/CHANGELOG.md
CHANGED
data/lib/postfixman/api.rb
CHANGED
@@ -5,16 +5,26 @@ module Postfixman
|
|
5
5
|
@access_token = access_token
|
6
6
|
end
|
7
7
|
|
8
|
-
def get_domains
|
9
|
-
request = web_request('GET', '/domains',
|
8
|
+
def get_domains(filters={})
|
9
|
+
request = web_request('GET', '/domains', filters, default_headers)
|
10
10
|
request[:body].map { |x| Postfixman::Domain.new(x) }
|
11
11
|
end
|
12
12
|
|
13
|
-
def
|
14
|
-
request = web_request('GET', "/domains/#{
|
13
|
+
def get_domain(id)
|
14
|
+
request = web_request('GET', "/domains/#{id}", { }, default_headers)
|
15
|
+
Postfixman::Domain.new(request[:body])
|
16
|
+
end
|
17
|
+
|
18
|
+
def get_users(domain_id, filters={})
|
19
|
+
request = web_request('GET', "/domains/#{domain_id}/users", filters, default_headers)
|
15
20
|
request[:body].map { |x| Postfixman::User.new(x) }
|
16
21
|
end
|
17
22
|
|
23
|
+
def get_user(id)
|
24
|
+
request = web_request('GET', "/users/#{id}", { }, default_headers)
|
25
|
+
Postfixman::User.new(request[:body])
|
26
|
+
end
|
27
|
+
|
18
28
|
def create_user(params)
|
19
29
|
request = web_request('POST', '/users', params, default_headers)
|
20
30
|
Postfixman::User.new(request[:body])
|
@@ -30,11 +40,16 @@ module Postfixman
|
|
30
40
|
request[:body]['success'] == true
|
31
41
|
end
|
32
42
|
|
33
|
-
def get_aliases(domain_id)
|
34
|
-
request = web_request('GET', "/domains/#{domain_id}/aliases",
|
43
|
+
def get_aliases(domain_id, filters={})
|
44
|
+
request = web_request('GET', "/domains/#{domain_id}/aliases", filters, default_headers)
|
35
45
|
request[:body].map { |x| Postfixman::Alias.new(x) }
|
36
46
|
end
|
37
47
|
|
48
|
+
def get_alias(id)
|
49
|
+
request = web_request('GET', "/aliases/#{id}", { }, default_headers)
|
50
|
+
Postfixman::Alias.new(request[:body])
|
51
|
+
end
|
52
|
+
|
38
53
|
def create_alias(params)
|
39
54
|
request = web_request('POST', '/aliases', params, default_headers)
|
40
55
|
Postfixman::User.new(request[:body])
|
@@ -50,31 +65,41 @@ module Postfixman
|
|
50
65
|
request[:body]['success'] == true
|
51
66
|
end
|
52
67
|
|
53
|
-
def get_recipient_bccs
|
54
|
-
request = web_request('GET', "/domains/#{domain_id}/recipient_bccs",
|
68
|
+
def get_recipient_bccs(domain_id, filters={})
|
69
|
+
request = web_request('GET', "/domains/#{domain_id}/recipient_bccs", filters, default_headers)
|
55
70
|
request[:body].map { |x| Postfixman::RecipientBcc.new(x) }
|
56
71
|
end
|
57
72
|
|
73
|
+
def get_recipient_bcc(id)
|
74
|
+
request = web_request('GET', "/recipient_bccs/#{id}", { }, default_headers)
|
75
|
+
Postfixman::RecipientBcc.new(request[:body])
|
76
|
+
end
|
77
|
+
|
58
78
|
def create_recipient_bccs(params)
|
59
79
|
request = web_request('POST', '/recipient_bccs', params, default_headers)
|
60
80
|
Postfixman::User.new(request[:body])
|
61
81
|
end
|
62
82
|
|
63
|
-
def
|
83
|
+
def update_recipient_bccs(recipient_bcc_id, params)
|
64
84
|
request = web_request('PUT', "/recipient_bccs/#{user_id}", params, default_headers)
|
65
85
|
Postfixman::User.new(request[:body])
|
66
86
|
end
|
67
87
|
|
68
|
-
def delete_recipient_bccs(
|
88
|
+
def delete_recipient_bccs(recipient_bcc_id)
|
69
89
|
request = web_request('DELETE', "/recipient_bccs/#{user_id}", params, default_headers)
|
70
90
|
request[:body]['success'] == true
|
71
91
|
end
|
72
92
|
|
73
|
-
def get_sender_bccs
|
74
|
-
request = web_request('GET', "/domains/#{domain_id}/sender_bccs",
|
93
|
+
def get_sender_bccs(domain_id, filters={})
|
94
|
+
request = web_request('GET', "/domains/#{domain_id}/sender_bccs", filters, default_headers)
|
75
95
|
request[:body].map { |x| Postfixman::SenderBcc.new(x) }
|
76
96
|
end
|
77
97
|
|
98
|
+
def get_sender_bcc(id)
|
99
|
+
request = web_request('GET', "/sender_bccs/#{id}", { }, default_headers)
|
100
|
+
Postfixman::SenderBcc.new(request[:body])
|
101
|
+
end
|
102
|
+
|
78
103
|
def create_sender_bccs(params)
|
79
104
|
request = web_request('POST', '/sender_bccs', params, default_headers)
|
80
105
|
Postfixman::User.new(request[:body])
|
data/lib/postfixman/version.rb
CHANGED