broadstreet 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/broadstreet/client.rb +5 -1
- data/lib/broadstreet/network_methods.rb +18 -0
- data/lib/broadstreet/version.rb +1 -1
- data/lib/broadstreet/zone_methods.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9d762393044ee535ef10792d5944e58975a7432
|
4
|
+
data.tar.gz: 0b816a6416b2e3130ffc30ce3e49e7f024962e52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5659ff4a71dce096a74515e3ddbf2060f7cb8f00db8d28a3798b68e194b9e20ffea2162e17c1cd2ea7d15bc972925ff470bc9deec53b6ad5c1f018f8421be54
|
7
|
+
data.tar.gz: 110418c9ae3a646e1836f781511e02767ed6e6c7f67cef8fc992ba7eedc81262ea62d21e37c6ff8b95852b1f482dfb67675eea59aeb7ffebea1cf9c4eb6863ae
|
data/lib/broadstreet/client.rb
CHANGED
@@ -29,7 +29,11 @@ module Broadstreet
|
|
29
29
|
def request(method, path, params = {})
|
30
30
|
params[:access_token] = @access_token
|
31
31
|
response = connection.send method, path, params
|
32
|
-
|
32
|
+
if method == :delete
|
33
|
+
nil
|
34
|
+
else
|
35
|
+
Hashie::Mash.new JSON.parse response.body
|
36
|
+
end
|
33
37
|
end
|
34
38
|
|
35
39
|
def connection
|
@@ -35,6 +35,24 @@ module Broadstreet
|
|
35
35
|
request(:post, 'api/1/networks', params).network
|
36
36
|
end
|
37
37
|
|
38
|
+
# Create a network admin
|
39
|
+
#
|
40
|
+
# @param [Fixnum] network_id: The id of the network for the admin
|
41
|
+
# @param [Fixnum] user_id: The id of the user to make an admin
|
42
|
+
def create_network_admin(network_id, user_id)
|
43
|
+
params = { user_id: user_id }
|
44
|
+
request(:post, "api/1/networks/#{network_id}/network_admins", params)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Remove a network admin
|
48
|
+
#
|
49
|
+
# @param [Fixnum] network_id: The id of the network for the admin
|
50
|
+
# @param [Fixnum] user_id: The id of the user to make an admin
|
51
|
+
def remove_network_admin(network_id, user_id)
|
52
|
+
params = { user_id: user_id }
|
53
|
+
request(:delete, "api/1/networks/#{network_id}/network_admins", params)
|
54
|
+
end
|
55
|
+
|
38
56
|
end
|
39
57
|
|
40
58
|
end
|
data/lib/broadstreet/version.rb
CHANGED
@@ -48,7 +48,7 @@ module Broadstreet
|
|
48
48
|
# @option params [String] :pricing_callback_url Callback for pricing on self-serve zones
|
49
49
|
# @return [Hash] the updated zone detail
|
50
50
|
def update_zone(zone_id, params)
|
51
|
-
request(:put, "api/1/zones/#{
|
51
|
+
request(:put, "api/1/zones/#{zone_id}", params).zone
|
52
52
|
end
|
53
53
|
|
54
54
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: broadstreet
|
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
|
- John Crepezzi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|