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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ed338038c8319c4491ee57dbe1cdca6c65b8f3c
4
- data.tar.gz: 24def22fd30cfa36ecbba67f39b7b79497e3e3e1
3
+ metadata.gz: e9d762393044ee535ef10792d5944e58975a7432
4
+ data.tar.gz: 0b816a6416b2e3130ffc30ce3e49e7f024962e52
5
5
  SHA512:
6
- metadata.gz: d07b75367caff967dcc4f8a9331b458c1594bf8b4d46e4640c44665c383074105c84511c4b7de4d9c2bab05a925094e580c1941983a47127af673ac6491cd42f
7
- data.tar.gz: 88062d795602117df6fe9f5a0a613dbfc1402d9304f800e350764ae9976d6e1928e011d82a97d2f598662291f48bced56ab384b8a0f5d2051602e4a3019743ad
6
+ metadata.gz: e5659ff4a71dce096a74515e3ddbf2060f7cb8f00db8d28a3798b68e194b9e20ffea2162e17c1cd2ea7d15bc972925ff470bc9deec53b6ad5c1f018f8421be54
7
+ data.tar.gz: 110418c9ae3a646e1836f781511e02767ed6e6c7f67cef8fc992ba7eedc81262ea62d21e37c6ff8b95852b1f482dfb67675eea59aeb7ffebea1cf9c4eb6863ae
@@ -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
- Hashie::Mash.new JSON.parse response.body
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
@@ -1,5 +1,5 @@
1
1
  module Broadstreet
2
2
 
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.3'
4
4
 
5
5
  end
@@ -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/#{id}", params).zone
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.1
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-05-01 00:00:00.000000000 Z
11
+ date: 2014-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday