unbounce 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6e68db8658b1ee575f0f3d245aa237d2856d91c
4
- data.tar.gz: aec876d9c49fb7f3bed9e1bc25fbf99082bb94ca
3
+ metadata.gz: 365f5ba76e565bdffb3d80470dbf718f5ac4947c
4
+ data.tar.gz: 88435ca63a70dddc565133cd26c2a977834db775
5
5
  SHA512:
6
- metadata.gz: 4cbf7abb6a45d19ded5174daf6a9ca91e412fbd8c990ebe5f343a4331ec32c2e5d62cc6ab278096c8f94b39e226dc50d997a6f018a3076e2b5d6baa8fc477c09
7
- data.tar.gz: 6d8739426262827ad3e278000bcbf9670f74065168af3122345194d96d97a73b012ee5d8a526e4f1c9d720755b53fc3f8fa65cc8cb1125efa4b435e8a91e56e9
6
+ metadata.gz: 87c7d42c808659ea1479e133aaaab8425e8dfeb2cb2f8b4f8059b8180980adb003a093247f6c4fc69a5eda93ce5ae66e27db2b002fbe4a6fd12c08ed4174a957
7
+ data.tar.gz: d7b7742e3c2ca41100009ff52271602ab24f04e6459865c5015ef27aa4bdd2394ae0ed301afb4520c2c49bb8efed116f017ef1f973f091c2d1f1f5392598f9bd
@@ -50,9 +50,50 @@ module Unbounce
50
50
 
51
51
  def get_responses(opts = {})
52
52
  params = set_params(opts)
53
- response = parse_json(RestClient.get(@url+params[:path], params: params,Authorization: @auth, headers: @headers)).body
54
-
55
- # response = (opts[:data]) ? response[opts[:data]] : response
53
+ response = parse_json(RestClient.get(@url+params[:path], params: params,Authorization: @auth, headers: @headers)).body
54
+
55
+ more = response["metadata"]["next"].nil? ? nil : response["metadata"]["next"]["href"]
56
+
57
+ while more
58
+ more_response = parse_json(RestClient.get(more,Authorization: @auth, headers: @headers)).body
59
+
60
+ if more_response["leads"]
61
+ response["leads"].push(more_response["leads"])
62
+ response["leads"].flatten!
63
+ end
64
+
65
+ if more_response["domains"]
66
+ response["domains"].push(more_response["domains"])
67
+ response["domains"].flatten!
68
+ end
69
+
70
+ if more_response["pages"]
71
+ response["pages"].push(more_response["pages"])
72
+ response["pages"].flatten!
73
+ end
74
+
75
+ if more_response["page_groups"]
76
+ response["page_groups"].push(more_response["page_groups"])
77
+ response["page_groups"].flatten!
78
+ end
79
+
80
+ if more_response["sub_accounts"]
81
+ response["sub_accounts"].push(more_response["sub_accounts"])
82
+ response["sub_accounts"].flatten!
83
+ end
84
+
85
+ if more_response["accounts"]
86
+ response["accounts"].push(more_response["accounts"])
87
+ response["accounts"].flatten!
88
+ end
89
+
90
+ if more_response["form_fields"]
91
+ response["form_fields"].push(more_response["form_fields"])
92
+ response["form_fields"].flatten!
93
+ end
94
+
95
+ more = more_response["metadata"]["next"].nil? ? nil : more_response["metadata"]["next"]["href"]
96
+ end
56
97
 
57
98
  return response
58
99
  end
@@ -1,3 +1,3 @@
1
1
  module Unbounce
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unbounce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Hoskison
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-29 00:00:00.000000000 Z
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler