attio-ruby 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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +57 -12
- data/examples/app_specific_typed_record.md +1613 -0
- data/examples/deals.rb +112 -0
- data/examples/oauth_flow.rb +26 -49
- data/examples/typed_records_example.rb +10 -7
- data/lib/attio/internal/record.rb +17 -8
- data/lib/attio/resources/company.rb +26 -24
- data/lib/attio/resources/deal.rb +288 -0
- data/lib/attio/resources/meta.rb +43 -12
- data/lib/attio/resources/object.rb +24 -4
- data/lib/attio/resources/person.rb +22 -18
- data/lib/attio/resources/typed_record.rb +49 -6
- data/lib/attio/resources/workspace_member.rb +17 -4
- data/lib/attio/version.rb +1 -1
- data/lib/attio.rb +1 -0
- metadata +4 -2
- data/attio-ruby.gemspec +0 -61
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84a54ed9baf9d0656cb14f49fc0209bad919cce78efe67de8b5b02ba56eac3bc
|
4
|
+
data.tar.gz: e3813aeea763037d5764d580b1074c18e82f6fa71eb1d1f8a9ab45adb0642b2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0eba5da5d484ff911e6c37893b043504cccb6e87e188ca0a60edd867579936ff49ac3b47715e60ee8d91a15dccbb3eaa3bb5e8accbd1883e12a803b1563a100
|
7
|
+
data.tar.gz: c95586cbc9a9e5e6d78ed417fec243409f359edc98a221aaf8316d96163a8de2f2eff0a4439fb2850571cf547f979d5f031f02f55ec0a4c538b107b485ddfeb8
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [0.1.1] - 2025-08-07
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
- Minor bug fixes and improvements
|
12
|
+
|
8
13
|
## [0.1.0] - 2025-07-27
|
9
14
|
|
10
15
|
### Added
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Attio Ruby SDK
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/attio-ruby)
|
4
|
-
[](https://github.com/rbeene/attio_ruby/actions/workflows/ci.yml)
|
5
5
|
[](https://rubydoc.info/gems/attio-ruby)
|
6
6
|
|
7
7
|
A Ruby SDK for the [Attio API](https://attio.com/docs). This gem provides a simple and intuitive interface for interacting with Attio's CRM platform.
|
@@ -65,9 +65,7 @@ person = Attio::Person.create(
|
|
65
65
|
)
|
66
66
|
|
67
67
|
# Search for companies
|
68
|
-
companies = Attio::Company.
|
69
|
-
params: { q: "tech", limit: 10 }
|
70
|
-
)
|
68
|
+
companies = Attio::Company.search("tech")
|
71
69
|
```
|
72
70
|
|
73
71
|
## Configuration
|
@@ -351,9 +349,11 @@ person.set_name(first: "Jane", last: "Doe")
|
|
351
349
|
person.add_email("jane.doe@example.com")
|
352
350
|
person.add_phone("+14155551234", country_code: "US")
|
353
351
|
|
354
|
-
# Search methods
|
355
|
-
jane = Attio::Person.
|
356
|
-
john = Attio::Person.
|
352
|
+
# Search methods - Rails-style find_by
|
353
|
+
jane = Attio::Person.find_by(email: "jane@example.com")
|
354
|
+
john = Attio::Person.find_by(name: "John Smith")
|
355
|
+
# Can combine multiple conditions (uses AND logic)
|
356
|
+
exec = Attio::Person.find_by(email: "exec@company.com", job_title: "CEO")
|
357
357
|
```
|
358
358
|
|
359
359
|
#### Company Methods
|
@@ -371,10 +371,53 @@ company.name = "New Company Name"
|
|
371
371
|
company.add_domain("newdomain.com")
|
372
372
|
company.add_team_member(person) # Associate a person with the company
|
373
373
|
|
374
|
+
# Search methods - Rails-style find_by
|
375
|
+
acme = Attio::Company.find_by(name: "Acme Corp")
|
376
|
+
tech_co = Attio::Company.find_by(domain: "techcompany.com")
|
377
|
+
# Can combine multiple conditions
|
378
|
+
big_tech = Attio::Company.find_by(domain: "tech.com", employee_count: "100-500")
|
379
|
+
```
|
380
|
+
|
381
|
+
#### Deal Methods
|
382
|
+
|
383
|
+
```ruby
|
384
|
+
# Create a deal (requires name, stage, and owner)
|
385
|
+
deal = Attio::Deal.create(
|
386
|
+
name: "Enterprise Deal",
|
387
|
+
value: 50000,
|
388
|
+
stage: "In Progress", # Options: "Lead", "In Progress", "Won 🎉", "Lost"
|
389
|
+
owner: "sales@company.com" # Must be a workspace member email
|
390
|
+
)
|
391
|
+
|
392
|
+
# Access methods
|
393
|
+
deal.name # Returns deal name
|
394
|
+
deal.value # Returns currency object with currency_value
|
395
|
+
deal.stage # Returns status object with nested title
|
396
|
+
deal.status # Alias for stage
|
397
|
+
|
398
|
+
# Update methods
|
399
|
+
deal.update_stage("Won 🎉")
|
400
|
+
deal.update_value(75000)
|
401
|
+
|
374
402
|
# Search methods
|
375
|
-
|
376
|
-
|
377
|
-
|
403
|
+
big_deals = Attio::Deal.find_by_value_range(min: 100000)
|
404
|
+
mid_deals = Attio::Deal.find_by_value_range(min: 50000, max: 100000)
|
405
|
+
won_deals = Attio::Deal.find_by(stage: "Won 🎉")
|
406
|
+
|
407
|
+
# Check deal status
|
408
|
+
deal.open? # true if not won or lost
|
409
|
+
deal.won? # true if stage includes "won"
|
410
|
+
deal.lost? # true if stage is "lost"
|
411
|
+
|
412
|
+
# Associate with companies and people
|
413
|
+
deal = Attio::Deal.create(
|
414
|
+
name: "Partnership Deal",
|
415
|
+
value: 100000,
|
416
|
+
stage: "Lead",
|
417
|
+
owner: "sales@company.com",
|
418
|
+
associated_people: ["contact@partner.com"],
|
419
|
+
associated_company: ["partner.com"] # Uses domain
|
420
|
+
)
|
378
421
|
```
|
379
422
|
|
380
423
|
#### TypedRecord Methods
|
@@ -385,8 +428,10 @@ All typed records (Person, Company, and custom objects) support:
|
|
385
428
|
# Search with query string
|
386
429
|
results = Attio::Person.search("john")
|
387
430
|
|
388
|
-
# Find by any attribute
|
389
|
-
person = Attio::Person.find_by(:
|
431
|
+
# Find by any attribute using Rails-style syntax
|
432
|
+
person = Attio::Person.find_by(job_title: "CEO")
|
433
|
+
# Or find by multiple attributes (AND logic)
|
434
|
+
person = Attio::Person.find_by(job_title: "CEO", company: "Acme Corp")
|
390
435
|
|
391
436
|
# Aliases for common methods
|
392
437
|
Attio::Person.all == Attio::Person.list
|