-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add organization and storage endpoints (read only) #46
Conversation
345cdcc
to
33334c5
Compare
@peetucket I think this might be a credential issue if you are using the |
Ok, I'll check with libsys. |
33334c5
to
ab04c81
Compare
Verified it works on okapi-test after using |
76639c4
to
1987fa5
Compare
.....],.... | ||
"totalRecords"=>100} | ||
|
||
client.organization_interfaces(query: 'name="tes"') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that a query could also use the ID, correct? Like query: 'id="some-uuid-of-an-interface"'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, you just need to do GET /organizations-storage/interfaces/{id}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will take any query that is supported by the API (it just passes it along without parsing).
result = FolioClient.organization_interfaces(query: 'id="c6f7470e-6229-45ce-b3f9-32006e9affcf"')
result
=>
{"interfaces"=>
[{"id"=>"c6f7470e-6229-45ce-b3f9-32006e9affcf",
"name"=>"tes",
"type"=>["Invoices"],
"metadata"=>
{"createdDate"=>"2023-02-16T22:27:51.515+00:00",
"createdByUserId"=>"38524916-598d-4edf-a2ef-04bba7e78ad6",
"updatedDate"=>"2023-02-16T22:27:51.515+00:00",
"updatedByUserId"=>"38524916-598d-4edf-a2ef-04bba7e78ad6"}}],
"totalRecords"=>1}
This is basically the same thing as using the interface details query:
result = FolioClient.interface_details(id: 'c6f7470e-6229-45ce-b3f9-32006e9affcf')
result
=>
{"id"=>"c6f7470e-6229-45ce-b3f9-32006e9affcf",
"name"=>"tes",
"type"=>["Invoices"],
"metadata"=>
{"createdDate"=>"2023-02-16T22:27:51.515+00:00",
"createdByUserId"=>"38524916-598d-4edf-a2ef-04bba7e78ad6",
"updatedDate"=>"2023-02-16T22:27:51.515+00:00",
"updatedByUserId"=>"38524916-598d-4edf-a2ef-04bba7e78ad6"}}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean, you could do /organizations-storage/interfaces?query=id==c6f7470e-6229-45ce-b3f9-32006e9affcf
if you wanted to...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't pass any query to the organization_interfaces
it will return everything.
result = FolioClient.organization_interfaces
result
{"interfaces"=>
[{"id"=>"c6f7470e-6229-45ce-b3f9-32006e9affcf",
"name"=>"tes",
"type"=>["Invoices"],
"metadata"=>
{"createdDate"=>"2023-02-16T22:27:51.515+00:00",
"createdByUserId"=>"38524916-598d-4edf-a2ef-04bba7e78ad6",
"updatedDate"=>"2023-02-16T22:27:51.515+00:00",
"updatedByUserId"=>"38524916-598d-4edf-a2ef-04bba7e78ad6"}},
{"id"=>"65d30c15-a560-4064-be92-f90e38eeb351",
"name"=>"GOBI-FTP",
"uri"=>"ftp://ftp.ybp.com",
"notes"=>"THIS IS AN EXAMPLE - IF ANY PROBLEMS ARRISE, DELETE",
"type"=>["Other"],
"metadata"=>
{"createdDate"=>"2023-03-09T22:30:53.993+00:00",
"createdByUserId"=>"ef452e80-116b-4e6a-b820-3827a3c87c17",
"updatedDate"=>"2023-03-09T22:30:53.993+00:00",
"updatedByUserId"=>"ef452e80-116b-4e6a-b820-3827a3c87c17"}},
{"id"=>"3a00800c-c6a9-447d-96b5-cf5786d69df3",
"name"=>"Test Interface",
"type"=>["Other"],
"metadata"=>
{"createdDate"=>"2023-03-27T20:16:45.467+00:00",
"createdByUserId"=>"950344dc-af40-58e1-aa90-c015b7ac51f2",
"updatedDate"=>"2023-03-27T20:16:45.467+00:00",
"updatedByUserId"=>"950344dc-af40-58e1-aa90-c015b7ac51f2"}}],
"totalRecords"=>3}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see it now, that's the interface_details method. We may also need to add a method for the /organizations-storage/interfaces/{id}/credentials
endpoint, but I want to chat with @jermnelson about the API requirements first, so that could easily be a follow up PR.
Why was this change made? 🤔
Fixes #43 - add fetch organization, org interface and interface detail endpoints to folio_client.
Notes:
Perhaps future work can parse and produce different results if needed.
How was this change tested? 🤨
Added new tests