customerio_api 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: 6091d1158347650e87f732c7e733f0db28b0832e80d28df0b4b645648bddcd06
4
- data.tar.gz: 00a16c715091dbdef658965c64244b18cde75248ed766b7e878825788633cb7a
3
+ metadata.gz: ceb70ea4c24738a144afeec3e73c100388dcef171d985dc5313cb54e7e2abd2c
4
+ data.tar.gz: 8405496d81614f120f367ad2f2023fa7b0f73a020410365c9113ccac883050ef
5
5
  SHA512:
6
- metadata.gz: a12e7858737966bd0b05245b323b661e2959b19e358e1da381ae5942f70ccac9dc298219dabe4c62b7a7480c980cfc4182a063ba019f9b3b50d97869172ff07e
7
- data.tar.gz: 8339cfd265bba418b73a8f186543a68351f58047745ce415970142d8f1b32fe51a32c99c44aaf2e846ae4031e17131cfb4e7c2193fef16652f993ded52479f35
6
+ metadata.gz: 9ba268b0f46e31618b0dfb1619273dc9556f1331fa3564d720a97aef18ed7fc92f61e36fda4d13df13658d0ef0a52da104acb94492a1cc22ce3da59dbc04ecfd
7
+ data.tar.gz: 5f5cc64abde43908745d0d4f284a75664169a917c41a1dffc764b5e84c479d9b8998c1834ba9cd1632d7132f5f88948b7709af0319edd745d9c690a33eb054b3
data/README.md CHANGED
@@ -50,6 +50,29 @@ customers = v1_client.customer.where(email: 'test@example.com')
50
50
  # => returns a list of CustomerioAPI::Customer
51
51
  ```
52
52
 
53
+ #### 2. Use s set of filter conditions to find customer
54
+
55
+ ```ruby
56
+ attributes =
57
+ {
58
+ filter: {
59
+ and:
60
+ [
61
+ {
62
+ attribute: {
63
+ field: 'cio_id',
64
+ operator: 'eq',
65
+ value: 'd7a90a000a0b'
66
+ }
67
+ }
68
+ ]
69
+ }
70
+ }
71
+ customer_identifiers = v1_client.customer.search(attributes: attributes)
72
+
73
+ # => returns a CustomerioAPI::Customer object, containing arrays of identifiers and ids
74
+ ```
75
+
53
76
  ### CustomerioObject
54
77
 
55
78
  #### 1. Use a set of filter conditions to find object
@@ -10,5 +10,11 @@ module CustomerioAPI
10
10
  response_body = get_request('customers', params: { email: email }).body
11
11
  response_body['results'].map { |customers| Customer.new(customers) }
12
12
  end
13
+
14
+ # client.customer.search(attributes: attributes)
15
+ def search(attributes:, start: nil, limit: nil)
16
+ response_body = post_request("customers?start=#{start}&limit=#{limit}", body: attributes).body
17
+ Customer.new(response_body)
18
+ end
13
19
  end
14
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CustomerioAPI
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: customerio_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - linhho0702
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-18 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport