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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fefd8ac204c397e58d5e9ab5c92acddd3a52b319
4
- data.tar.gz: 7180d09cce69a9ac32b2a99ccbaae043720ebe6d
3
+ metadata.gz: 49635b4d7244d9a92916d9cddfbd8484b5dafefa
4
+ data.tar.gz: a928952702629981a36fcf1dee98df7f4fb831ec
5
5
  SHA512:
6
- metadata.gz: 255b96c4f729884f3095cac2bb6a87b5dbe7d99d0e88e9d4309d2a22e50be51ad70ea2292a3b3caeafb7329b8a8cd1fa7e9aca6dadba5ed2f71f3579c6881bdc
7
- data.tar.gz: a4d266d305f6cf454ad5973513e958c6371adc30f7b4c5f02107d07937889b5085c4b72d7cffffa7d5ed50c6be33937ada620ec4b741dcffc8f94d494a6c2a7e
6
+ metadata.gz: 203db3482927785e7665d4b30580e46bb0c8b5f99b5f9de804195e6764ae72e0bd7454a2efe90603151ba28c697373d765c07ca70c51cbff2abd82e59e7be3ae
7
+ data.tar.gz: 81d0bdb23f6c70ad7f61a95b5358587b1c7aec4787cb77468fb92f3996bd3e01f537f6a526b36c96273c1ec0649d60430ab29562f72af02beb601e86f404bf4b
data/CHANGELOG.md CHANGED
@@ -5,3 +5,7 @@
5
5
  ## v0.0.2
6
6
 
7
7
  * Bugfixes
8
+
9
+ ## v0.1
10
+
11
+ * Added api methods
@@ -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', { }, default_headers)
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 get_users(domain_id)
14
- request = web_request('GET', "/domains/#{domain_id}/users", { }, default_headers)
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", { }, default_headers)
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", { }, default_headers)
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 update_sender_bccs(sender_bcc_id, params)
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(sender_bcc_id)
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", { }, default_headers)
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])
@@ -1,3 +1,3 @@
1
1
  module Postfixman
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postfixman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Hick