Skip to content

Commit 1f31457

Browse files
authored
Remove hotel estimates (#104)
1 parent 2654a03 commit 1f31457

File tree

9 files changed

+91
-214
lines changed

9 files changed

+91
-214
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.4.0] - 2025-05-16
9+
10+
### Removed
11+
12+
- Removes `createHotelEstimate` method
13+
14+
## [2.3.1] - 2025-04-28
15+
16+
### Removed
17+
18+
- Removes `createEcommerceEstimateRequest`
19+
20+
## [2.3.0] - 2025-01-10
21+
22+
### Breaking
23+
24+
- Remove retired estimates API endpoints:
25+
26+
- `createEthereumEstimateRequest`
27+
- `createShippingEstimateRequest`
28+
- `createVehicleEstimateRequest`
29+
30+
## [1.19.0] - 2022-04-11
31+
32+
### Added
33+
34+
- Adds `patch.estimates.createHotelEstimate()` method
35+
836
## [2.2.0] - 2024-05-06
937

1038
### Breaking

README.md

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,6 @@ patch.estimates.createVehicleEstimate({
147147
year: 1995
148148
});
149149

150-
// Create a hotel estimate
151-
const country_code = 'US'; // ISO3166 alpha-2 country code
152-
const city = 'New York'; // [Optional]
153-
const region = 'New York'; // [Optional]
154-
const star_rating = 4; // [Optional] Star rating of the hotel from 2 to 5
155-
const number_of_nights = 2; // [Optional] Default value is 1
156-
const number_of_rooms = 2; // [Optional] Default value is 1
157-
patch.estimates.createHotelEstimate({
158-
country_code,
159-
city,
160-
region,
161-
star_rating,
162-
number_of_nights,
163-
number_of_rooms
164-
});
165-
166150
// Retrieve an estimate
167151
const estimateId = 'est_test_1234';
168152
patch.estimates.retrieveEstimate(estimate_id);

package-lock.json

Lines changed: 45 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@patch-technology/patch",
3-
"version": "2.3.1",
3+
"version": "2.4.0",
44
"description": "Node.js wrapper for the Patch API",
55
"license": "MIT",
66
"repository": {

src/ApiClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ApiClient {
1616
};
1717

1818
this.defaultHeaders = {
19-
'User-Agent': 'patch-node/2.3.1',
19+
'User-Agent': 'patch-node/2.4.0',
2020
'Patch-Version': 2
2121
};
2222

src/api/EstimatesApi.js

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import ApiClient from '../ApiClient';
99
import CreateAirShippingEstimateRequest from '../model/CreateAirShippingEstimateRequest';
1010
import CreateBitcoinEstimateRequest from '../model/CreateBitcoinEstimateRequest';
1111
import CreateFlightEstimateRequest from '../model/CreateFlightEstimateRequest';
12-
import CreateHotelEstimateRequest from '../model/CreateHotelEstimateRequest';
1312
import CreateMassEstimateRequest from '../model/CreateMassEstimateRequest';
1413
import CreateRailShippingEstimateRequest from '../model/CreateRailShippingEstimateRequest';
1514
import CreateRoadShippingEstimateRequest from '../model/CreateRoadShippingEstimateRequest';
@@ -188,60 +187,6 @@ export default class EstimatesApi {
188187
);
189188
}
190189

191-
createHotelEstimateWithHttpInfo(createHotelEstimateRequest, opts) {
192-
opts = opts || {};
193-
194-
const _createHotelEstimateRequest =
195-
CreateHotelEstimateRequest.constructFromObject(
196-
createHotelEstimateRequest,
197-
new CreateHotelEstimateRequest()
198-
);
199-
200-
// verify the required parameter 'createHotelEstimateRequest' is set
201-
if (
202-
_createHotelEstimateRequest === undefined ||
203-
_createHotelEstimateRequest === null
204-
) {
205-
throw new Error(
206-
"Missing the required parameter 'createHotelEstimateRequest' when calling createHotelEstimate"
207-
);
208-
}
209-
210-
let postBody = _createHotelEstimateRequest;
211-
let pathParams = {};
212-
let queryParams = {};
213-
let headerParams = {
214-
'Patch-Version': opts['patchVersion']
215-
};
216-
let formParams = {};
217-
218-
let authNames = ['bearer_auth'];
219-
let contentTypes = ['application/json'];
220-
let accepts = ['application/json'];
221-
let returnType = EstimateResponse;
222-
223-
return this.apiClient.callApi(
224-
'/v1/estimates/hotel',
225-
'POST',
226-
pathParams,
227-
queryParams,
228-
headerParams,
229-
formParams,
230-
postBody,
231-
authNames,
232-
contentTypes,
233-
accepts,
234-
returnType
235-
);
236-
}
237-
238-
createHotelEstimate(createHotelEstimateRequest, opts) {
239-
return this.createHotelEstimateWithHttpInfo(
240-
createHotelEstimateRequest,
241-
opts
242-
);
243-
}
244-
245190
createMassEstimateWithHttpInfo(createMassEstimateRequest, opts) {
246191
opts = opts || {};
247192

src/model/CreateHotelEstimateRequest.js

Lines changed: 0 additions & 93 deletions
This file was deleted.

test/integration/estimates.test.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,6 @@ describe('Estimates Integration', function () {
7575
expect(estimate1.mass_g).to.be.below(estimate2.mass_g);
7676
});
7777

78-
it('supports creating hotel estimates', async function () {
79-
const createEstimateResponse = await patch.estimates.createHotelEstimate({
80-
country_code: 'US',
81-
city: 'New York',
82-
region: 'New York',
83-
star_rating: 5,
84-
number_of_nights: 2,
85-
number_of_rooms: 2
86-
});
87-
const estimate = createEstimateResponse.data;
88-
89-
expect(estimate.type).to.be.eq('hotel');
90-
expect(estimate.mass_g).to.be.above(150_000);
91-
expect(estimate.production).to.be.eq(false);
92-
});
93-
9478
it('supports creating air shipping estimates from airports', async function () {
9579
const createEstimateResponse =
9680
await patch.estimates.createAirShippingEstimate({

0 commit comments

Comments
 (0)