Skip to content

Commit 064d53e

Browse files
Merge pull request #587 from HubSpot/feature/fixCrmObjectsCreatesMethods
Change status code to 201 in create methods of CRM Objects
2 parents aeea871 + edf4135 commit 064d53e

17 files changed

Lines changed: 235 additions & 237 deletions

File tree

codegen/Crm/Commerce/Invoices/Api/BasicApi.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function archiveWithHttpInfo($invoice_id, string $contentType = self::con
205205
$e->setResponseObject($data);
206206
throw $e;
207207
}
208-
208+
209209

210210
throw $e;
211211
}
@@ -292,7 +292,7 @@ public function archiveRequest($invoice_id, string $contentType = self::contentT
292292
if (!preg_match("/.+/", $invoice_id)) {
293293
throw new \InvalidArgumentException("invalid value for \"invoice_id\" when calling BasicApi.archive, must conform to the pattern /.+/.");
294294
}
295-
295+
296296

297297
$resourcePath = '/crm/v3/objects/invoices/{invoiceId}';
298298
$formParams = [];
@@ -428,7 +428,7 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
428428

429429

430430
switch($statusCode) {
431-
case 200:
431+
case 201:
432432
return $this->handleResponseWithDataType(
433433
'\HubSpot\Client\Crm\Commerce\Invoices\Model\SimplePublicObject',
434434
$request,
@@ -442,7 +442,7 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
442442
);
443443
}
444444

445-
445+
446446

447447
if ($statusCode < 200 || $statusCode > 299) {
448448
throw new ApiException(
@@ -481,7 +481,7 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
481481
$e->setResponseObject($data);
482482
throw $e;
483483
}
484-
484+
485485

486486
throw $e;
487487
}
@@ -737,7 +737,7 @@ public function getByIdWithHttpInfo($invoice_id, $properties = null, $properties
737737
);
738738
}
739739

740-
740+
741741

742742
if ($statusCode < 200 || $statusCode > 299) {
743743
throw new ApiException(
@@ -776,7 +776,7 @@ public function getByIdWithHttpInfo($invoice_id, $properties = null, $properties
776776
$e->setResponseObject($data);
777777
throw $e;
778778
}
779-
779+
780780

781781
throw $e;
782782
}
@@ -891,7 +891,7 @@ public function getByIdRequest($invoice_id, $properties = null, $properties_with
891891
if (!preg_match("/.+/", $invoice_id)) {
892892
throw new \InvalidArgumentException("invalid value for \"invoice_id\" when calling BasicApi.getById, must conform to the pattern /.+/.");
893893
}
894-
894+
895895

896896

897897

@@ -1101,7 +1101,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu
11011101
);
11021102
}
11031103

1104-
1104+
11051105

11061106
if ($statusCode < 200 || $statusCode > 299) {
11071107
throw new ApiException(
@@ -1140,7 +1140,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu
11401140
$e->setResponseObject($data);
11411141
throw $e;
11421142
}
1143-
1143+
11441144

11451145
throw $e;
11461146
}
@@ -1451,7 +1451,7 @@ public function updateWithHttpInfo($invoice_id, $simple_public_object_input, $id
14511451
);
14521452
}
14531453

1454-
1454+
14551455

14561456
if ($statusCode < 200 || $statusCode > 299) {
14571457
throw new ApiException(
@@ -1490,7 +1490,7 @@ public function updateWithHttpInfo($invoice_id, $simple_public_object_input, $id
14901490
$e->setResponseObject($data);
14911491
throw $e;
14921492
}
1493-
1493+
14941494

14951495
throw $e;
14961496
}
@@ -1596,7 +1596,7 @@ public function updateRequest($invoice_id, $simple_public_object_input, $id_prop
15961596
if (!preg_match("/.+/", $invoice_id)) {
15971597
throw new \InvalidArgumentException("invalid value for \"invoice_id\" when calling BasicApi.update, must conform to the pattern /.+/.");
15981598
}
1599-
1599+
16001600
// verify the required parameter 'simple_public_object_input' is set
16011601
if ($simple_public_object_input === null || (is_array($simple_public_object_input) && count($simple_public_object_input) === 0)) {
16021602
throw new \InvalidArgumentException(

codegen/Crm/Companies/Api/BasicApi.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function archiveWithHttpInfo($company_id, string $contentType = self::con
208208
$e->setResponseObject($data);
209209
throw $e;
210210
}
211-
211+
212212

213213
throw $e;
214214
}
@@ -295,7 +295,7 @@ public function archiveRequest($company_id, string $contentType = self::contentT
295295
if (!preg_match("/.+/", $company_id)) {
296296
throw new \InvalidArgumentException("invalid value for \"company_id\" when calling BasicApi.archive, must conform to the pattern /.+/.");
297297
}
298-
298+
299299

300300
$resourcePath = '/crm/v3/objects/companies/{companyId}';
301301
$formParams = [];
@@ -431,7 +431,7 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
431431

432432

433433
switch($statusCode) {
434-
case 200:
434+
case 201:
435435
return $this->handleResponseWithDataType(
436436
'\HubSpot\Client\Crm\Companies\Model\SimplePublicObject',
437437
$request,
@@ -445,8 +445,6 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
445445
);
446446
}
447447

448-
449-
450448
if ($statusCode < 200 || $statusCode > 299) {
451449
throw new ApiException(
452450
sprintf(
@@ -484,7 +482,7 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
484482
$e->setResponseObject($data);
485483
throw $e;
486484
}
487-
485+
488486

489487
throw $e;
490488
}
@@ -740,7 +738,7 @@ public function getByIdWithHttpInfo($company_id, $properties = null, $properties
740738
);
741739
}
742740

743-
741+
744742

745743
if ($statusCode < 200 || $statusCode > 299) {
746744
throw new ApiException(
@@ -779,7 +777,7 @@ public function getByIdWithHttpInfo($company_id, $properties = null, $properties
779777
$e->setResponseObject($data);
780778
throw $e;
781779
}
782-
780+
783781

784782
throw $e;
785783
}
@@ -894,7 +892,7 @@ public function getByIdRequest($company_id, $properties = null, $properties_with
894892
if (!preg_match("/.+/", $company_id)) {
895893
throw new \InvalidArgumentException("invalid value for \"company_id\" when calling BasicApi.getById, must conform to the pattern /.+/.");
896894
}
897-
895+
898896

899897

900898

@@ -1104,7 +1102,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu
11041102
);
11051103
}
11061104

1107-
1105+
11081106

11091107
if ($statusCode < 200 || $statusCode > 299) {
11101108
throw new ApiException(
@@ -1143,7 +1141,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu
11431141
$e->setResponseObject($data);
11441142
throw $e;
11451143
}
1146-
1144+
11471145

11481146
throw $e;
11491147
}
@@ -1450,7 +1448,7 @@ public function mergeWithHttpInfo($public_merge_input, string $contentType = sel
14501448
);
14511449
}
14521450

1453-
1451+
14541452

14551453
if ($statusCode < 200 || $statusCode > 299) {
14561454
throw new ApiException(
@@ -1489,7 +1487,7 @@ public function mergeWithHttpInfo($public_merge_input, string $contentType = sel
14891487
$e->setResponseObject($data);
14901488
throw $e;
14911489
}
1492-
1490+
14931491

14941492
throw $e;
14951493
}
@@ -1739,7 +1737,7 @@ public function updateWithHttpInfo($company_id, $simple_public_object_input, $id
17391737
);
17401738
}
17411739

1742-
1740+
17431741

17441742
if ($statusCode < 200 || $statusCode > 299) {
17451743
throw new ApiException(
@@ -1778,7 +1776,7 @@ public function updateWithHttpInfo($company_id, $simple_public_object_input, $id
17781776
$e->setResponseObject($data);
17791777
throw $e;
17801778
}
1781-
1779+
17821780

17831781
throw $e;
17841782
}
@@ -1884,7 +1882,7 @@ public function updateRequest($company_id, $simple_public_object_input, $id_prop
18841882
if (!preg_match("/.+/", $company_id)) {
18851883
throw new \InvalidArgumentException("invalid value for \"company_id\" when calling BasicApi.update, must conform to the pattern /.+/.");
18861884
}
1887-
1885+
18881886
// verify the required parameter 'simple_public_object_input' is set
18891887
if ($simple_public_object_input === null || (is_array($simple_public_object_input) && count($simple_public_object_input) === 0)) {
18901888
throw new \InvalidArgumentException(

codegen/Crm/Deals/Api/BasicApi.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function archiveWithHttpInfo($deal_id, string $contentType = self::conten
208208
$e->setResponseObject($data);
209209
throw $e;
210210
}
211-
211+
212212

213213
throw $e;
214214
}
@@ -295,7 +295,7 @@ public function archiveRequest($deal_id, string $contentType = self::contentType
295295
if (!preg_match("/.+/", $deal_id)) {
296296
throw new \InvalidArgumentException("invalid value for \"deal_id\" when calling BasicApi.archive, must conform to the pattern /.+/.");
297297
}
298-
298+
299299

300300
$resourcePath = '/crm/v3/objects/0-3/{dealId}';
301301
$formParams = [];
@@ -431,7 +431,7 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
431431

432432

433433
switch($statusCode) {
434-
case 200:
434+
case 201:
435435
return $this->handleResponseWithDataType(
436436
'\HubSpot\Client\Crm\Deals\Model\SimplePublicObject',
437437
$request,
@@ -445,7 +445,7 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
445445
);
446446
}
447447

448-
448+
449449

450450
if ($statusCode < 200 || $statusCode > 299) {
451451
throw new ApiException(
@@ -484,7 +484,7 @@ public function createWithHttpInfo($simple_public_object_input_for_create, strin
484484
$e->setResponseObject($data);
485485
throw $e;
486486
}
487-
487+
488488

489489
throw $e;
490490
}
@@ -740,7 +740,7 @@ public function getByIdWithHttpInfo($deal_id, $properties = null, $properties_wi
740740
);
741741
}
742742

743-
743+
744744

745745
if ($statusCode < 200 || $statusCode > 299) {
746746
throw new ApiException(
@@ -779,7 +779,7 @@ public function getByIdWithHttpInfo($deal_id, $properties = null, $properties_wi
779779
$e->setResponseObject($data);
780780
throw $e;
781781
}
782-
782+
783783

784784
throw $e;
785785
}
@@ -894,7 +894,7 @@ public function getByIdRequest($deal_id, $properties = null, $properties_with_hi
894894
if (!preg_match("/.+/", $deal_id)) {
895895
throw new \InvalidArgumentException("invalid value for \"deal_id\" when calling BasicApi.getById, must conform to the pattern /.+/.");
896896
}
897-
897+
898898

899899

900900

@@ -1104,7 +1104,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu
11041104
);
11051105
}
11061106

1107-
1107+
11081108

11091109
if ($statusCode < 200 || $statusCode > 299) {
11101110
throw new ApiException(
@@ -1143,7 +1143,7 @@ public function getPageWithHttpInfo($limit = 10, $after = null, $properties = nu
11431143
$e->setResponseObject($data);
11441144
throw $e;
11451145
}
1146-
1146+
11471147

11481148
throw $e;
11491149
}
@@ -1450,7 +1450,7 @@ public function mergeWithHttpInfo($public_merge_input, string $contentType = sel
14501450
);
14511451
}
14521452

1453-
1453+
14541454

14551455
if ($statusCode < 200 || $statusCode > 299) {
14561456
throw new ApiException(
@@ -1489,7 +1489,7 @@ public function mergeWithHttpInfo($public_merge_input, string $contentType = sel
14891489
$e->setResponseObject($data);
14901490
throw $e;
14911491
}
1492-
1492+
14931493

14941494
throw $e;
14951495
}
@@ -1739,7 +1739,7 @@ public function updateWithHttpInfo($deal_id, $simple_public_object_input, $id_pr
17391739
);
17401740
}
17411741

1742-
1742+
17431743

17441744
if ($statusCode < 200 || $statusCode > 299) {
17451745
throw new ApiException(
@@ -1778,7 +1778,7 @@ public function updateWithHttpInfo($deal_id, $simple_public_object_input, $id_pr
17781778
$e->setResponseObject($data);
17791779
throw $e;
17801780
}
1781-
1781+
17821782

17831783
throw $e;
17841784
}
@@ -1884,7 +1884,7 @@ public function updateRequest($deal_id, $simple_public_object_input, $id_propert
18841884
if (!preg_match("/.+/", $deal_id)) {
18851885
throw new \InvalidArgumentException("invalid value for \"deal_id\" when calling BasicApi.update, must conform to the pattern /.+/.");
18861886
}
1887-
1887+
18881888
// verify the required parameter 'simple_public_object_input' is set
18891889
if ($simple_public_object_input === null || (is_array($simple_public_object_input) && count($simple_public_object_input) === 0)) {
18901890
throw new \InvalidArgumentException(

0 commit comments

Comments
 (0)