lib/sendgrid4r/rest/ip_access_management.rb in sendgrid4r-1.11.0 vs lib/sendgrid4r/rest/ip_access_management.rb in sendgrid4r-1.12.0

- old
+ new

@@ -75,32 +75,40 @@ def get_ip_activities(limit: nil, &block) params = {} params[:limit] = limit unless limit.nil? resp = get(@auth, IpAccessManagement.url_activity, params, &block) - IpAccessManagement.create_ip_activities(resp) + finish(resp, @raw_resp) do |r| + IpAccessManagement.create_ip_activities(r) + end end def get_whitelisted_ips(&block) resp = get(@auth, IpAccessManagement.url_whitelist, &block) - IpAccessManagement.create_whitelisted_ips(resp) + finish(resp, @raw_resp) do |r| + IpAccessManagement.create_whitelisted_ips(r) + end end def post_whitelisted_ips(ips:, &block) ips_param = ips.map { |ip| { ip: ip } } params = { ips: ips_param } resp = post(@auth, IpAccessManagement.url_whitelist, params, &block) - IpAccessManagement.create_whitelisted_ips(resp) + finish(resp, @raw_resp) do |r| + IpAccessManagement.create_whitelisted_ips(r) + end end def delete_whitelisted_ips(ids:, &block) payload = { ids: ids } delete(@auth, IpAccessManagement.url_whitelist, nil, payload, &block) end def get_whitelisted_ip(rule_id:, &block) resp = get(@auth, IpAccessManagement.url_whitelist(rule_id), nil, &block) - IpAccessManagement.create_whitelisted_ip(resp) + finish(resp, @raw_resp) do |r| + IpAccessManagement.create_whitelisted_ip(r) + end end def delete_whitelisted_ip(rule_id:, &block) delete(@auth, IpAccessManagement.url_whitelist(rule_id), nil, &block) end