Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@patch-technology/patch",
"version": "1.24.0",
"version": "1.25.0",
"description": "Node.js wrapper for the Patch API",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ApiClient {
};

this.defaultHeaders = {
'User-Agent': 'patch-node/1.24.0'
'User-Agent': 'patch-node/1.25.0'
};

/**
Expand Down
8 changes: 2 additions & 6 deletions src/api/OrdersApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,10 @@ export default class OrdersApi {
placeOrderWithHttpInfo(id, opts) {
opts = opts || {};

const _placeOrderRequest = PlaceOrderRequest.constructFromObject(
opts,
new CreateOrderRequest()
);
let postBody = _placeOrderRequest;
let postBody = opts['placeOrderRequest'];

// verify the required parameter 'id' is set
if (id === undefined || id === null) {
if (_id === undefined || _id === null) {
Comment on lines -107 to +110
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@holtbp it's very interesting that you're getting this change to. This one is wrong and breaks the functionality. The syntax is not even correct since _id is not defined.

Comment on lines -107 to +110
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change shouldn't happen. It's not even valid javascript since _id does not exist.

throw new Error(
"Missing the required parameter 'id' when calling placeOrder"
);
Expand Down
127 changes: 58 additions & 69 deletions src/model/CreateAirShippingEstimateRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,91 +7,80 @@

import ApiClient from '../ApiClient';


class CreateAirShippingEstimateRequest {
constructor() {
CreateAirShippingEstimateRequest.initialize(this);
}

static initialize(obj) {}

static constructFromObject(data, obj) {
if (data) {
obj = obj || new CreateAirShippingEstimateRequest();

if (data.hasOwnProperty('destination_airport')) {
obj['destination_airport'] = ApiClient.convertToType(
data['destination_airport'],
'String'
);
}

if (data.hasOwnProperty('origin_airport')) {
obj['origin_airport'] = ApiClient.convertToType(
data['origin_airport'],
'String'
);
}

if (data.hasOwnProperty('aircraft_code')) {
obj['aircraft_code'] = ApiClient.convertToType(
data['aircraft_code'],
'String'
);
}

if (data.hasOwnProperty('aircraft_type')) {
obj['aircraft_type'] = ApiClient.convertToType(
data['aircraft_type'],
'String'
);
}

if (data.hasOwnProperty('freight_mass_g')) {
obj['freight_mass_g'] = ApiClient.convertToType(
data['freight_mass_g'],
'Number'
);
}

if (data.hasOwnProperty('emissions_scope')) {
obj['emissions_scope'] = ApiClient.convertToType(
data['emissions_scope'],
'String'
);
}

if (data.hasOwnProperty('project_id')) {
obj['project_id'] = ApiClient.convertToType(
data['project_id'],
'String'
);
}

if (data.hasOwnProperty('create_order')) {
obj['create_order'] = ApiClient.convertToType(
data['create_order'],
'Boolean'
);
}
constructor() {

CreateAirShippingEstimateRequest.initialize(this);
}

static initialize(obj) {
}
return obj;
}

static constructFromObject(data, obj) {
if (data) {
obj = obj || new CreateAirShippingEstimateRequest();


if (data.hasOwnProperty('destination_airport')) {
obj['destination_airport'] = ApiClient.convertToType(data['destination_airport'], 'String');
}

if (data.hasOwnProperty('origin_airport')) {
obj['origin_airport'] = ApiClient.convertToType(data['origin_airport'], 'String');
}

if (data.hasOwnProperty('aircraft_code')) {
obj['aircraft_code'] = ApiClient.convertToType(data['aircraft_code'], 'String');
}

if (data.hasOwnProperty('aircraft_type')) {
obj['aircraft_type'] = ApiClient.convertToType(data['aircraft_type'], 'String');
}

if (data.hasOwnProperty('freight_mass_g')) {
obj['freight_mass_g'] = ApiClient.convertToType(data['freight_mass_g'], 'Number');
}

if (data.hasOwnProperty('emissions_scope')) {
obj['emissions_scope'] = ApiClient.convertToType(data['emissions_scope'], 'String');
}

if (data.hasOwnProperty('project_id')) {
obj['project_id'] = ApiClient.convertToType(data['project_id'], 'String');
}

if (data.hasOwnProperty('create_order')) {
obj['create_order'] = ApiClient.convertToType(data['create_order'], 'Boolean');
}

}
return obj;
}


}


CreateAirShippingEstimateRequest.prototype['destination_airport'] = undefined;

CreateAirShippingEstimateRequest.prototype['origin_airport'] = undefined;

CreateAirShippingEstimateRequest.prototype['aircraft_code'] = undefined;

CreateAirShippingEstimateRequest.prototype['aircraft_type'] = 'unknown';
CreateAirShippingEstimateRequest.prototype['aircraft_type'] = 'unknown';

CreateAirShippingEstimateRequest.prototype['freight_mass_g'] = undefined;

CreateAirShippingEstimateRequest.prototype['emissions_scope'] = 'wtw';
CreateAirShippingEstimateRequest.prototype['emissions_scope'] = 'wtw';

CreateAirShippingEstimateRequest.prototype['project_id'] = undefined;

CreateAirShippingEstimateRequest.prototype['create_order'] = false;




export default CreateAirShippingEstimateRequest;


4 changes: 2 additions & 2 deletions src/model/CreateOrderRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ class CreateOrderRequest {
obj['unit'] = ApiClient.convertToType(data['unit'], 'String');
}

if (data.hasOwnProperty('issuedTo')) {
if (data.hasOwnProperty('issued_to')) {
obj['issued_to'] = V1OrdersIssuedTo.constructFromObject(
data['issuedTo']
data['issued_to']
);
}
}
Expand Down
Loading