{"id":15484770,"url":"https://github.com/emcousin/provet-client","last_synced_at":"2025-10-08T19:00:05.992Z","repository":{"id":48578863,"uuid":"386585984","full_name":"EmCousin/provet-client","owner":"EmCousin","description":"A Ruby client for the ProvetCloud API","archived":false,"fork":false,"pushed_at":"2021-07-20T10:39:28.000Z","size":78,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-08T02:58:29.549Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EmCousin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-16T09:42:55.000Z","updated_at":"2024-03-10T12:09:09.000Z","dependencies_parsed_at":"2022-09-23T18:41:41.609Z","dependency_job_id":null,"html_url":"https://github.com/EmCousin/provet-client","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/EmCousin/provet-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmCousin%2Fprovet-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmCousin%2Fprovet-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmCousin%2Fprovet-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmCousin%2Fprovet-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EmCousin","download_url":"https://codeload.github.com/EmCousin/provet-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmCousin%2Fprovet-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000516,"owners_count":26082785,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T05:50:16.479Z","updated_at":"2025-10-08T19:00:05.351Z","avatar_url":"https://github.com/EmCousin.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Provet::Client\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'provet-client', require: false\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install provet-client\n\n## Configuration\n\n```ruby\nrequire 'provet'\n\nProvet.host = \"https://us.provetcloud.com\" # optional\nProvet.api_version = \"0.1\" # optional\nProvet.instance = 123 # required\nProvet.token = \"your_provet_token\" # required\n```\n\n## Usage\n\nEvery resource available in the ProvetCloud API is mapped with a corresponding class inheriting from `Provet::Base`, which contains the necessary methods to properly consume the API endpoints.\n\nThe classes are :\n- Provet::Appointment\n- Provet::Availability\n- Provet::Client\n- Provet::ConsultationDischargeInstructions\n- Provet::ConsultationItemTemplate\n- Provet::ConsultationItem\n- Provet::Consultation\n- Provet::Department\n- Provet::InvoiceRow\n- Provet::Invoice\n- Provet::ItemList\n- Provet::ItemTemplateItem\n- Provet::ItemTemplate\n- Provet::Item\n- Provet::LaboratoryAnalysisGroup\n- Provet::Patient\n- Provet::PhoneNumber\n- Provet::ReasonGroup\n- Provet::Reason\n- Provet::ReminderTemplate\n- Provet::Reminder\n- Provet::Shift\n- Provet::ShiftType\n- Provet::UserDetails\n- Provet::UserGroup\n- Provet::User\n- Provet::VatGroup\n\nOn each of the aforementioned classes you can call the following methods:\n\n### `.base_uri`\n\nReturns the base URI of the Provet API. Depends on the Provet instance present in the Rails credentials.\nExample :\n\n```ruby\nProvet::Base.base_uri\n# =\u003e \"https://us.provetcloud.com/1234/api/0.1\" in staging\n```\n\n### `#list`\n\nReturns a list of the designated provet resource. It is paginated by default.\nExample :\n\n```ruby\nres = Provet::Client.new.list\nres.parsed_response\n# =\u003e {\"count\"=\u003e4223, \"num_pages\"=\u003e85, \"next\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/client/?page=2\", \"previous\"=\u003enil, \"results\"=\u003e[{\"id\"=\u003e1, \"url\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/client/1/\", \"title\"=\u003enil, \"firstname\"=\u003e\"Helmut\", \"lastname\"=\u003e\"Eldridge\", \"organization_name\"=\u003e\"\", \"customer_type\"=\u003e0, \"vat_number\"=\u003e\"\", \"register_number\"=\u003enil, \"home_department\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/department/1/\", \"due_date_delay\"=\u003enil, \"street_address\"=\u003e\"Job Str.\", \"street_address_2\"=\u003enil, \"street_address_3\"=\u003enil, \"zip_code\"=\u003e\"W11 2BQ\", \"city\"=\u003e\"London\", \"state\"=\u003enil, \"email\"=\u003e\"\", \"alt_emails\"=\u003enil, \"id_number\"=\u003e\"\", \"old_client_id\"=\u003enil, \"critical_notes\"=\u003enil, \"critical_accounting_notes\"=\u003enil, \"remarks\"=\u003e\"\", \"archived\"=\u003etrue, \"country\"=\u003e\"\", \"no_sms\"=\u003efalse, \"no_email\"=\u003efalse, \"external\"=\u003efalse, \"referring_organization\"=\u003efalse, \"parent_referring_organization\"=\u003enil, \"referring_vet\"=\u003efalse, \"imported\"=\u003efalse, \"date_imported\"=\u003enil, \"patients\"=\u003e[], \"invoicing_client\"=\u003enil, \"tags_rel\"=\u003e[], \"created\"=\u003e\"2018-03-26T20:16:25-04:00\", \"created_user\"=\u003enil, \"modified\"=\u003e\"2021-06-25T14:13:26-04:00\", \"modified_user\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/user/8/\", \"phone_numbers\"=\u003e[], \"status_type\"=\u003e0, \"fields_rel\"=\u003e[], \"farm_code\"=\u003enil, \"holdingplacenumbers\"=\u003e[], \"communication_preferences\"=\u003enil, \"production_animal_client\"=\u003efalse}, # [...]]}\n```\n\n### `#all`\n\nCalls `#list` as many times as there are pages and returns one array with all related resources. Use with caution if many records.\n\nExample :\n```ruby\nall_provet_clients = Provet::Client.new.all\n# =\u003e [{\"id\"=\u003e1, \"url\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/client/1/\", \"title\"=\u003enil, \"firstname\"=\u003e\"Helmut\", \"lastname\"=\u003e\"Eldridge\", \"organization_name\"=\u003e\"\", \"customer_type\"=\u003e0, \"vat_number\"=\u003e\"\", \"register_number\"=\u003enil, \"home_department\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/department/1/\", \"due_date_delay\"=\u003enil, \"street_address\"=\u003e\"Job Str.\", \"street_address_2\"=\u003enil, \"street_address_3\"=\u003enil, \"zip_code\"=\u003e\"W11 2BQ\", \"city\"=\u003e\"London\", \"state\"=\u003enil, \"email\"=\u003e\"\", \"alt_emails\"=\u003enil, \"id_number\"=\u003e\"\", \"old_client_id\"=\u003enil, \"critical_notes\"=\u003enil, \"critical_accounting_notes\"=\u003enil, \"remarks\"=\u003e\"\", \"archived\"=\u003etrue, \"country\"=\u003e\"\", \"no_sms\"=\u003efalse, \"no_email\"=\u003efalse, \"external\"=\u003efalse, \"referring_organization\"=\u003efalse, \"parent_referring_organization\"=\u003enil, \"referring_vet\"=\u003efalse, \"imported\"=\u003efalse, \"date_imported\"=\u003enil, \"patients\"=\u003e[], \"invoicing_client\"=\u003enil, \"tags_rel\"=\u003e[], \"created\"=\u003e\"2018-03-26T20:16:25-04:00\", \"created_user\"=\u003enil, \"modified\"=\u003e\"2021-06-25T14:13:26-04:00\", \"modified_user\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/user/8/\", \"phone_numbers\"=\u003e[], \"status_type\"=\u003e0, \"fields_rel\"=\u003e[], \"farm_code\"=\u003enil, \"holdingplacenumbers\"=\u003e[], \"communication_preferences\"=\u003enil, \"production_animal_client\"=\u003efalse}, {[...]}]\n```\n\n\n### `#find(id: String)`\n\nReturns the corresponding provet resource.\n\n```ruby\nres = Provet::Client.new.find(1)\nres.parsed_response\n# =\u003e {\"id\"=\u003e1, \"url\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/client/1/\", \"title\"=\u003enil, \"firstname\"=\u003e\"Helmut\", \"lastname\"=\u003e\"Eldridge\", \"organization_name\"=\u003e\"\", \"customer_type\"=\u003e0, \"vat_number\"=\u003e\"\", \"register_number\"=\u003enil, \"home_department\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/department/1/\", \"due_date_delay\"=\u003enil, \"street_address\"=\u003e\"Job Str.\", \"street_address_2\"=\u003enil, \"street_address_3\"=\u003enil, \"zip_code\"=\u003e\"W11 2BQ\", \"city\"=\u003e\"London\", \"state\"=\u003enil, \"email\"=\u003e\"\", \"alt_emails\"=\u003enil, \"id_number\"=\u003e\"\", \"old_client_id\"=\u003enil, \"critical_notes\"=\u003enil, \"critical_accounting_notes\"=\u003enil, \"remarks\"=\u003e\"\", \"archived\"=\u003etrue, \"country\"=\u003e\"\", \"no_sms\"=\u003efalse, \"no_email\"=\u003efalse, \"external\"=\u003efalse, \"referring_organization\"=\u003efalse, \"parent_referring_organization\"=\u003enil, \"referring_vet\"=\u003efalse, \"imported\"=\u003efalse, \"date_imported\"=\u003enil, \"patients\"=\u003e[], \"invoicing_client\"=\u003enil, \"tags_rel\"=\u003e[], \"created\"=\u003e\"2018-03-26T20:16:25-04:00\", \"created_user\"=\u003enil, \"modified\"=\u003e\"2021-06-25T14:13:26-04:00\", \"modified_user\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/user/8/\", \"phone_numbers\"=\u003e[], \"status_type\"=\u003e0, \"fields_rel\"=\u003e[], \"farm_code\"=\u003enil, \"holdingplacenumbers\"=\u003e[], \"communication_preferences\"=\u003enil, \"production_animal_client\"=\u003efalse}\n```\n\n### `#create(payload: JSON)`\n\nCreates a Provet resource and returns that resource.\nExample :\n\n```ruby\npayload = {\n  firstname: \"Luke\",\n  lastname: \"Skywalker\",\n  email: \"luke@example.com\",\n  patients: [],\n}\n\nres = Provet::Client.new.create(payload.to_json)\nres.parsed_response\n# =\u003e {\"id\"=\u003e42, \"url\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/client/42/\", \"title\"=\u003enil, \"firstname\"=\u003e\"Luke\", \"lastname\"=\u003e\"Skywalker\", \"organization_name\"=\u003e\"\", \"customer_type\"=\u003e0, \"vat_number\"=\u003e\"\", \"register_number\"=\u003enil, \"home_department\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/department/1/\", \"due_date_delay\"=\u003enil, \"street_address\"=\u003e\"Job Str.\", \"street_address_2\"=\u003enil, \"street_address_3\"=\u003enil, \"zip_code\"=\u003e\"nil\", \"city\"=\u003e\"nil\", \"state\"=\u003enil, \"email\"=\u003e\"\", \"alt_emails\"=\u003enil, \"id_number\"=\u003e\"\", \"old_client_id\"=\u003enil, \"critical_notes\"=\u003enil, \"critical_accounting_notes\"=\u003enil, \"remarks\"=\u003e\"\", \"archived\"=\u003etrue, \"country\"=\u003e\"\", \"no_sms\"=\u003efalse, \"no_email\"=\u003efalse, \"external\"=\u003efalse, \"referring_organization\"=\u003efalse, \"parent_referring_organization\"=\u003enil, \"referring_vet\"=\u003efalse, \"imported\"=\u003efalse, \"date_imported\"=\u003enil, \"patients\"=\u003e[], \"invoicing_client\"=\u003enil, \"tags_rel\"=\u003e[], \"created\"=\u003e\"2021-03-26T20:16:25-04:00\", \"created_user\"=\u003enil, \"modified\"=\u003e\"2021-06-25T14:13:26-04:00\", \"modified_user\"=\u003enil, \"phone_numbers\"=\u003e[], \"status_type\"=\u003e0, \"fields_rel\"=\u003e[], \"farm_code\"=\u003enil, \"holdingplacenumbers\"=\u003e[], \"communication_preferences\"=\u003enil, \"production_animal_client\"=\u003efalse}\n```\n\n### `#update(id: String, payload: JSON)`\nUpdates a Provet resource and returns that resource.\n\n```ruby\npayload = {\n  firstname: \"Luke\",\n  lastname: \"Skywalker\",\n  email: \"luke@example.com\",\n  patients: [],\n}\n\nres = Provet::Client.new.update(1, payload.to_json)\nres.parsed_response\n# =\u003e {\"id\"=\u003e1, \"url\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/client/1/\", \"title\"=\u003enil, \"firstname\"=\u003e\"Luke\", \"lastname\"=\u003e\"Skywalker\", \"organization_name\"=\u003e\"\", \"customer_type\"=\u003e0, \"vat_number\"=\u003e\"\", \"register_number\"=\u003enil, \"home_department\"=\u003e\"https://us.provetcloud.com/1234/api/0.1/department/1/\", \"due_date_delay\"=\u003enil, \"street_address\"=\u003e\"Job Str.\", \"street_address_2\"=\u003enil, \"street_address_3\"=\u003enil, \"zip_code\"=\u003e\"nil\", \"city\"=\u003e\"nil\", \"state\"=\u003enil, \"email\"=\u003e\"\", \"alt_emails\"=\u003enil, \"id_number\"=\u003e\"\", \"old_client_id\"=\u003enil, \"critical_notes\"=\u003enil, \"critical_accounting_notes\"=\u003enil, \"remarks\"=\u003e\"\", \"archived\"=\u003etrue, \"country\"=\u003e\"\", \"no_sms\"=\u003efalse, \"no_email\"=\u003efalse, \"external\"=\u003efalse, \"referring_organization\"=\u003efalse, \"parent_referring_organization\"=\u003enil, \"referring_vet\"=\u003efalse, \"imported\"=\u003efalse, \"date_imported\"=\u003enil, \"patients\"=\u003e[], \"invoicing_client\"=\u003enil, \"tags_rel\"=\u003e[], \"created\"=\u003e\"2021-03-26T20:16:25-04:00\", \"created_user\"=\u003enil, \"modified\"=\u003e\"2021-06-25T14:13:26-04:00\", \"modified_user\"=\u003enil, \"phone_numbers\"=\u003e[], \"status_type\"=\u003e0, \"fields_rel\"=\u003e[], \"farm_code\"=\u003enil, \"holdingplacenumbers\"=\u003e[], \"communication_preferences\"=\u003enil, \"production_animal_client\"=\u003efalse}\n```\n\n### `#destroy(id: String)`\n\nDestroys a Provet resource.\nExample:\n\n```ruby\nres = Provet::Client.new.destroy(1)\n```\n\n## Additional notes\n\n### Non allowed methods\n\nSome endpoints do not allow certain requests to be made. For example, you can read user groups, but you can't write (create, update or destroy). When an attempt at calling a method that is not allowed, a `Provet::MethodNotAllowedError` error will be thrown.\n\n### Soft deletion\n\nSome Provet resources are configured to be soft-deletable with this gem:\n- Provet::Appointment\n- Provet::Client\n- Provet::Patient\n- Provet::User\n\nFor these classes, calling `#destroy` will perform a `PATCH` http request to archive the resource in Provet, instead of actually erasing it.\n\nSome of those soft-deletable resources can be hard-destroy by calling `#really_destroy!` on them.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/EmCousin/provet-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/EmCousin/provet-client/blob/master/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Provet::Client project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/provet-client/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femcousin%2Fprovet-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femcousin%2Fprovet-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femcousin%2Fprovet-client/lists"}