Reimplementing airtable minimal api.
This commit is contained in:
parent
8b7f2047b7
commit
2b751b60ed
42
repository/Grafoscopio-Utils/Airtable.class.st
Normal file
42
repository/Grafoscopio-Utils/Airtable.class.st
Normal file
@ -0,0 +1,42 @@
|
||||
Class {
|
||||
#name : #Airtable,
|
||||
#superclass : #Object,
|
||||
#instVars : [
|
||||
'id',
|
||||
'apiKey'
|
||||
],
|
||||
#category : #'Grafoscopio-Utils-Grafoscopio-Utils'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
Airtable >> apiKey [
|
||||
^ apiKey
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Airtable >> apiKey: anString [
|
||||
apiKey := anString
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Airtable >> id [
|
||||
^ id
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Airtable >> id: idString [
|
||||
id := idString
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Airtable >> rawRecords [
|
||||
^ ZnClient new
|
||||
url: (self id);
|
||||
headerAt: 'Authorization' put: 'Bearer ', (self apiKey);
|
||||
get.
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
Airtable >> records [
|
||||
^ (NeoJSONReader fromString: self rawRecords contents) at: 'records'
|
||||
]
|
Loading…
Reference in New Issue
Block a user