{"id":21976783,"url":"https://github.com/stuartapp/stuart-client-ruby","last_synced_at":"2025-04-28T16:40:49.033Z","repository":{"id":29848201,"uuid":"120930845","full_name":"StuartApp/stuart-client-ruby","owner":"StuartApp","description":"Stuart Ruby client","archived":false,"fork":false,"pushed_at":"2023-01-02T16:01:13.000Z","size":51,"stargazers_count":0,"open_issues_count":2,"forks_count":5,"subscribers_count":53,"default_branch":"master","last_synced_at":"2025-04-26T03:33:03.420Z","etag":null,"topics":["delivery","ruby-gem","stuart"],"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/StuartApp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-09T16:45:54.000Z","updated_at":"2022-06-14T08:11:07.000Z","dependencies_parsed_at":"2023-01-14T15:46:09.439Z","dependency_job_id":null,"html_url":"https://github.com/StuartApp/stuart-client-ruby","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StuartApp%2Fstuart-client-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StuartApp%2Fstuart-client-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StuartApp%2Fstuart-client-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StuartApp%2Fstuart-client-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StuartApp","download_url":"https://codeload.github.com/StuartApp/stuart-client-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251347565,"owners_count":21575103,"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","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":["delivery","ruby-gem","stuart"],"created_at":"2024-11-29T16:12:16.429Z","updated_at":"2025-04-28T16:40:49.007Z","avatar_url":"https://github.com/StuartApp.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Codeship Status for StuartApp/stuart-client-ruby](https://app.codeship.com/projects/bacc9100-b159-0137-6e98-0e2ebd2815ea/status?branch=master)](https://app.codeship.com/projects/363050)\n\n# Stuart Ruby Client\nFor a complete documentation of all endpoints offered by the Stuart API, you can visit [Stuart API documentation](https://api-docs.stuart.com/).\n\n## Install\n``` bash\n$ gem install stuart-client-ruby\n```\n\n## Usage\n\n### Initialize HTTP client\n\n```ruby\nrequire 'stuart-client-ruby'\nenvironment = Stuart::Infrastructure::Environment::SANDBOX\napi_client_id = 'c6058849d0a056fc743203acb8e6a850dad103485c3edc51b16a9260cc7a7689' # can be found here: https://admin.sandbox.stuart.com/client/api\napi_client_secret = 'aa6a415fce31967501662c1960fcbfbf4745acff99acb19dbc1aae6f76c9c618' # can be found here: https://admin.sandbox.stuart.com/client/api\nauth = Stuart::Infrastructure::Authenticator.new(environment, api_client_id, api_client_secret)\n\nhttp_client = Stuart::Infrastructure::HttpClient.new(auth)\n```\n\n### Custom requests\n\n#### Example: create a job\n\n```ruby\njob = {\n  job: {\n    transport_type: \"bike\",\n    pickups: [\n      {\n        address: \"46 Boulevard Barbès, 75018 Paris\",\n        comment: \"Wait outside for an employee to come.\",\n        contact: {\n          firstname: \"Martin\",\n          lastname: \"Pont\",\n          phone: \"+33698348756\",\n          company: \"KFC Paris Barbès\"\n        }\n      }\n    ],\n    dropoffs: [\n      {\n        address: \"156 rue de Charonne, 75011 Paris\",\n        package_description: \"Red packet.\",\n        client_reference: \"12345678ABCDE\", # must be unique\n        comment: \"code: 3492B. 3e étage droite. Sonner à Durand.\",\n        contact: {\n          firstname: \"Alex\",\n          lastname: \"Durand\",\n          phone: \"+33634981209\",\n          company: \"Durand associates.\"\n        }\n      }\n    ]\n  }\n}\n\nhttp_client.perform_post '/v2/jobs', JSON.generate(job)\n```\n\n#### Example: get a list of jobs\n\n```ruby\nhttp_client.perform_get('/v2/jobs')\n```\n\n### Release process\n\n1. Review the Gem version in lib/stuart-client-ruby/version.rb\n2. Create and publish a Git tag with the version defined in lib/stuart-client-ruby/version.rb\nExample:\n```\ngit tag v1.2.0-rc.1\ngit push origin --tags\n```\n\n3. The workflow [workflows/publish.yml](https://github.com/StuartApp/stuart-client-ruby/actions/workflows/publish.yml) should start and publish the new version to Rubygems https://rubygems.org/gems/stuart-client-ruby\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuartapp%2Fstuart-client-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstuartapp%2Fstuart-client-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuartapp%2Fstuart-client-ruby/lists"}