crisphive 0.1.0

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.
Files changed (108) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +219 -0
  4. data/Rakefile +10 -0
  5. data/crisphive.gemspec +40 -0
  6. data/git_push.sh +57 -0
  7. data/lib/crisphive/api/business_skill_api.rb +211 -0
  8. data/lib/crisphive/api/customer_api.rb +371 -0
  9. data/lib/crisphive/api/job_request_business_api.rb +449 -0
  10. data/lib/crisphive/api/job_types_api.rb +141 -0
  11. data/lib/crisphive/api/service_area_api.rb +148 -0
  12. data/lib/crisphive/api/technician_api.rb +163 -0
  13. data/lib/crisphive/api/vehicle_api.rb +157 -0
  14. data/lib/crisphive/api_client.rb +437 -0
  15. data/lib/crisphive/api_error.rb +58 -0
  16. data/lib/crisphive/configuration.rb +393 -0
  17. data/lib/crisphive/models/create_customer200_response.rb +250 -0
  18. data/lib/crisphive/models/create_job_request200_response.rb +250 -0
  19. data/lib/crisphive/models/customer.rb +235 -0
  20. data/lib/crisphive/models/customer_address.rb +295 -0
  21. data/lib/crisphive/models/customer_address_request.rb +475 -0
  22. data/lib/crisphive/models/customer_contact.rb +255 -0
  23. data/lib/crisphive/models/customer_create_request.rb +383 -0
  24. data/lib/crisphive/models/customer_create_response.rb +215 -0
  25. data/lib/crisphive/models/customer_list.rb +247 -0
  26. data/lib/crisphive/models/customer_list_item.rb +341 -0
  27. data/lib/crisphive/models/customer_profile.rb +321 -0
  28. data/lib/crisphive/models/customer_spending.rb +299 -0
  29. data/lib/crisphive/models/customer_tier_progress.rb +235 -0
  30. data/lib/crisphive/models/customer_update_request.rb +434 -0
  31. data/lib/crisphive/models/get_customer200_response.rb +250 -0
  32. data/lib/crisphive/models/get_job_request200_response.rb +250 -0
  33. data/lib/crisphive/models/get_job_request_timeline200_response.rb +250 -0
  34. data/lib/crisphive/models/get_job_type200_response.rb +250 -0
  35. data/lib/crisphive/models/get_service_area200_response.rb +250 -0
  36. data/lib/crisphive/models/get_technician200_response.rb +250 -0
  37. data/lib/crisphive/models/get_vehicle200_response.rb +250 -0
  38. data/lib/crisphive/models/job_date.rb +225 -0
  39. data/lib/crisphive/models/job_date_business_range.rb +263 -0
  40. data/lib/crisphive/models/job_date_period.rb +41 -0
  41. data/lib/crisphive/models/job_date_period_entry.rb +247 -0
  42. data/lib/crisphive/models/job_request.rb +537 -0
  43. data/lib/crisphive/models/job_request_action_audit_by.rb +259 -0
  44. data/lib/crisphive/models/job_request_action_audit_entry.rb +235 -0
  45. data/lib/crisphive/models/job_request_action_summary.rb +281 -0
  46. data/lib/crisphive/models/job_request_address_summary.rb +295 -0
  47. data/lib/crisphive/models/job_request_archive_summary.rb +245 -0
  48. data/lib/crisphive/models/job_request_arrival_window.rb +235 -0
  49. data/lib/crisphive/models/job_request_assigned_vehicle.rb +225 -0
  50. data/lib/crisphive/models/job_request_assignment_summary.rb +255 -0
  51. data/lib/crisphive/models/job_request_booking_windows.rb +247 -0
  52. data/lib/crisphive/models/job_request_business_time_range.rb +279 -0
  53. data/lib/crisphive/models/job_request_changes.rb +237 -0
  54. data/lib/crisphive/models/job_request_create_request.rb +339 -0
  55. data/lib/crisphive/models/job_request_create_response.rb +245 -0
  56. data/lib/crisphive/models/job_request_crew_member.rb +352 -0
  57. data/lib/crisphive/models/job_request_customer_summary.rb +245 -0
  58. data/lib/crisphive/models/job_request_day_windows.rb +227 -0
  59. data/lib/crisphive/models/job_request_job_date_business_range_request.rb +279 -0
  60. data/lib/crisphive/models/job_request_job_date_period_request.rb +268 -0
  61. data/lib/crisphive/models/job_request_job_date_request.rb +269 -0
  62. data/lib/crisphive/models/job_request_list.rb +227 -0
  63. data/lib/crisphive/models/job_request_period.rb +261 -0
  64. data/lib/crisphive/models/job_request_quote_summary.rb +245 -0
  65. data/lib/crisphive/models/job_request_rating_summary.rb +245 -0
  66. data/lib/crisphive/models/job_request_schedule.rb +289 -0
  67. data/lib/crisphive/models/job_request_session.rb +274 -0
  68. data/lib/crisphive/models/job_request_skill_summary.rb +255 -0
  69. data/lib/crisphive/models/job_request_status_summary.rb +225 -0
  70. data/lib/crisphive/models/job_request_technician_info.rb +265 -0
  71. data/lib/crisphive/models/job_request_timeline.rb +257 -0
  72. data/lib/crisphive/models/job_request_timeline_action.rb +311 -0
  73. data/lib/crisphive/models/job_request_timeline_event.rb +291 -0
  74. data/lib/crisphive/models/job_type.rb +309 -0
  75. data/lib/crisphive/models/list_customers200_response.rb +250 -0
  76. data/lib/crisphive/models/list_job_request_booking_windows200_response.rb +250 -0
  77. data/lib/crisphive/models/list_job_request_changes200_response.rb +250 -0
  78. data/lib/crisphive/models/list_job_requests200_response.rb +250 -0
  79. data/lib/crisphive/models/list_job_types200_response.rb +252 -0
  80. data/lib/crisphive/models/list_service_areas200_response.rb +250 -0
  81. data/lib/crisphive/models/list_skill_categories200_response.rb +250 -0
  82. data/lib/crisphive/models/list_skills200_response.rb +250 -0
  83. data/lib/crisphive/models/list_skills_by_category200_response.rb +250 -0
  84. data/lib/crisphive/models/list_technicians200_response.rb +250 -0
  85. data/lib/crisphive/models/list_vehicles200_response.rb +250 -0
  86. data/lib/crisphive/models/pagination.rb +250 -0
  87. data/lib/crisphive/models/response_envelope.rb +244 -0
  88. data/lib/crisphive/models/service_area.rb +315 -0
  89. data/lib/crisphive/models/service_area_list.rb +227 -0
  90. data/lib/crisphive/models/skill.rb +278 -0
  91. data/lib/crisphive/models/skill_by_category_list.rb +225 -0
  92. data/lib/crisphive/models/skill_category.rb +250 -0
  93. data/lib/crisphive/models/skill_category_list.rb +225 -0
  94. data/lib/crisphive/models/skill_list.rb +217 -0
  95. data/lib/crisphive/models/skill_summary.rb +255 -0
  96. data/lib/crisphive/models/technician.rb +499 -0
  97. data/lib/crisphive/models/technician_address.rb +275 -0
  98. data/lib/crisphive/models/technician_lead_ref.rb +225 -0
  99. data/lib/crisphive/models/technician_list.rb +247 -0
  100. data/lib/crisphive/models/technician_service_area_ref.rb +225 -0
  101. data/lib/crisphive/models/technician_status.rb +41 -0
  102. data/lib/crisphive/models/vehicle.rb +413 -0
  103. data/lib/crisphive/models/vehicle_list.rb +247 -0
  104. data/lib/crisphive/models/vehicle_owner.rb +225 -0
  105. data/lib/crisphive/version.rb +15 -0
  106. data/lib/crisphive.rb +134 -0
  107. data/spec/spec_helper.rb +111 -0
  108. metadata +220 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1ea71e345767c63c9580d0c9d27e917eac5b39841795b58a1168c8e087a8d750
4
+ data.tar.gz: 6b6a8e958bec2b6bbd18780b48a9b9eeabc03639d65bd13ad71aab74f0b07713
5
+ SHA512:
6
+ metadata.gz: d1c0cb7cf0c4935756695f2d586d1cd8aa4a8134fef772137bb2825dbec04e253b824a49e6439a4ba93af6c71adf61834d500a4928eaadd1b120db80c341dbc8
7
+ data.tar.gz: 944ca1a86086463ed7ebaa5ecd4afb886786c24c7d424ae5dc3a1cc5d6caa640cc461d114cab1aa98d2a2667d09698f16e10817ed5c94151a3989432f8f326f4
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 13.0.1'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
9
+ end
data/README.md ADDED
@@ -0,0 +1,219 @@
1
+ # crisphive
2
+
3
+ Crisphive - the Ruby gem for the CrispHive Developer API
4
+
5
+ Public REST API for integrating CrispHive from your own backend. Authenticate every request with a secret API key as a Bearer token (`Authorization: Bearer chsk_live_…`). The key prefix selects the data environment: `chsk_live_…` → production (live), `chsk_test_…` → sandbox (isolated test).
6
+
7
+ **Key scopes (restricted keys).** A key is either *full-access* (can call every endpoint below) or *restricted* to a set of permission codes chosen at creation — the same codes as the dashboard permission grid (e.g. `customers_view`, `job_create`, `team_manage`). A restricted key calling an endpoint outside its scope gets `403`. The full code list is the permission catalog (`GET /permission/modules` on the dashboard API). Create, scope, and revoke keys from the business dashboard.
8
+
9
+ Every response is wrapped in the envelope `{ \"error_code\": 0, \"message\": \"Success\", \"data\": <payload> }`.
10
+
11
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
12
+
13
+ - API version: 1.0
14
+ - Package version: 0.1.0
15
+ - Generator version: 7.11.0
16
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
17
+
18
+ ## Installation
19
+
20
+ ### Build a gem
21
+
22
+ To build the Ruby code into a gem:
23
+
24
+ ```shell
25
+ gem build crisphive.gemspec
26
+ ```
27
+
28
+ Then either install the gem locally:
29
+
30
+ ```shell
31
+ gem install ./crisphive-0.1.0.gem
32
+ ```
33
+
34
+ (for development, run `gem install --dev ./crisphive-0.1.0.gem` to install the development dependencies)
35
+
36
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
37
+
38
+ Finally add this to the Gemfile:
39
+
40
+ gem 'crisphive', '~> 0.1.0'
41
+
42
+ ### Install from Git
43
+
44
+ If the Ruby gem is hosted at a git repository: https://github.com/crisphive/crisphive-ruby, then add the following in the Gemfile:
45
+
46
+ gem 'crisphive', :git => 'https://github.com/crisphive/crisphive-ruby.git'
47
+
48
+ ### Include the Ruby code directly
49
+
50
+ Include the Ruby code directly using `-I` as follows:
51
+
52
+ ```shell
53
+ ruby -Ilib script.rb
54
+ ```
55
+
56
+ ## Getting Started
57
+
58
+ Please follow the [installation](#installation) procedure and then run the following code:
59
+
60
+ ```ruby
61
+ # Load the gem
62
+ require 'crisphive'
63
+
64
+ # Setup authorization
65
+ Crisphive.configure do |config|
66
+ # Configure Bearer authorization (CrispHive secret key): ApiKeyAuth
67
+ config.access_token = 'YOUR_BEARER_TOKEN'
68
+ # Configure a proc to get access tokens in lieu of the static access_token configuration
69
+ config.access_token_getter = -> { 'YOUR TOKEN GETTER PROC' }
70
+ # Configure faraday connection
71
+ config.configure_faraday_connection { |connection| 'YOUR CONNECTION CONFIG PROC' }
72
+ end
73
+
74
+ api_instance = Crisphive::BusinessSkillApi.new
75
+ opts = {
76
+ page: 56, # Integer | Page number (default: 1)
77
+ limit: 56 # Integer | Page size (default: 15, max: 1000)
78
+ }
79
+
80
+ begin
81
+ #List skill categories
82
+ result = api_instance.list_skill_categories(opts)
83
+ p result
84
+ rescue Crisphive::ApiError => e
85
+ puts "Exception when calling BusinessSkillApi->list_skill_categories: #{e}"
86
+ end
87
+
88
+ ```
89
+
90
+ ## Documentation for API Endpoints
91
+
92
+ All URIs are relative to *https://api.crisphive.com/v1*
93
+
94
+ Class | Method | HTTP request | Description
95
+ ------------ | ------------- | ------------- | -------------
96
+ *Crisphive::BusinessSkillApi* | [**list_skill_categories**](docs/BusinessSkillApi.md#list_skill_categories) | **GET** /skill-categories | List skill categories
97
+ *Crisphive::BusinessSkillApi* | [**list_skills**](docs/BusinessSkillApi.md#list_skills) | **GET** /skills | List all skills
98
+ *Crisphive::BusinessSkillApi* | [**list_skills_by_category**](docs/BusinessSkillApi.md#list_skills_by_category) | **GET** /skill-categories/{id}/skills | List skills in a category
99
+ *Crisphive::CustomerApi* | [**create_customer**](docs/CustomerApi.md#create_customer) | **POST** /customers | Create a customer
100
+ *Crisphive::CustomerApi* | [**delete_customer**](docs/CustomerApi.md#delete_customer) | **DELETE** /customers/{id} | Delete a customer
101
+ *Crisphive::CustomerApi* | [**get_customer**](docs/CustomerApi.md#get_customer) | **GET** /customers/{id} | Get a customer
102
+ *Crisphive::CustomerApi* | [**list_customers**](docs/CustomerApi.md#list_customers) | **GET** /customers | List customers
103
+ *Crisphive::CustomerApi* | [**update_customer**](docs/CustomerApi.md#update_customer) | **PUT** /customers/{id} | Update a customer
104
+ *Crisphive::JobRequestBusinessApi* | [**create_job_request**](docs/JobRequestBusinessApi.md#create_job_request) | **POST** /job-requests | Create a job request (business actor)
105
+ *Crisphive::JobRequestBusinessApi* | [**get_job_request**](docs/JobRequestBusinessApi.md#get_job_request) | **GET** /job-requests/{id} | Get a job request
106
+ *Crisphive::JobRequestBusinessApi* | [**get_job_request_timeline**](docs/JobRequestBusinessApi.md#get_job_request_timeline) | **GET** /job-requests/{id}/timeline | Job timeline (business surface — also serves tech via BusinessAuth)
107
+ *Crisphive::JobRequestBusinessApi* | [**list_job_request_booking_windows**](docs/JobRequestBusinessApi.md#list_job_request_booking_windows) | **GET** /job-requests/booking-windows | Booking availability (business actor)
108
+ *Crisphive::JobRequestBusinessApi* | [**list_job_request_changes**](docs/JobRequestBusinessApi.md#list_job_request_changes) | **GET** /job-requests/changes | Poll for new & changed job requests (sync feed)
109
+ *Crisphive::JobRequestBusinessApi* | [**list_job_requests**](docs/JobRequestBusinessApi.md#list_job_requests) | **GET** /job-requests | List job requests
110
+ *Crisphive::JobTypesApi* | [**get_job_type**](docs/JobTypesApi.md#get_job_type) | **GET** /job-types/{id} | Get a job type
111
+ *Crisphive::JobTypesApi* | [**list_job_types**](docs/JobTypesApi.md#list_job_types) | **GET** /job-types | List job types
112
+ *Crisphive::ServiceAreaApi* | [**get_service_area**](docs/ServiceAreaApi.md#get_service_area) | **GET** /service-areas/{id} | Get a service area
113
+ *Crisphive::ServiceAreaApi* | [**list_service_areas**](docs/ServiceAreaApi.md#list_service_areas) | **GET** /service-areas | List service areas
114
+ *Crisphive::TechnicianApi* | [**get_technician**](docs/TechnicianApi.md#get_technician) | **GET** /technicians/{id} | Get a technician
115
+ *Crisphive::TechnicianApi* | [**list_technicians**](docs/TechnicianApi.md#list_technicians) | **GET** /technicians | List technicians
116
+ *Crisphive::VehicleApi* | [**get_vehicle**](docs/VehicleApi.md#get_vehicle) | **GET** /vehicles/{id} | Get a vehicle
117
+ *Crisphive::VehicleApi* | [**list_vehicles**](docs/VehicleApi.md#list_vehicles) | **GET** /vehicles | List vehicles
118
+
119
+
120
+ ## Documentation for Models
121
+
122
+ - [Crisphive::CreateCustomer200Response](docs/CreateCustomer200Response.md)
123
+ - [Crisphive::CreateJobRequest200Response](docs/CreateJobRequest200Response.md)
124
+ - [Crisphive::Customer](docs/Customer.md)
125
+ - [Crisphive::CustomerAddress](docs/CustomerAddress.md)
126
+ - [Crisphive::CustomerAddressRequest](docs/CustomerAddressRequest.md)
127
+ - [Crisphive::CustomerContact](docs/CustomerContact.md)
128
+ - [Crisphive::CustomerCreateRequest](docs/CustomerCreateRequest.md)
129
+ - [Crisphive::CustomerCreateResponse](docs/CustomerCreateResponse.md)
130
+ - [Crisphive::CustomerList](docs/CustomerList.md)
131
+ - [Crisphive::CustomerListItem](docs/CustomerListItem.md)
132
+ - [Crisphive::CustomerProfile](docs/CustomerProfile.md)
133
+ - [Crisphive::CustomerSpending](docs/CustomerSpending.md)
134
+ - [Crisphive::CustomerTierProgress](docs/CustomerTierProgress.md)
135
+ - [Crisphive::CustomerUpdateRequest](docs/CustomerUpdateRequest.md)
136
+ - [Crisphive::GetCustomer200Response](docs/GetCustomer200Response.md)
137
+ - [Crisphive::GetJobRequest200Response](docs/GetJobRequest200Response.md)
138
+ - [Crisphive::GetJobRequestTimeline200Response](docs/GetJobRequestTimeline200Response.md)
139
+ - [Crisphive::GetJobType200Response](docs/GetJobType200Response.md)
140
+ - [Crisphive::GetServiceArea200Response](docs/GetServiceArea200Response.md)
141
+ - [Crisphive::GetTechnician200Response](docs/GetTechnician200Response.md)
142
+ - [Crisphive::GetVehicle200Response](docs/GetVehicle200Response.md)
143
+ - [Crisphive::JobDate](docs/JobDate.md)
144
+ - [Crisphive::JobDateBusinessRange](docs/JobDateBusinessRange.md)
145
+ - [Crisphive::JobDatePeriod](docs/JobDatePeriod.md)
146
+ - [Crisphive::JobDatePeriodEntry](docs/JobDatePeriodEntry.md)
147
+ - [Crisphive::JobRequest](docs/JobRequest.md)
148
+ - [Crisphive::JobRequestActionAuditBy](docs/JobRequestActionAuditBy.md)
149
+ - [Crisphive::JobRequestActionAuditEntry](docs/JobRequestActionAuditEntry.md)
150
+ - [Crisphive::JobRequestActionSummary](docs/JobRequestActionSummary.md)
151
+ - [Crisphive::JobRequestAddressSummary](docs/JobRequestAddressSummary.md)
152
+ - [Crisphive::JobRequestArchiveSummary](docs/JobRequestArchiveSummary.md)
153
+ - [Crisphive::JobRequestArrivalWindow](docs/JobRequestArrivalWindow.md)
154
+ - [Crisphive::JobRequestAssignedVehicle](docs/JobRequestAssignedVehicle.md)
155
+ - [Crisphive::JobRequestAssignmentSummary](docs/JobRequestAssignmentSummary.md)
156
+ - [Crisphive::JobRequestBookingWindows](docs/JobRequestBookingWindows.md)
157
+ - [Crisphive::JobRequestBusinessTimeRange](docs/JobRequestBusinessTimeRange.md)
158
+ - [Crisphive::JobRequestChanges](docs/JobRequestChanges.md)
159
+ - [Crisphive::JobRequestCreateRequest](docs/JobRequestCreateRequest.md)
160
+ - [Crisphive::JobRequestCreateResponse](docs/JobRequestCreateResponse.md)
161
+ - [Crisphive::JobRequestCrewMember](docs/JobRequestCrewMember.md)
162
+ - [Crisphive::JobRequestCustomerSummary](docs/JobRequestCustomerSummary.md)
163
+ - [Crisphive::JobRequestDayWindows](docs/JobRequestDayWindows.md)
164
+ - [Crisphive::JobRequestJobDateBusinessRangeRequest](docs/JobRequestJobDateBusinessRangeRequest.md)
165
+ - [Crisphive::JobRequestJobDatePeriodRequest](docs/JobRequestJobDatePeriodRequest.md)
166
+ - [Crisphive::JobRequestJobDateRequest](docs/JobRequestJobDateRequest.md)
167
+ - [Crisphive::JobRequestList](docs/JobRequestList.md)
168
+ - [Crisphive::JobRequestPeriod](docs/JobRequestPeriod.md)
169
+ - [Crisphive::JobRequestQuoteSummary](docs/JobRequestQuoteSummary.md)
170
+ - [Crisphive::JobRequestRatingSummary](docs/JobRequestRatingSummary.md)
171
+ - [Crisphive::JobRequestSchedule](docs/JobRequestSchedule.md)
172
+ - [Crisphive::JobRequestSession](docs/JobRequestSession.md)
173
+ - [Crisphive::JobRequestSkillSummary](docs/JobRequestSkillSummary.md)
174
+ - [Crisphive::JobRequestStatusSummary](docs/JobRequestStatusSummary.md)
175
+ - [Crisphive::JobRequestTechnicianInfo](docs/JobRequestTechnicianInfo.md)
176
+ - [Crisphive::JobRequestTimeline](docs/JobRequestTimeline.md)
177
+ - [Crisphive::JobRequestTimelineAction](docs/JobRequestTimelineAction.md)
178
+ - [Crisphive::JobRequestTimelineEvent](docs/JobRequestTimelineEvent.md)
179
+ - [Crisphive::JobType](docs/JobType.md)
180
+ - [Crisphive::ListCustomers200Response](docs/ListCustomers200Response.md)
181
+ - [Crisphive::ListJobRequestBookingWindows200Response](docs/ListJobRequestBookingWindows200Response.md)
182
+ - [Crisphive::ListJobRequestChanges200Response](docs/ListJobRequestChanges200Response.md)
183
+ - [Crisphive::ListJobRequests200Response](docs/ListJobRequests200Response.md)
184
+ - [Crisphive::ListJobTypes200Response](docs/ListJobTypes200Response.md)
185
+ - [Crisphive::ListServiceAreas200Response](docs/ListServiceAreas200Response.md)
186
+ - [Crisphive::ListSkillCategories200Response](docs/ListSkillCategories200Response.md)
187
+ - [Crisphive::ListSkills200Response](docs/ListSkills200Response.md)
188
+ - [Crisphive::ListSkillsByCategory200Response](docs/ListSkillsByCategory200Response.md)
189
+ - [Crisphive::ListTechnicians200Response](docs/ListTechnicians200Response.md)
190
+ - [Crisphive::ListVehicles200Response](docs/ListVehicles200Response.md)
191
+ - [Crisphive::Pagination](docs/Pagination.md)
192
+ - [Crisphive::ResponseEnvelope](docs/ResponseEnvelope.md)
193
+ - [Crisphive::ServiceArea](docs/ServiceArea.md)
194
+ - [Crisphive::ServiceAreaList](docs/ServiceAreaList.md)
195
+ - [Crisphive::Skill](docs/Skill.md)
196
+ - [Crisphive::SkillByCategoryList](docs/SkillByCategoryList.md)
197
+ - [Crisphive::SkillCategory](docs/SkillCategory.md)
198
+ - [Crisphive::SkillCategoryList](docs/SkillCategoryList.md)
199
+ - [Crisphive::SkillList](docs/SkillList.md)
200
+ - [Crisphive::SkillSummary](docs/SkillSummary.md)
201
+ - [Crisphive::Technician](docs/Technician.md)
202
+ - [Crisphive::TechnicianAddress](docs/TechnicianAddress.md)
203
+ - [Crisphive::TechnicianLeadRef](docs/TechnicianLeadRef.md)
204
+ - [Crisphive::TechnicianList](docs/TechnicianList.md)
205
+ - [Crisphive::TechnicianServiceAreaRef](docs/TechnicianServiceAreaRef.md)
206
+ - [Crisphive::TechnicianStatus](docs/TechnicianStatus.md)
207
+ - [Crisphive::Vehicle](docs/Vehicle.md)
208
+ - [Crisphive::VehicleList](docs/VehicleList.md)
209
+ - [Crisphive::VehicleOwner](docs/VehicleOwner.md)
210
+
211
+
212
+ ## Documentation for Authorization
213
+
214
+
215
+ Authentication schemes defined for the API:
216
+ ### ApiKeyAuth
217
+
218
+ - **Type**: Bearer authentication (CrispHive secret key)
219
+
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
8
+ rescue LoadError
9
+ # no rspec available
10
+ end
data/crisphive.gemspec ADDED
@@ -0,0 +1,40 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ =begin
4
+ #CrispHive Developer API
5
+
6
+ #Public REST API for integrating CrispHive from your own backend. Authenticate every request with a secret API key as a Bearer token (`Authorization: Bearer chsk_live_…`). The key prefix selects the data environment: `chsk_live_…` → production (live), `chsk_test_…` → sandbox (isolated test). **Key scopes (restricted keys).** A key is either *full-access* (can call every endpoint below) or *restricted* to a set of permission codes chosen at creation — the same codes as the dashboard permission grid (e.g. `customers_view`, `job_create`, `team_manage`). A restricted key calling an endpoint outside its scope gets `403`. The full code list is the permission catalog (`GET /permission/modules` on the dashboard API). Create, scope, and revoke keys from the business dashboard. Every response is wrapped in the envelope `{ \"error_code\": 0, \"message\": \"Success\", \"data\": <payload> }`.
7
+
8
+ The version of the OpenAPI document: 1.0
9
+
10
+ Generated by: https://openapi-generator.tech
11
+ Generator version: 7.11.0
12
+
13
+ =end
14
+
15
+ $:.push File.expand_path("../lib", __FILE__)
16
+ require "crisphive/version"
17
+
18
+ Gem::Specification.new do |s|
19
+ s.name = "crisphive"
20
+ s.version = Crisphive::VERSION
21
+ s.platform = Gem::Platform::RUBY
22
+ s.authors = ["CrispHive"]
23
+ s.email = ["developer@crisphive.com"]
24
+ s.homepage = "https://docs.crisphive.com"
25
+ s.summary = "Official Ruby SDK for the CrispHive API"
26
+ s.description = "Official Ruby SDK for the CrispHive API. Typed access to the public /v1 API - customers, bookings, catalog, team and fleet."
27
+ s.license = "MIT"
28
+ s.required_ruby_version = ">= 2.7"
29
+ s.metadata = { "source_code_uri" => "https://github.com/crisphive/crisphive-ruby", "documentation_uri" => "https://docs.crisphive.com" }
30
+
31
+ s.add_runtime_dependency 'faraday', '>= 1.0.1', '< 3.0'
32
+ s.add_runtime_dependency 'faraday-multipart'
33
+ s.add_runtime_dependency 'marcel'
34
+
35
+ s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
36
+
37
+ s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
38
+ s.executables = []
39
+ s.require_paths = ["lib"]
40
+ end
data/git_push.sh ADDED
@@ -0,0 +1,57 @@
1
+ #!/bin/sh
2
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
3
+ #
4
+ # Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
5
+
6
+ git_user_id=$1
7
+ git_repo_id=$2
8
+ release_note=$3
9
+ git_host=$4
10
+
11
+ if [ "$git_host" = "" ]; then
12
+ git_host="github.com"
13
+ echo "[INFO] No command line input provided. Set \$git_host to $git_host"
14
+ fi
15
+
16
+ if [ "$git_user_id" = "" ]; then
17
+ git_user_id="crisphive"
18
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
19
+ fi
20
+
21
+ if [ "$git_repo_id" = "" ]; then
22
+ git_repo_id="crisphive-ruby"
23
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
24
+ fi
25
+
26
+ if [ "$release_note" = "" ]; then
27
+ release_note="Minor update"
28
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
29
+ fi
30
+
31
+ # Initialize the local directory as a Git repository
32
+ git init
33
+
34
+ # Adds the files in the local repository and stages them for commit.
35
+ git add .
36
+
37
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
38
+ git commit -m "$release_note"
39
+
40
+ # Sets the new remote
41
+ git_remote=$(git remote)
42
+ if [ "$git_remote" = "" ]; then # git remote not defined
43
+
44
+ if [ "$GIT_TOKEN" = "" ]; then
45
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
46
+ git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
47
+ else
48
+ git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
49
+ fi
50
+
51
+ fi
52
+
53
+ git pull origin master
54
+
55
+ # Pushes (Forces) the changes in the local repository up to the remote repository
56
+ echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
57
+ git push origin master 2>&1 | grep -v 'To https'
@@ -0,0 +1,211 @@
1
+ =begin
2
+ #CrispHive Developer API
3
+
4
+ #Public REST API for integrating CrispHive from your own backend. Authenticate every request with a secret API key as a Bearer token (`Authorization: Bearer chsk_live_…`). The key prefix selects the data environment: `chsk_live_…` → production (live), `chsk_test_…` → sandbox (isolated test). **Key scopes (restricted keys).** A key is either *full-access* (can call every endpoint below) or *restricted* to a set of permission codes chosen at creation — the same codes as the dashboard permission grid (e.g. `customers_view`, `job_create`, `team_manage`). A restricted key calling an endpoint outside its scope gets `403`. The full code list is the permission catalog (`GET /permission/modules` on the dashboard API). Create, scope, and revoke keys from the business dashboard. Every response is wrapped in the envelope `{ \"error_code\": 0, \"message\": \"Success\", \"data\": <payload> }`.
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Crisphive
16
+ class BusinessSkillApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List skill categories
23
+ # Returns paginated skill categories for the current business, ordered alphabetically.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [Integer] :page Page number (default: 1)
26
+ # @option opts [Integer] :limit Page size (default: 15, max: 1000)
27
+ # @return [ListSkillCategories200Response]
28
+ def list_skill_categories(opts = {})
29
+ data, _status_code, _headers = list_skill_categories_with_http_info(opts)
30
+ data
31
+ end
32
+
33
+ # List skill categories
34
+ # Returns paginated skill categories for the current business, ordered alphabetically.
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [Integer] :page Page number (default: 1)
37
+ # @option opts [Integer] :limit Page size (default: 15, max: 1000)
38
+ # @return [Array<(ListSkillCategories200Response, Integer, Hash)>] ListSkillCategories200Response data, response status code and response headers
39
+ def list_skill_categories_with_http_info(opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: BusinessSkillApi.list_skill_categories ...'
42
+ end
43
+ # resource path
44
+ local_var_path = '/skill-categories'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
49
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'ListSkillCategories200Response'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"BusinessSkillApi.list_skill_categories",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: BusinessSkillApi#list_skill_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # List all skills
86
+ # Returns the flat list of all active skills for the current business across every category. Use this to discover the skill UUIDs accepted in `skill_ids` when creating a job request. (For a category-grouped view, use GET /skill-categories and GET /skill-categories/{id}/skills.)
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [ListSkills200Response]
89
+ def list_skills(opts = {})
90
+ data, _status_code, _headers = list_skills_with_http_info(opts)
91
+ data
92
+ end
93
+
94
+ # List all skills
95
+ # Returns the flat list of all active skills for the current business across every category. Use this to discover the skill UUIDs accepted in &#x60;skill_ids&#x60; when creating a job request. (For a category-grouped view, use GET /skill-categories and GET /skill-categories/{id}/skills.)
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [Array<(ListSkills200Response, Integer, Hash)>] ListSkills200Response data, response status code and response headers
98
+ def list_skills_with_http_info(opts = {})
99
+ if @api_client.config.debugging
100
+ @api_client.config.logger.debug 'Calling API: BusinessSkillApi.list_skills ...'
101
+ end
102
+ # resource path
103
+ local_var_path = '/skills'
104
+
105
+ # query parameters
106
+ query_params = opts[:query_params] || {}
107
+
108
+ # header parameters
109
+ header_params = opts[:header_params] || {}
110
+ # HTTP header 'Accept' (if needed)
111
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
112
+
113
+ # form parameters
114
+ form_params = opts[:form_params] || {}
115
+
116
+ # http body (model)
117
+ post_body = opts[:debug_body]
118
+
119
+ # return_type
120
+ return_type = opts[:debug_return_type] || 'ListSkills200Response'
121
+
122
+ # auth_names
123
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
124
+
125
+ new_options = opts.merge(
126
+ :operation => :"BusinessSkillApi.list_skills",
127
+ :header_params => header_params,
128
+ :query_params => query_params,
129
+ :form_params => form_params,
130
+ :body => post_body,
131
+ :auth_names => auth_names,
132
+ :return_type => return_type
133
+ )
134
+
135
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
136
+ if @api_client.config.debugging
137
+ @api_client.config.logger.debug "API called: BusinessSkillApi#list_skills\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
138
+ end
139
+ return data, status_code, headers
140
+ end
141
+
142
+ # List skills in a category
143
+ # Returns paginated skills belonging to the given category, ordered alphabetically. The `members` field on each skill is the count of active technicians currently assigned to it.
144
+ # @param id [String] Skill category ID (UUID)
145
+ # @param [Hash] opts the optional parameters
146
+ # @option opts [Integer] :page Page number (default: 1)
147
+ # @option opts [Integer] :limit Page size (default: 15, max: 1000)
148
+ # @return [ListSkillsByCategory200Response]
149
+ def list_skills_by_category(id, opts = {})
150
+ data, _status_code, _headers = list_skills_by_category_with_http_info(id, opts)
151
+ data
152
+ end
153
+
154
+ # List skills in a category
155
+ # Returns paginated skills belonging to the given category, ordered alphabetically. The &#x60;members&#x60; field on each skill is the count of active technicians currently assigned to it.
156
+ # @param id [String] Skill category ID (UUID)
157
+ # @param [Hash] opts the optional parameters
158
+ # @option opts [Integer] :page Page number (default: 1)
159
+ # @option opts [Integer] :limit Page size (default: 15, max: 1000)
160
+ # @return [Array<(ListSkillsByCategory200Response, Integer, Hash)>] ListSkillsByCategory200Response data, response status code and response headers
161
+ def list_skills_by_category_with_http_info(id, opts = {})
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug 'Calling API: BusinessSkillApi.list_skills_by_category ...'
164
+ end
165
+ # verify the required parameter 'id' is set
166
+ if @api_client.config.client_side_validation && id.nil?
167
+ fail ArgumentError, "Missing the required parameter 'id' when calling BusinessSkillApi.list_skills_by_category"
168
+ end
169
+ # resource path
170
+ local_var_path = '/skill-categories/{id}/skills'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
171
+
172
+ # query parameters
173
+ query_params = opts[:query_params] || {}
174
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
175
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
176
+
177
+ # header parameters
178
+ header_params = opts[:header_params] || {}
179
+ # HTTP header 'Accept' (if needed)
180
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
181
+
182
+ # form parameters
183
+ form_params = opts[:form_params] || {}
184
+
185
+ # http body (model)
186
+ post_body = opts[:debug_body]
187
+
188
+ # return_type
189
+ return_type = opts[:debug_return_type] || 'ListSkillsByCategory200Response'
190
+
191
+ # auth_names
192
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
193
+
194
+ new_options = opts.merge(
195
+ :operation => :"BusinessSkillApi.list_skills_by_category",
196
+ :header_params => header_params,
197
+ :query_params => query_params,
198
+ :form_params => form_params,
199
+ :body => post_body,
200
+ :auth_names => auth_names,
201
+ :return_type => return_type
202
+ )
203
+
204
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
205
+ if @api_client.config.debugging
206
+ @api_client.config.logger.debug "API called: BusinessSkillApi#list_skills_by_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
207
+ end
208
+ return data, status_code, headers
209
+ end
210
+ end
211
+ end